Class ServicePoolAgent
- java.lang.Object
-
- jadex.platform.service.servicepool.ServicePoolAgent
-
- All Implemented Interfaces:
IServicePoolService
public class ServicePoolAgent extends java.lang.Object implements IServicePoolService
The service pool agent can be used to handle services in a pooled manner. Via its service pool service interface new service types can be registered (and removed). For each registered service the agent will create a proxy service that is found via search. Incoming service invocations are routed towards the concrete handler agents that are either already in the pool or are created up to a creation limit.
-
-
Field Summary
Fields Modifier and Type Field Description protected IInternalAccess
agent
The agent.protected java.util.Map<java.lang.Class<?>,ServiceHandler>
servicetypes
The registered service types.
-
Constructor Summary
Constructors Constructor Description ServicePoolAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Void>
addServiceType(java.lang.Class<?> servicetype, IPoolStrategy strategy, java.lang.String componentmodel)
Add a new service type and a strategy.IFuture<java.lang.Void>
addServiceType(java.lang.Class<?> servicetype, IPoolStrategy strategy, java.lang.String componentmodel, CreationInfo info, PublishInfo pi)
Add a new service type and a strategy.IFuture<java.lang.Void>
addServiceType(java.lang.Class<?> servicetype, IPoolStrategy strategy, java.lang.String componentmodel, CreationInfo info, PublishInfo pi, ServiceScope scope)
Add a new service type and a strategy.IFuture<java.lang.Void>
addServiceType(java.lang.Class<?> servicetype, java.lang.String componentmodel)
Add a new service type and a strategy.IFuture<java.lang.Void>
addServiceType(java.lang.Class<?> servicetype, java.lang.String componentmodel, CreationInfo info)
Add a new service type and a strategy.IFuture<java.lang.Void>
agentCreated()
Called once after agent creation.protected IPoolStrategy
getDefaultStrategy()
IFuture<java.lang.Void>
removeServiceType(java.lang.Class<?> servicetype)
Remove a service type.
-
-
-
Field Detail
-
agent
protected IInternalAccess agent
The agent.
-
servicetypes
protected java.util.Map<java.lang.Class<?>,ServiceHandler> servicetypes
The registered service types.
-
-
Method Detail
-
agentCreated
public IFuture<java.lang.Void> agentCreated()
Called once after agent creation.
-
addServiceType
public IFuture<java.lang.Void> addServiceType(java.lang.Class<?> servicetype, java.lang.String componentmodel)
Add a new service type and a strategy.- Specified by:
addServiceType
in interfaceIServicePoolService
- Parameters:
servicetype
- The service type.componentmodel
- The component model.
-
addServiceType
public IFuture<java.lang.Void> addServiceType(java.lang.Class<?> servicetype, java.lang.String componentmodel, CreationInfo info)
Add a new service type and a strategy.- Specified by:
addServiceType
in interfaceIServicePoolService
- Parameters:
servicetype
- The service type.componentmodel
- The component model.info
- The creation info.
-
addServiceType
public IFuture<java.lang.Void> addServiceType(java.lang.Class<?> servicetype, IPoolStrategy strategy, java.lang.String componentmodel)
Add a new service type and a strategy.- Specified by:
addServiceType
in interfaceIServicePoolService
- Parameters:
servicetype
- The service type.strategy
- The service pool strategy.componentmodel
- The component model.
-
addServiceType
public IFuture<java.lang.Void> addServiceType(java.lang.Class<?> servicetype, IPoolStrategy strategy, java.lang.String componentmodel, CreationInfo info, PublishInfo pi)
Add a new service type and a strategy.- Parameters:
servicetype
- The service type.strategy
- The service pool strategy.
-
addServiceType
public IFuture<java.lang.Void> addServiceType(java.lang.Class<?> servicetype, IPoolStrategy strategy, java.lang.String componentmodel, CreationInfo info, PublishInfo pi, ServiceScope scope)
Add a new service type and a strategy.- Specified by:
addServiceType
in interfaceIServicePoolService
- Parameters:
servicetype
- The service type.strategy
- The service pool strategy.componentmodel
- The component model.info
- The worker creation info.pi
- The worker publish info.scope
- The service publication scope.
-
removeServiceType
public IFuture<java.lang.Void> removeServiceType(java.lang.Class<?> servicetype)
Remove a service type.- Specified by:
removeServiceType
in interfaceIServicePoolService
- Parameters:
servicetype
- The service type.
-
getDefaultStrategy
protected IPoolStrategy getDefaultStrategy()
-
-