Class SequentialMultiplexDistributor
- java.lang.Object
-
- jadex.bridge.service.component.multiinvoke.SimpleMultiplexDistributor
-
- jadex.bridge.service.component.multiinvoke.SequentialMultiplexDistributor
-
- All Implemented Interfaces:
IMultiplexDistributor
public class SequentialMultiplexDistributor extends SimpleMultiplexDistributor
Sequential call distributor. It determines: - which services are called: services are called as long as arguments are available - with which arguments: each argument array once - when finished: after all arguments have been used
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<IService>
busyservices
The list of busy services.protected java.util.List<IService>
freeservices
The list of free services.protected java.util.Iterator<java.lang.Object[]>
itargs
The arguments.protected java.util.List<Future<IService>>
waitingcalls
The waiting for service calls.
-
Constructor Summary
Constructors Constructor Description SequentialMultiplexDistributor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addService(IService service)
Add a new service.void
checkPerformCall(IService service)
Check perform call.protected void
freeService(IService service)
protected java.util.Iterator<java.lang.Object[]>
getArgumentIterator()
Get the argument iterator.java.lang.Object[]
getArguments()
Get the arguments for a call.protected IFuture<IService>
getFreeService(IService service)
Get the service for a call.boolean
hasArguments()
Test if has arguments.IIntermediateFuture<java.lang.Object>
init(java.lang.reflect.Method method, java.lang.Object[] args, IFilter<Tuple2<IService,java.lang.Object[]>> filter, IParameterConverter conv)
Start the distributor.void
serviceSearchFinished()
Notify that the search has finished.-
Methods inherited from class jadex.bridge.service.component.multiinvoke.SimpleMultiplexDistributor
performCall
-
-
-
-
Method Detail
-
init
public IIntermediateFuture<java.lang.Object> init(java.lang.reflect.Method method, java.lang.Object[] args, IFilter<Tuple2<IService,java.lang.Object[]>> filter, IParameterConverter conv)
Start the distributor.- Specified by:
init
in interfaceIMultiplexDistributor
- Overrides:
init
in classSimpleMultiplexDistributor
-
addService
public void addService(IService service)
Add a new service.- Specified by:
addService
in interfaceIMultiplexDistributor
- Overrides:
addService
in classSimpleMultiplexDistributor
- Parameters:
service
- The service.
-
serviceSearchFinished
public void serviceSearchFinished()
Notify that the search has finished.- Specified by:
serviceSearchFinished
in interfaceIMultiplexDistributor
- Overrides:
serviceSearchFinished
in classSimpleMultiplexDistributor
-
getArgumentIterator
protected java.util.Iterator<java.lang.Object[]> getArgumentIterator()
Get the argument iterator.
-
getArguments
public java.lang.Object[] getArguments()
Get the arguments for a call.- Overrides:
getArguments
in classSimpleMultiplexDistributor
- Returns:
- The arguments.
-
hasArguments
public boolean hasArguments()
Test if has arguments.- Returns:
- True if has args.
-
getFreeService
protected IFuture<IService> getFreeService(IService service)
Get the service for a call.- Returns:
- The service.
-
freeService
protected void freeService(IService service)
-
checkPerformCall
public void checkPerformCall(IService service)
Check perform call.- Overrides:
checkPerformCall
in classSimpleMultiplexDistributor
-
-