Class SimpleMultiplexDistributor
- java.lang.Object
-
- jadex.bridge.service.component.multiinvoke.SimpleMultiplexDistributor
-
- All Implemented Interfaces:
IMultiplexDistributor
- Direct Known Subclasses:
SequentialMultiplexDistributor
public class SimpleMultiplexDistributor extends java.lang.Object implements IMultiplexDistributor
Simple multiplex call distributor. It determines: - which services are called: all services found one time - with which arguments: all with the same single argument set - when finished: after each service has been called once
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object[]
args
The arguments.protected IParameterConverter
conv
The parameter converter.protected IFilter<Tuple2<IService,java.lang.Object[]>>
filter
The service filter.protected java.lang.reflect.Method
method
The method.protected IntermediateFuture<java.lang.Object>
results
The results.
-
Constructor Summary
Constructors Constructor Description SimpleMultiplexDistributor()
-
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.java.lang.Object[]
getArguments()
Get the arguments for a call.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.java.lang.Object
performCall(IService service, java.lang.Object[] args)
Perform a call on given service with given arguments.void
serviceSearchFinished()
Notify that the search has finished.
-
-
-
Field Detail
-
method
protected java.lang.reflect.Method method
The method.
-
args
protected java.lang.Object[] args
The arguments.
-
results
protected IntermediateFuture<java.lang.Object> results
The results.
-
conv
protected IParameterConverter conv
The parameter converter.
-
-
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
-
addService
public void addService(IService service)
Add a new service.- Specified by:
addService
in interfaceIMultiplexDistributor
- Parameters:
service
- The service.
-
serviceSearchFinished
public void serviceSearchFinished()
Notify that the search has finished.- Specified by:
serviceSearchFinished
in interfaceIMultiplexDistributor
-
getArguments
public java.lang.Object[] getArguments()
Get the arguments for a call.- Returns:
- The arguments.
-
checkPerformCall
public void checkPerformCall(IService service)
Check perform call.
-
performCall
public java.lang.Object performCall(IService service, java.lang.Object[] args) throws java.lang.Exception
Perform a call on given service with given arguments.- Throws:
java.lang.Exception
-
-