org.jgroups.protocols
Class 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.
- Bela Ban
down_handler , down_prot , down_queue , down_thread , down_thread_prio , log , observer , props , stack , up_handler , up_prot , up_queue , up_thread , up_thread_prio |
String | getName()
|
void | init() - Called after instance has been created (null constructor) and before protocol is started.
|
static void | main(String[] args)
|
int | senseMaxFragSize() - Tries to find out the max number of bytes in a DatagramPacket we can send by sending increasingly
larger packets, until there is an exception (e.g.
|
static int | senseMaxFragSizeStatic()
|
boolean | setProperties(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
|
destroy , down , getDownProtocol , getDownQueue , getName , getProperties , getUpProtocol , getUpQueue , handleSpecialDownEvent , init , passDown , passUp , providedDownServices , providedUpServices , receiveDownEvent , receiveUpEvent , requiredDownServices , requiredUpServices , setDownProtocol , setObserver , setProperties , setPropertiesInternal , setProtocolStack , setUpProtocol , start , startDownHandler , startUpHandler , stop , stopInternal , up |
getName
public String getName()
- getName in interface Protocol
init
public void init()
throws Exception
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.
- init in interface Protocol
main
public static void main(String[] args)
senseMaxFragSize
public int senseMaxFragSize()
Tries to find out the max number of bytes in a DatagramPacket we can send by sending increasingly
larger packets, until there is an exception (e.g. java.io.IOException: message too long)
senseMaxFragSizeStatic
public static int senseMaxFragSizeStatic()
setProperties
public boolean setProperties(Properties props)
Setup the Protocol instance acording to the configuration string
- setProperties in interface Protocol
start
public void start()
throws Exception
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.
- start in interface Protocol
startDownHandler
public void startDownHandler()
Leave empty: no down_thread will be created, but the down_thread of the neighbor above us will be used
- startDownHandler in interface Protocol
startUpHandler
public void startUpHandler()
Leave empty: no up_thread will be created, but the up_thread of the neighbor below us will be used
- startUpHandler in interface Protocol
Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.