|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.stack.Protocol org.jgroups.protocols.TP org.jgroups.protocols.EMU_UDP
public class EMU_UDP
This protocol is an adaptation of the original UDP from JGroups in order to control the transport layer in emulated environments
Nested Class Summary | |
---|---|
class |
EMU_UDP.UcastReceiver
|
Nested classes/interfaces inherited from class org.jgroups.protocols.TP |
---|
org.jgroups.protocols.TP.IncomingMessageHandler, org.jgroups.protocols.TP.IncomingPacket, org.jgroups.protocols.TP.IncomingPacketHandler, org.jgroups.protocols.TP.ThreadNamingPattern |
Field Summary | |
---|---|
(package private) int |
emu_node_id
Number of the emulated node |
(package private) int |
emu_port
Port number of the emulated node |
(package private) boolean |
ip_mcast
Whether to enable IP multicasting. |
(package private) int |
ip_ttl
The time-to-live (TTL) for multicast datagram packets |
(package private) org.jgroups.stack.IpAddress |
mcast_addr
The multicast address (mcast address and port) this member uses |
(package private) java.lang.String |
mcast_addr_name
The multicast address used for sending and receiving packets |
(package private) int |
mcast_port
The multicast port used for sending and receiving packets |
(package private) java.lang.Thread |
mcast_receiver
The multicast receiver thread |
(package private) int |
mcast_recv_buf_size
Receive buffer size of the multicast datagram socket |
(package private) int |
mcast_send_buf_size
Send buffer size of the multicast datagram socket |
(package private) int |
num_last_ports
Maintain a list of local ports opened by DatagramSocket. |
(package private) VirtualDatagramSocket |
sock
Socket used for sending unicast packets and receiving unicast packets The address of this socket will be our local address (local_addr) |
(package private) int |
tos
Traffic class for sending unicast and multicast datagrams. |
(package private) EMU_UDP.UcastReceiver |
ucast_receiver
The unicast receiver thread |
(package private) int |
ucast_recv_buf_size
Receive buffer size of the unicast datagram socket |
(package private) int |
ucast_send_buf_size
Send buffer size of the unicast datagram socket |
Fields inherited from class org.jgroups.protocols.TP |
---|
additional_data, bind_addr, bind_port, channel_name, diagnostics_addr, diagnostics_port, dis, discard_incompatible_packets, enable_bundling, enable_diagnostics, f, header, in_stream, incoming_msg_handler, incoming_msg_queue, incoming_packet_handler, incoming_packet_queue, LIST, local_addr, loopback, max_bundle_size, max_bundle_timeout, members, MULTICAST, name, num_bytes_received, num_bytes_sent, num_incoming_msgs_received, num_msgs_received, num_msgs_sent, num_oob_msgs_received, OOB, oob_thread_pool, oob_thread_pool_enabled, oob_thread_pool_keep_alive_time, oob_thread_pool_max_threads, oob_thread_pool_min_threads, oob_thread_pool_queue, oob_thread_pool_queue_enabled, oob_thread_pool_queue_max_size, oob_thread_pool_rejection_policy, pool_thread_group, port_range, receive_interfaces, receive_on_all_interfaces, send_interfaces, send_on_all_interfaces, thread_naming_pattern, thread_pool, thread_pool_enabled, thread_pool_keep_alive_time, thread_pool_max_threads, thread_pool_min_threads, thread_pool_queue, thread_pool_queue_enabled, thread_pool_queue_max_size, thread_pool_rejection_policy, timer, use_concurrent_stack, use_incoming_packet_handler, use_local_host, view |
Fields inherited from class org.jgroups.stack.Protocol |
---|
down_prot, log, props, stack, stats, up_prot |
Constructor Summary | |
---|---|
EMU_UDP()
Creates the EMU_UDP protocol, and initializes the state variables, does however not start any sockets or threads. |
Method Summary | |
---|---|
(package private) void |
closeSockets()
Closed UDP unicast and multicast sockets |
protected VirtualDatagramSocket |
createVirtualDatagramSocket()
|
java.lang.String |
getInfo()
|
java.lang.String |
getName()
|
protected void |
handleConfigEvent(java.util.HashMap map)
|
void |
postUnmarshalling(org.jgroups.Message msg,
org.jgroups.Address dest,
org.jgroups.Address src,
boolean multicast)
|
void |
postUnmarshallingList(org.jgroups.Message msg,
org.jgroups.Address dest,
boolean multicast)
|
void |
sendToAllMembers(byte[] data,
int offset,
int length)
|
void |
sendToSingleMember(org.jgroups.Address dest,
byte[] data,
int offset,
int length)
|
boolean |
setProperties(java.util.Properties props)
Setup the Protocol instance acording to the configuration string. |
protected void |
setThreadNames()
|
void |
start()
Creates the unicast and multicast sockets and starts the unicast and multicast receiver threads |
(package private) void |
startThreads()
Starts the unicast and multicast receiver threads |
void |
stop()
|
(package private) void |
stopThreads()
Stops unicast and multicast receiver threads |
protected void |
unsetThreadNames()
|
Methods inherited from class org.jgroups.protocols.TP |
---|
|
Methods inherited from class org.jgroups.stack.Protocol |
---|
destroy, downThreadEnabled, enableStats, getDownProtocol, getProperties, getUpProtocol, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, setDownProtocol, setPropertiesInternal, setProtocolStack, setUpProtocol, statsEnabled, upThreadEnabled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
VirtualDatagramSocket sock
int num_last_ports
int tos
DatagramSocket.setTrafficClass(int)
); for details):
IPTOS_LOWCOST (0x02)
, decimal 2IPTOS_RELIABILITY (0x04)
<, decimal 4/LI>
IPTOS_THROUGHPUT (0x08)
, decimal 8IPTOS_LOWDELAY (0x10)
, decimal 16
org.jgroups.stack.IpAddress mcast_addr
java.lang.String mcast_addr_name
int mcast_port
java.lang.Thread mcast_receiver
EMU_UDP.UcastReceiver ucast_receiver
boolean ip_mcast
int ip_ttl
int mcast_send_buf_size
int mcast_recv_buf_size
int ucast_send_buf_size
int ucast_recv_buf_size
int emu_node_id
int emu_port
Constructor Detail |
---|
public EMU_UDP()
Method Detail |
---|
public java.lang.String getInfo()
getInfo
in class org.jgroups.protocols.TP
public java.lang.String getName()
getName
in class org.jgroups.stack.Protocol
public void postUnmarshalling(org.jgroups.Message msg, org.jgroups.Address dest, org.jgroups.Address src, boolean multicast)
postUnmarshalling
in class org.jgroups.protocols.TP
public void postUnmarshallingList(org.jgroups.Message msg, org.jgroups.Address dest, boolean multicast)
postUnmarshallingList
in class org.jgroups.protocols.TP
public void sendToAllMembers(byte[] data, int offset, int length) throws java.lang.Exception
sendToAllMembers
in class org.jgroups.protocols.TP
java.lang.Exception
public void sendToSingleMember(org.jgroups.Address dest, byte[] data, int offset, int length) throws java.lang.Exception
sendToSingleMember
in class org.jgroups.protocols.TP
java.lang.Exception
public boolean setProperties(java.util.Properties props)
setProperties
in class org.jgroups.protocols.TP
public void start() throws java.lang.Exception
start
in class org.jgroups.protocols.TP
java.lang.Exception
public void stop()
stop
in class org.jgroups.protocols.TP
protected VirtualDatagramSocket createVirtualDatagramSocket() throws java.net.SocketException
java.net.SocketException
protected void handleConfigEvent(java.util.HashMap map)
handleConfigEvent
in class org.jgroups.protocols.TP
protected void setThreadNames()
setThreadNames
in class org.jgroups.protocols.TP
protected void unsetThreadNames()
unsetThreadNames
in class org.jgroups.protocols.TP
void closeSockets()
void startThreads() throws java.lang.Exception
java.lang.Exception
void stopThreads()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |