| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|
com.newstep.solid.processor.threepass
|
+--com.newstep.solid.processor.threepass.ThreePassProcessor
public class ThreePassProcessor
ThreePassProcessor is the main implementation of the MessageProcessor.
It provides is the main entry point into the processing system.
Messages are passed to the processor via the process() method.
The three pass processor decouples the decoding of Messages into Events from the processing of the Events.
This decoupling allows the processing to be scalled independently for each of the tasks.
The processing framework splits the message processing into three distinct phases:
i) message decoding and handler lookup for resulting events
ii) dispatching of events into handler
iii) processing of event by the handler
The ThreePassProcessor can be configured such that it guarantees the message
(and event) processing order is maintained.
That is, events arrive in the handler in the same order the that their
associated messages were placed in the processor.
Similarly, the processor framework contains abstractions that allow
event handlers to process events either in parallel or sequentially.
That is, handlers may be created either to allow multiple threads to process
different events with the same handler instance simultaneously OR
to guarantee that only a single thread has access to a handler
instance at a time.
In addition, the framework is designed not to block threads in cases
where their target handler is in use allowing them to drop back to the available pool.
The processing subsystem is designed as an extention to the core Java 1.5 concurrency package facilities.
In order to implement its functionality the ThreePassProcessor leverages the Java 1.5 concurrency Executor concept.
As such, three executors are maintained (one for each phase of processing).
Thus the number of threads associated with each phase can be tuned.
In order to keep the order of the processing consistent across phases,
the processor places a Future returned from one phase to the executor of the next.
This ensures that the subsequent phases cannot execute until the preceding phase has completed.
This also allows the phases to maintain the order of processing.
Implements:
Processor
ThreePassProcessorPoolListener
Links:
Kernel Association Association Link
Associates type:
aggregation
Client cardinality:
0..*
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Directed.
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Custom properties
link:
aggregation
Kernel Association Association Link
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Kernel Association Association Link
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Kernel Association Association Link
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Kernel Association Association Link
Associates type:
aggregation
Client cardinality:
0..*
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Directed.
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Custom properties
link:
aggregation
Dependency Dependency Link
Custom properties
link:
dependency
Dependency Dependency Link
Custom properties
link:
dependency
Dependency Dependency Link
Custom properties
link:
dependency
Dependency Dependency Link
Custom properties
link:
dependency
Generalization Generalization Link
ThreePassProcessor is the main implementation of the MessageProcessor.
It provides is the main entry point into the processing system.
Messages are passed to the processor via the process() method.
The three pass processor decouples the decoding of Messages into Events from the processing of the Events.
This decoupling allows the processing to be scalled independently for each of the tasks.
The processing framework splits the message processing into three distinct phases:
i) message decoding and handler lookup for resulting events
ii) dispatching of events into handler
iii) processing of event by the handler
The ThreePassProcessor can be configured such that it guarantees the message
(and event) processing order is maintained.
That is, events arrive in the handler in the same order the that their
associated messages were placed in the processor.
Similarly, the processor framework contains abstractions that allow
event handlers to process events either in parallel or sequentially.
That is, handlers may be created either to allow multiple threads to process
different events with the same handler instance simultaneously OR
to guarantee that only a single thread has access to a handler
instance at a time.
In addition, the framework is designed not to block threads in cases
where their target handler is in use allowing them to drop back to the available pool.
The processing subsystem is designed as an extention to the core Java 1.5 concurrency package facilities.
In order to implement its functionality the ThreePassProcessor leverages the Java 1.5 concurrency Executor concept.
As such, three executors are maintained (one for each phase of processing).
Thus the number of threads associated with each phase can be tuned.
In order to keep the order of the processing consistent across phases,
the processor places a Future returned from one phase to the executor of the next.
This ensures that the subsequent phases cannot execute until the preceding phase has completed.
This also allows the phases to maintain the order of processing.
Implementation Implementation Link
ThreePassProcessor is the main implementation of the MessageProcessor.
It provides is the main entry point into the processing system.
Messages are passed to the processor via the process() method.
The three pass processor decouples the decoding of Messages into Events from the processing of the Events.
This decoupling allows the processing to be scalled independently for each of the tasks.
The processing framework splits the message processing into three distinct phases:
i) message decoding and handler lookup for resulting events
ii) dispatching of events into handler
iii) processing of event by the handler
The ThreePassProcessor can be configured such that it guarantees the message
(and event) processing order is maintained.
That is, events arrive in the handler in the same order the that their
associated messages were placed in the processor.
Similarly, the processor framework contains abstractions that allow
event handlers to process events either in parallel or sequentially.
That is, handlers may be created either to allow multiple threads to process
different events with the same handler instance simultaneously OR
to guarantee that only a single thread has access to a handler
instance at a time.
In addition, the framework is designed not to block threads in cases
where their target handler is in use allowing them to drop back to the available pool.
The processing subsystem is designed as an extention to the core Java 1.5 concurrency package facilities.
In order to implement its functionality the ThreePassProcessor leverages the Java 1.5 concurrency Executor concept.
As such, three executors are maintained (one for each phase of processing).
Thus the number of threads associated with each phase can be tuned.
In order to keep the order of the processing consistent across phases,
the processor places a Future returned from one phase to the executor of the next.
This ensures that the subsequent phases cannot execute until the preceding phase has completed.
This also allows the phases to maintain the order of processing.
Implementation Implementation Link
ThreePassProcessor is the main implementation of the MessageProcessor.
It provides is the main entry point into the processing system.
Messages are passed to the processor via the process() method.
The three pass processor decouples the decoding of Messages into Events from the processing of the Events.
This decoupling allows the processing to be scalled independently for each of the tasks.
The processing framework splits the message processing into three distinct phases:
i) message decoding and handler lookup for resulting events
ii) dispatching of events into handler
iii) processing of event by the handler
The ThreePassProcessor can be configured such that it guarantees the message
(and event) processing order is maintained.
That is, events arrive in the handler in the same order the that their
associated messages were placed in the processor.
Similarly, the processor framework contains abstractions that allow
event handlers to process events either in parallel or sequentially.
That is, handlers may be created either to allow multiple threads to process
different events with the same handler instance simultaneously OR
to guarantee that only a single thread has access to a handler
instance at a time.
In addition, the framework is designed not to block threads in cases
where their target handler is in use allowing them to drop back to the available pool.
The processing subsystem is designed as an extention to the core Java 1.5 concurrency package facilities.
In order to implement its functionality the ThreePassProcessor leverages the Java 1.5 concurrency Executor concept.
As such, three executors are maintained (one for each phase of processing).
Thus the number of threads associated with each phase can be tuned.
In order to keep the order of the processing consistent across phases,
the processor places a Future returned from one phase to the executor of the next.
This ensures that the subsequent phases cannot execute until the preceding phase has completed.
This also allows the phases to maintain the order of processing.
| Nested Class Summary |
public Static class |
PoolName |
| Field Summary |
|
|
|
|
|
|
|
|
|
|
private static Logger |
|
PoolName |
DECODER_PREDISPATCHER |
PoolName |
DISPATCHER |
PoolName |
PROCESSOR |
private HashMap |
|
| Constructor Summary |
public void |
|
| Method Summary |
|
|
protected synchronized void |
|
protected synchronized void |
|
protected synchronized void |
|
public int |
|
public long |
|
public int |
|
public long |
|
public int |
|
public int |
|
public int |
|
public long |
|
public synchronized void |
|
public synchronized void |
|
public void |
|
public void |
|
public void |
|
public void |
|
Multiplicity:
1
Multiplicity:
1
Multiplicity:
1
Multiplicity:
1
Multiplicity:
1
private static Logger logger
Multiplicity:
1
Static.
private HashMap pools
Multiplicity:
1
Creates a new ThreePassProcessor wirh the specified configuration.
Parameters:
config
Stereotype:
create
Return:
TODO
protected synchronized void doShutdown ()
Synchronized.
Throws:
ExecutableException
protected synchronized void doStart ()
Management interface
Synchronized.
Throws:
ExecutableException
protected synchronized void doStop ()
Synchronized.
Throws:
ExecutableException
public int getActiveCount (PoolName pool)
Parameters:
pool
Return:
the approximate number of threads that are actively executing
tasks on the given pool.
public long getCompletedTaskCount (PoolName pool)
Parameters:
pool
Return:
the approximate total number of tasks that have completed execution
on the given pool
public int getCorePoolSize (PoolName pool)
Parameters:
pool
Return:
the core number of threads for the given pool.
public long getKeepAliveTime (PoolName pool, TimeUnit unit)
Parameters:
pool
unit
Return:
the thread keep-alive time, which is the amount of time which
threads in excess of the core pool size may remain idle before
being terminated.
public int getLargestPoolSize (PoolName pool)
Parameters:
pool
Return:
the largest number of threads that have ever simultaneously been
in the given pool.
public int getMaximumPoolSize (PoolName pool)
Parameters:
pool
Return:
the maximum allowed number of threads for the given pool.
public int getPoolSize (PoolName pool)
Parameters:
pool
Return:
the current number of threads in the pool.
public long getTaskCount (PoolName pool)
Parameters:
pool
Return:
the approximate total number of tasks that have been scheduled
for execution.
public synchronized void poolTerminated (String name)
Synchronized.
Throws:
ExecutableException
Synchronized.
Throws:
ExecutableException
public void process (Event event)
Throws:
ExecutableException
public void setCorePoolSize (PoolName pool, Integer corePoolSize)
Sets the core number of threads on the given pool.
Parameters:
pool
corePoolSize
public void setKeepAliveTime (PoolName pool, Long time, TimeUnit unit)
Sets the time limit for which threads may remain idle before being
terminated.
Parameters:
pool
time
unit
public void setMaximumPoolSize (PoolName pool, Integer maximumPoolSize)
Sets the maximum allowed number of threads for the given pool.
Parameters:
pool
maximumPoolSize
| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|