org.javagroups.protocols
Class LOOPBACK
java.lang.Object
org.javagroups.stack.Protocol
org.javagroups.protocols.LOOPBACK
- public class LOOPBACK
- extends Protocol
Makes copies of outgoing messages, swaps sender and receiver and sends the message back up the stack.
Fields inherited from class org.javagroups.stack.Protocol |
down_handler, down_prot, down_queue, down_thread, down_thread_prio, observer, props, stack, up_handler, up_prot, up_queue, up_thread, up_thread_prio |
Method Summary |
void |
down(Event evt)
Caller by the layer above this layer. |
java.lang.String |
getName()
|
void |
init()
Called after instance has been created (null constructor) and before protocol is started. |
boolean |
setProperties(java.util.Properties props)
Setup the Protocol instance acording to the configuration string |
void |
start()
This method is called on a Channel.connect(String) . |
java.lang.String |
toString()
|
Methods inherited from class org.javagroups.stack.Protocol |
destroy, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, passDown, passUp, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, startDownHandler, startUpHandler, stop, stopInternal, up |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LOOPBACK
public LOOPBACK()
toString
public java.lang.String toString()
getName
public java.lang.String getName()
- Specified by:
getName
in class Protocol
setProperties
public boolean setProperties(java.util.Properties props)
- Setup the Protocol instance acording to the configuration string
- Overrides:
setProperties
in class Protocol
init
public void init()
throws java.lang.Exception
- Description copied from class:
Protocol
- Called after instance has been created (null constructor) and before protocol is started.
Properties are already set. Other protocols are not yet connected and events cannot yet be sent.
- Overrides:
init
in class Protocol
- Throws:
java.lang.Exception
- Thrown if protocol cannot be initialized successfully. This will cause the
ProtocolStack to fail, so the channel constructor will throw an exception
start
public void start()
throws java.lang.Exception
- Description copied from class:
Protocol
- This method is called on a
Channel.connect(String)
. Starts work.
Protocols are connected and queues are ready to receive events.
Will be called from bottom to top. This call will replace
the START and START_OK events.
- Overrides:
start
in class Protocol
- Throws:
java.lang.Exception
- Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
to fail, so Channel.connect(String)
will throw an exception
down
public void down(Event evt)
- Caller by the layer above this layer. Usually we just put this Message
into the send queue and let one or more worker threads handle it. A worker thread
then removes the Message from the send queue, performs a conversion and adds the
modified Message to the send queue of the layer below it, by calling Down).
- Overrides:
down
in class Protocol
Copyright © 2001,2002 www.javagroups.com . All Rights Reserved.