|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.javagroups.stack.Protocol | +--org.javagroups.protocols.AUTOCONF
Senses the network configuration when it is initialized (in init()) and sends a CONFIG event up
and down the stack. The CONFIG event contains a hashmap, with strings as keys (e.g. "frag_size")
and Objects as values. Certain protocols can set some of their properties when receiving the CONFIG
event.
This protocol should be placed above the transport protocol (e.g. UDP). It is not needed for TCP.
Example: senses the network send and receive buffers, plus the max size of a message to be sent and
generates a CONFIG event containing "frag_size", "send_buf_size" and "receive_buf_size" keys.
Field Summary |
---|
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 |
Constructor Summary | |
---|---|
AUTOCONF()
|
Method Summary | |
---|---|
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) . |
void |
startDownHandler()
Leave empty: no down_thread will be created, but the down_thread of the neighbor above us will be used |
void |
startUpHandler()
Leave empty: no up_thread will be created, but the up_thread of the neighbor below us will be used |
Methods inherited from class org.javagroups.stack.Protocol |
---|
destroy, down, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, passDown, passUp, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, stop, stopInternal, up |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AUTOCONF()
Method Detail |
public java.lang.String getName()
getName
in class Protocol
public void init() throws java.lang.Exception
Protocol
init
in class Protocol
java.lang.Exception
- Thrown if protocol cannot be initialized successfully. This will cause the
ProtocolStack to fail, so the channel constructor will throw an exceptionpublic void start() throws java.lang.Exception
Protocol
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.
start
in class Protocol
java.lang.Exception
- Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
to fail, so Channel.connect(String)
will throw an exceptionpublic boolean setProperties(java.util.Properties props)
setProperties
in class Protocol
public void startUpHandler()
startUpHandler
in class Protocol
public void startDownHandler()
startDownHandler
in class Protocol
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |