org.jgroups.protocols

Class AUTOCONF

public class AUTOCONF extends Protocol

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.

Author: Bela Ban

Method Summary
StringgetName()
voidinit()
static voidmain(String[] args)
intsenseMaxFragSize()
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).
static intsenseMaxFragSizeStatic()
booleansetProperties(Properties props)
Setup the Protocol instance acording to the configuration string
voidstart()
voidstartDownHandler()
Leave empty: no down_thread will be created, but the down_thread of the neighbor above us will be used
voidstartUpHandler()
Leave empty: no up_thread will be created, but the up_thread of the neighbor below us will be used

Method Detail

getName

public String getName()

init

public void init()

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

start

public void start()

startDownHandler

public void startDownHandler()
Leave empty: no down_thread will be created, but the down_thread of the neighbor above us will be used

startUpHandler

public void startUpHandler()
Leave empty: no up_thread will be created, but the up_thread of the neighbor below us will be used
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.