org.jacp.api.component
Interface IStateLessCallabackComponent<L,A,M>
- Type Parameters:
L
- defines the action listener typeA
- defines the basic action typeM
- defines the basic message type
- All Superinterfaces:
- java.lang.Cloneable, ICallbackComponent<L,A,M>, IComponent<L,A,M>, IHandleable<A,M>, ISubComponent<L,A,M>
public interface IStateLessCallabackComponent<L,A,M>
- extends ICallbackComponent<L,A,M>
Represents a state less background/callback component. This component has a
typical handle method, the return value is typically a non UI value (but it
can be). Every message to this component should be handled in a separate
thread and component instance, managed by an executor (to avoid garbage). Do
not use private members as it is not guaranteed that that you contact the
same instance twice. This component type is good for scaling tasks like
performing operations on many folders or tables in database. The return value
will be send to message caller or to specified handleTargetId.
- Author:
- Andy Moncsek
Method Summary |
java.util.concurrent.ExecutorService |
getExecutorService()
returns associated executor service |
java.util.List<ICallbackComponent<L,A,M>> |
getInstances()
return instances of current state less component |
java.util.concurrent.atomic.AtomicInteger |
getThreadCounter()
returns thread counter to coordinate amount of existing instances of
sateless callback component |
getInstances
java.util.List<ICallbackComponent<L,A,M>> getInstances()
- return instances of current state less component
- Returns:
- an new callback instance
getThreadCounter
java.util.concurrent.atomic.AtomicInteger getThreadCounter()
- returns thread counter to coordinate amount of existing instances of
sateless callback component
- Returns:
- the counter
getExecutorService
java.util.concurrent.ExecutorService getExecutorService()
- returns associated executor service
- Returns:
- the execution service