Class GlobalServicePoolTargetResolver
- java.lang.Object
-
- jadex.platform.service.globalservicepool.GlobalServicePoolTargetResolver
-
- All Implemented Interfaces:
ITargetResolver
public class GlobalServicePoolTargetResolver extends java.lang.Object implements ITargetResolver
The service pool target resolver is the client side of a global pool manager. It has the purpose the direct the call to a suitable service worker from the queue of workers. The resolver is used by a) the RemoteMethodInvocationHandler in case of RMI calls b) the IntelligentProxyInterceptor in case of local calls The ITargetResolver.TARGETRESOLVER constant is used by both to determine the redirection target.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<IServiceIdentifier>
brokens
The reported to be broken services.protected int
position
The position counter.protected IIntermediateFuture<IService>
searchfuture
The search future.protected IndexMap<IServiceIdentifier,IService>
services
The cached target services.protected java.util.Map<IServiceIdentifier,UsageInfo>
usageinfos
The current usage info.-
Fields inherited from interface jadex.bridge.ITargetResolver
TARGETRESOLVER
-
-
Constructor Summary
Constructors Constructor Description GlobalServicePoolTargetResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<IService>
determineTarget(IServiceIdentifier sid, IExternalAccess agent, IServiceIdentifier broken)
Determine the target of a call.protected IFuture<java.lang.Void>
reportUsage(IService ser, IExternalAccess agent, IServiceIdentifier sid)
Save usage info and send it in certain intervals.protected IIntermediateFuture<IService>
searchServices(IServiceIdentifier sid, IExternalAccess agent)
Search for services a call can be redirected to.
-
-
-
Field Detail
-
services
protected IndexMap<IServiceIdentifier,IService> services
The cached target services.
-
brokens
protected java.util.Set<IServiceIdentifier> brokens
The reported to be broken services.
-
position
protected int position
The position counter.
-
searchfuture
protected IIntermediateFuture<IService> searchfuture
The search future. Only one search at the same time.
-
usageinfos
protected java.util.Map<IServiceIdentifier,UsageInfo> usageinfos
The current usage info.
-
-
Method Detail
-
determineTarget
public IFuture<IService> determineTarget(IServiceIdentifier sid, IExternalAccess agent, IServiceIdentifier broken)
Determine the target of a call.- Specified by:
determineTarget
in interfaceITargetResolver
- Parameters:
sid
- The service identifier of the original call.agent
- The external access.- Returns:
- The new service that should be called instead of the original one.
-
searchServices
protected IIntermediateFuture<IService> searchServices(IServiceIdentifier sid, IExternalAccess agent)
Search for services a call can be redirected to. Contacts the IGlobalPoolManagementService to get services.
-
reportUsage
protected IFuture<java.lang.Void> reportUsage(IService ser, IExternalAccess agent, IServiceIdentifier sid)
Save usage info and send it in certain intervals.
-
-