Update of /cvsroot/jicarilla/jicarilla-sandbox/platform/framework/impl/src/java/org/jicarilla/framework/plumbing
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5809/platform/framework/impl/src/java/org/jicarilla/framework/plumbing
Added Files:
BarrierProcessor.java
Log Message:
unfinished piece of plumbing
--- NEW FILE: BarrierProcessor.java ---
/* ====================================================================
The Jicarilla Software License
Copyright (c) 2003 Leo Simons.
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
==================================================================== */
package org.jicarilla.framework.plumbing;
import EDU.oswego.cs.dl.util.concurrent.Channel;
/**
* <p>A Barrier Processor runs am enqueued message through
* several stages, <i>in its own thread</i>, before dequeueing it.
* In a diagram:</p>
*
* <pre>
* +-----------------------------------------------+
* |Barrierprocessor +------------+ |
* | ...................| Worker |... |
* | . . +------------+ . |
* | . . . . |
* put() |+---------+ +------+ +------+ +---------+ | take()
* ------>|Channel |->|Stage1|->|Stage2|->|Channel |------->
* |+---------+ +------+ +------+ +---------+ |
* +-----------------------------------------------+
* </pre>
*
* <p>Use a barrier processor if you need to shield stages that are
* not thread safe from receiving messages from multiple concurrent
* threads. Note a barrier processor may create a big bottleneck in
* your system. If this happens, you should consider redesigning
* your application so that you can either use multiple
* singlethreaded stages of the same type, or change those stages to
* be thread-safe. The former is usually the more performant option,
* but the latter may be easier (by using synchronization in the
* appropriate places in your code).</p>
*
* @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
* @version $Id: BarrierProcessor.java,v 1.1 2004/03/08 20:07:25 lsimons Exp $
*/
public class BarrierProcessor extends DefaultStage
{
public BarrierProcessor( Channel channel, Sink errorHandler )
{
super( channel, errorHandler );
}
}
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.