Logo Search packages:      
Sourcecode: libjgroups-java version File versions

org::jgroups::protocols::TP Class Reference

Inheritance diagram for org::jgroups::protocols::TP:

org::jgroups::stack::Protocol org::jgroups::protocols::BasicTCP org::jgroups::protocols::LOOPBACK org::jgroups::protocols::SHARED_LOOPBACK org::jgroups::protocols::TUNNEL org::jgroups::protocols::UDP org::jgroups::protocols::TCP org::jgroups::protocols::TCP_NIO

List of all members.


Detailed Description

Generic transport - specific implementations should extend this abstract class. Features which are provided to the subclasses include A subclass has to override The create() or start() method has to create a local address.<br The receive(Address, Address, byte[], int, int) method must be called by subclasses when a unicast or multicast message has been received.
Author:
Bela Ban
Version:
Id
TP.java,v 1.160.2.29 2008/06/27 07:36:59 belaban Exp

Definition at line 49 of file TP.java.


Public Member Functions

void destroy ()
Object down (Event evt)
boolean downThreadEnabled ()
Map< String, Object > dumpStats ()
void enableStats (boolean flag)
String getBindAddress ()
int getBindPort ()
boolean getBindToAllInterfaces ()
String getChannelName ()
Executor getDefaultThreadPool ()
ThreadFactory getDefaultThreadPoolThreadFactory ()
Protocol getDownProtocol ()
long getIncomingKeepAliveTime ()
int getIncomingMaxPoolSize ()
int getIncomingMaxQueueSize ()
long getIncomingMessages ()
int getIncomingMinPoolSize ()
int getIncomingPoolSize ()
int getIncomingQueueSize ()
abstract String getInfo ()
Address getLocalAddress ()
int getMaxBundleSize ()
long getMaxBundleTimeout ()
abstract String getName ()
long getNumBytesReceived ()
long getNumBytesSent ()
long getNumMessagesReceived ()
long getNumMessagesSent ()
long getOOBKeepAliveTime ()
int getOOBMaxPoolSize ()
int getOOBMaxQueueSize ()
long getOOBMessages ()
int getOOBMinPoolSize ()
int getOOBPoolSize ()
int getOOBQueueSize ()
Executor getOOBThreadPool ()
ThreadFactory getOOBThreadPoolThreadFactory ()
Properties getProperties ()
ProtocolStack getProtocolStack ()
java.util.List getReceiveInterfaces ()
java.util.List getSendInterfaces ()
String getSingletonName ()
ThreadFactory getThreadFactory ()
String getThreadNamingPattern ()
TimeScheduler getTimer ()
ThreadFactory getTimerThreadFactory ()
Protocol getUpProtocol ()
ConcurrentMap< String, ProtocolgetUpProtocols ()
void init () throws Exception
boolean isDefaulThreadPoolEnabled ()
boolean isDiscardIncompatiblePackets ()
boolean isEnable_unicast_bundling ()
boolean isEnableBundling ()
boolean isLoopback ()
boolean isOOBThreadPoolEnabled ()
boolean isReceiveOnAllInterfaces ()
boolean isSendOnAllInterfaces ()
boolean isUseIncomingPacketHandler ()
abstract void postUnmarshalling (Message msg, Address dest, Address src, boolean multicast)
abstract void postUnmarshallingList (Message msg, Address dest, boolean multicast)
String printStats ()
Vector< Integer > providedDownServices ()
Vector< Integer > providedUpServices ()
Vector< Integer > requiredDownServices ()
Vector< Integer > requiredUpServices ()
void resetStats ()
abstract void sendToAllMembers (byte[] data, int offset, int length) throws Exception
abstract void sendToSingleMember (Address dest, byte[] data, int offset, int length) throws Exception
void sendUpLocalAddressEvent ()
void setBindAddress (String bind_addr) throws UnknownHostException
void setBindPort (int port)
void setBindToAllInterfaces (boolean flag)
void setDefaultThreadPool (Executor thread_pool)
void setDefaultThreadPoolThreadFactory (ThreadFactory factory)
void setDiscardIncompatiblePackets (boolean flag)
void setDownProtocol (Protocol down_prot)
void setEnable_unicast_bundling (boolean enable_unicast_bundling)
void setEnableBundling (boolean flag)
void setIncomingKeepAliveTime (long time)
void setIncomingMaxPoolSize (int size)
void setIncomingMinPoolSize (int size)
void setLoopback (boolean b)
void setMaxBundleSize (int size)
void setMaxBundleTimeout (long timeout)
void setOOBKeepAliveTime (long time)
void setOOBMaxPoolSize (int size)
void setOOBMinPoolSize (int size)
void setOOBThreadPool (Executor oob_thread_pool)
void setOOBThreadPoolThreadFactory (ThreadFactory factory)
boolean setProperties (Properties props)
boolean setPropertiesInternal (Properties props)
void setProtocolStack (ProtocolStack stack)
void setThreadFactory (ThreadFactory factory)
void setTimerThreadFactory (ThreadFactory factory)
void setUpProtocol (Protocol up_prot)
void start () throws Exception
boolean statsEnabled ()
void stop ()
String toString ()
Object up (Event evt)
boolean upThreadEnabled ()

Protected Member Functions

TP getTransport ()
void handleConfigEvent (Map< String, Object > map)
void handleConnect () throws Exception
void handleDisconnect ()
Object handleDownEvent (Event evt)
void passToAllUpProtocols (Event evt)
final void receive (Address dest, Address sender, byte[] data, int offset, int length)
void setThreadNames ()
 TP ()
