org.jicarilla.framework.plumbing
Class Connector
java.lang.Object
org.jicarilla.framework.AbstractActive
org.jicarilla.framework.AbstractExecutable
org.jicarilla.framework.plumbing.Connector
- All Implemented Interfaces:
- Active
- public class Connector
- extends AbstractExecutable
Sets up a connection between a source and a sink that will do nothing but
continuously move messages from source to sink. In other words, use a
Connector to creates a zero-length pipe/channel between a
source and a sink. This movement is done by a supplied Executor,
so will happen asynchronously.
Note that this class is Active, and extends from
AbstractExecutable. As such, you should not override the
AbstractActive.initialize() nor the AbstractActive.dispose() methods, but only ever
override AbstractExecutable.doInitialize() and/or AbstractExecutable.doDispose(). When you do,
make sure to call the overridden methods as well.
- Version:
- $Id: Connector.java,v 1.1 2004/01/05 15:41:51 lsimons Exp $
- Author:
- Leo Simons
|
Field Summary |
protected Sink |
m_sink
The sink to send messages to. |
protected Source |
m_source
The source to retrieve messages from. |
|
Constructor Summary |
Connector(Source source,
Sink sink,
Executor executor)
Create a new instance. |
|
Method Summary |
protected void |
work()
Get a message from the source and send it to the sink. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_source
protected final Source m_source
- The source to retrieve messages from.
m_sink
protected final Sink m_sink
- The sink to send messages to.
Connector
public Connector(Source source,
Sink sink,
Executor executor)
- Create a new instance.
- Parameters:
source - the source to retrieve messages fromsink - the sink to send messages toexecutor - the executor to pass on to AbstractExecutable
work
protected void work()
throws java.lang.InterruptedException
- Get a message from the source and send it to the sink.
- Overrides:
work in class AbstractExecutable
- Throws:
java.lang.InterruptedException - if the current thread has been
Thread.interrupt()ed
Copyright © 2004 Leo Simons. All Rights Reserved.