org.apache.excalibur.event.command
Class TPSPThreadManager.SourceDequeueInterceptor

java.lang.Object
  extended byorg.apache.excalibur.event.command.TPSPThreadManager.SourceDequeueInterceptor
All Implemented Interfaces:
DequeueInterceptor
Enclosing class:
TPSPThreadManager

protected static final class TPSPThreadManager.SourceDequeueInterceptor
extends java.lang.Object
implements DequeueInterceptor

This is used to plug into Queues so that we can intercept calls to the dequeue operation.


Constructor Summary
TPSPThreadManager.SourceDequeueInterceptor(TPSPThreadManager.SourceRunner runner, EventHandler handler, EDU.oswego.cs.dl.util.concurrent.PooledExecutor threadPool, int threshold, int margin)
          Create a new SourceDequeueInterceptor.
 
Method Summary
 void after(Source context)
          An operation executed after dequeing events from the queue.
 void before(Source context)
          An operation executed before dequeing events from the queue.
 void stop()
          Ensure all event runners are stopped for this partial pipeline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TPSPThreadManager.SourceDequeueInterceptor

public TPSPThreadManager.SourceDequeueInterceptor(TPSPThreadManager.SourceRunner runner,
                                                  EventHandler handler,
                                                  EDU.oswego.cs.dl.util.concurrent.PooledExecutor threadPool,
                                                  int threshold,
                                                  int margin)
Create a new SourceDequeueInterceptor. The parameters are used to ensure a working environment.

Parameters:
runner - The initial SourceRunner.
handler - The EventHandler to send events to.
threadPool - The PooledExecutor for the set of threads.
threshold - The threshold of events before a new thread is executed.
margin - The margin of error allowed for the events.
Method Detail

before

public void before(Source context)
An operation executed before dequeing events from the queue. The Source is passed in so the implementation can determine to execute based on the queue properties.

This method is called once at the beginning of any dequeue method regardless of how many queue elements are dequeued.

Specified by:
before in interface DequeueInterceptor
Parameters:
context - The source from which the dequeue is performed.
Since:
Feb 10, 2003

after

public void after(Source context)
An operation executed after dequeing events from the queue. The Source is passed in so the implementation can determine to execute based on the queue properties.

This method is called once at the end of any dequeue method regardless of how many queue elements are dequeued.

Specified by:
after in interface DequeueInterceptor
Parameters:
context - The source from which the dequeue is performed.
Since:
Feb 10, 2003

stop

public void stop()
Ensure all event runners are stopped for this partial pipeline.



Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.