void unsetThreadNames ()

Static Protected Member Functions

static ExecutorService createThreadPool (int min_threads, int max_threads, long keep_alive_time, String rejection_policy, BlockingQueue< Runnable > queue, final ThreadFactory factory)

Protected Attributes

InetAddress bind_addr = null
String channel_name = null
boolean discard_incompatible_packets = false
Protocol down_prot = null
ThreadFactory global_thread_factory = null
Address local_addr = null
final Log log = LogFactory.getLog(this.getClass())
final HashSet< Addressmembers = new HashSet<Address>(11)
boolean persistent_ports = false
String persistent_ports_file = null
PortsManager pm = null
long pm_expiry_time = 30000L
final Properties props = new Properties()
ProtocolStack stack = null
boolean stats = true
String thread_naming_pattern = "cl"
TimeScheduler timer = null
ThreadFactory timer_thread_factory
Protocol up_prot = null
View view = null

Static Package Functions

 [static initializer]

Package Attributes

byte[] additional_data = null
int bind_port = 0
int connect_count = 0
ThreadFactory default_thread_factory = null
String diagnostics_addr = "224.0.0.75"
int diagnostics_port = 7500
final DataInputStream dis = new DataInputStream(in_stream)
boolean enable_bundling = false
boolean enable_diagnostics = true
boolean enable_unicast_bundling = true
TpHeader header
final ExposedByteArrayInputStream in_stream = new ExposedByteArrayInputStream(new byte[]{'0'})
IncomingMessageHandler incoming_msg_handler
Queue incoming_msg_queue = null
IncomingPacketHandler incoming_packet_handler = null
Queue incoming_packet_queue = null
int init_count = 0
boolean loopback = false
int max_bundle_size = 65535
long max_bundle_timeout = 20
final String name = getName()
long num_bytes_received = 0
long num_bytes_sent = 0
long num_incoming_msgs_received = 0
long num_msgs_received = 0
long num_msgs_sent = 0
long num_oob_msgs_received = 0
int num_timer_threads = 4
ThreadFactory oob_thread_factory = null
Executor oob_thread_pool
boolean oob_thread_pool_enabled = true
long oob_thread_pool_keep_alive_time = 30000
int oob_thread_pool_max_threads = 10
int oob_thread_pool_min_threads = 2
BlockingQueue< Runnable > oob_thread_pool_queue = null
boolean oob_thread_pool_queue_enabled = true
int oob_thread_pool_queue_max_size = 500
String oob_thread_pool_rejection_policy = "Run"
ThreadGroup pool_thread_group = new ThreadGroup(Util.getGlobalThreadGroup(), "Thread Pools")
int port_range = 1
List< NetworkInterface > receive_interfaces = null
boolean receive_on_all_interfaces = false
List< NetworkInterface > send_interfaces = null
boolean send_on_all_interfaces = false
String singleton_name = null
Executor thread_pool
boolean thread_pool_enabled = true
long thread_pool_keep_alive_time = 30000
int thread_pool_max_threads = 10
int thread_pool_min_threads = 2
BlockingQueue< Runnable > thread_pool_queue = null
boolean thread_pool_queue_enabled = true
int thread_pool_queue_max_size = 500
String thread_pool_rejection_policy = "Run"
boolean use_concurrent_stack = true
boolean use_incoming_packet_handler = true
boolean use_local_host = false

Static Package Attributes

static NumberFormat f
static final byte LIST = 1
static final byte MULTICAST = 2
static final byte OOB = 4

Private Member Functions

StringBuilder _getInfo (Channel ch)
void dispatchToThreadPool (Executor pool, Address dest, Address sender, byte[] data, int offset, int length)
void doSend (Buffer buf, Address dest, boolean multicast) throws Exception
void handleDiagnosticProbe (SocketAddress sender, DatagramSocket sock, String request, ProtocolStack stack)
void handleDiagnosticProbe (SocketAddress sender, DatagramSocket sock, String request)
void handleIncomingMessage (Message msg)
void handleIncomingPacket (Address dest, Address sender, byte[] data, int offset, int length)
void passMessageToAll (Event evt)
void passMessageUp (Message msg, boolean perform_cluster_name_matching)
Message readMessage (DataInputStream instream, Address dest, Address sender, boolean multicast) throws Exception
List< MessagereadMessageList (DataInputStream instream, Address dest, boolean multicast) throws Exception
void send (Message msg, Address dest, boolean multicast) throws Exception
void setInAllThreadFactories (String cluster_name, Address local_address, String pattern)
void setSourceAddress (Message msg)
void verifyRejectionPolicy (String str) throws Exception

Static Private Member Functions

static void sendResponse (DatagramSocket sock, SocketAddress sender, byte[] buf) throws IOException
static void shutdownThreadPool (Executor thread_pool)
static void writeMessage (Message msg, DataOutputStream dos, boolean multicast) throws Exception
static void writeMessageList (List< Message > msgs, DataOutputStream dos, boolean multicast) throws Exception

Private Attributes

Bundler bundler = null
DiagnosticsHandler diag_handler = null
final ConcurrentMap< String,
Protocol
up_prots = new ConcurrentHashMap<String,Protocol>()

Static Private Attributes

static final int INITIAL_BUFSIZE = 1024

Classes

class  Bundler
class  DiagnosticsHandler
class  IncomingMessageHandler
class  IncomingPacket
class  IncomingPacketHandler
class  ProtocolAdapter

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index