org.jacp.api.component
Interface IStateLessCallabackComponent<L,A,M>

Type Parameters:
L - defines the action listener type
A - defines the basic action type
M - 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
 
Methods inherited from interface org.jacp.api.component.ICallbackComponent
getHandleTargetAndClear, setHandleTarget
 
Methods inherited from interface org.jacp.api.component.ISubComponent
getExecutionTarget, getNextIncomingMessage, getParentId, hasIncomingMessage, isBlocked, putIncomingMessage, setBlocked, setExecutionTarget, setParentId
 
Methods inherited from interface org.jacp.api.component.IComponent
getActionListener, getId, getName, isActive, isStarted, setActive, setId, setMessageQueue, setName, setStarted
 
Methods inherited from interface org.jacp.api.component.IHandleable
handle
 

Method Detail

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