Class GlobalServicePoolAgent
- java.lang.Object
-
- jadex.platform.service.globalservicepool.GlobalServicePoolAgent
-
- All Implemented Interfaces:
IGlobalPoolManagementService
,IGlobalServicePoolService
public class GlobalServicePoolAgent extends java.lang.Object implements IGlobalServicePoolService, IGlobalPoolManagementService
The global service pool agent can be used to handle services in a pooled manner. A global pool consists of workers on different platforms. These workers typically are local service pools themselves.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
GlobalServicePoolAgent.ForwardHandler
Invocation handler that forwards to the contained local pool.
-
Field Summary
Fields Modifier and Type Field Description protected IInternalAccess
agent
The agent.protected java.util.Map<java.lang.Class<?>,GlobalPoolServiceManager>
managers
The pool manager.
-
Constructor Summary
Constructors Constructor Description GlobalServicePoolAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Void>
addServiceType(java.lang.Class<?> servicetype, java.lang.String componentmodel, CreationInfo info, IGlobalPoolStrategy strategy)
Add a new service type and a strategy.IFuture<java.lang.Void>
agentCreated()
Called once after agent creation.IIntermediateFuture<IService>
getPoolServices(ClassInfo type, java.util.Set<IServiceIdentifier> brokens)
Get a set of services managed by the pool.IFuture<java.lang.Void>
removeServiceType(java.lang.Class<?> servicetype)
Remove a service type.IFuture<java.lang.Void>
sendUsageInfo(java.util.Map<IServiceIdentifier,UsageInfo> infos)
Inform about service usage.
-
-
-
Field Detail
-
agent
protected IInternalAccess agent
The agent.
-
managers
protected java.util.Map<java.lang.Class<?>,GlobalPoolServiceManager> managers
The pool manager.
-
-
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, CreationInfo info, IGlobalPoolStrategy strategy)
Add a new service type and a strategy.- Specified by:
addServiceType
in interfaceIGlobalServicePoolService
- Parameters:
servicetype
- The service type.componentmodel
- The component model.
-
removeServiceType
public IFuture<java.lang.Void> removeServiceType(java.lang.Class<?> servicetype)
Remove a service type.- Specified by:
removeServiceType
in interfaceIGlobalServicePoolService
- Parameters:
servicetype
- The service type.
-
getPoolServices
public IIntermediateFuture<IService> getPoolServices(ClassInfo type, java.util.Set<IServiceIdentifier> brokens)
Get a set of services managed by the pool.- Specified by:
getPoolServices
in interfaceIGlobalPoolManagementService
- Parameters:
type
- The service type.- Returns:
- A number of services from the pool.
-
sendUsageInfo
public IFuture<java.lang.Void> sendUsageInfo(java.util.Map<IServiceIdentifier,UsageInfo> infos)
Inform about service usage.- Specified by:
sendUsageInfo
in interfaceIGlobalPoolManagementService
- Parameters:
The
- usage infos per service class.
-
-