Package fr.dyade.aaa.agent
Class UDPNetwork
- java.lang.Object
-
- fr.dyade.aaa.agent.Network
-
- fr.dyade.aaa.agent.UDPNetwork
-
- All Implemented Interfaces:
MessageComparator,MessageConsumer,NetworkMBean,UDPNetworkMBean
public class UDPNetwork extends Network implements UDPNetworkMBean
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classUDPNetwork.DatagramOutputStreamClass used to send messages with UDP packets.(package private) classUDPNetwork.MessageAndIndexA particular structure used to remember: the sent message. the index of the first packet containing the message. the number of packets used to send the message.(package private) classUDPNetwork.MessageBuilderClass used to transform UDP packets into a stream, to build the messages.(package private) classUDPNetwork.NetServerIn(package private) classUDPNetwork.NetServerOut(package private) classUDPNetwork.NetworkInputStream(package private) classUDPNetwork.ServerInfoStructure storing details about a particular remote network.static interfaceUDPNetwork.ServerInfoMBean(package private) classUDPNetwork.WatchDog-
Nested classes/interfaces inherited from class fr.dyade.aaa.agent.Network
Network.NetworkAverageLoadTask
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intDATAGRAM_MAX_SIZEThe maximum number of bytes of one datagramprivate UDPNetwork.NetServerInnetServerInInput componentprivate UDPNetwork.NetServerOutnetServerOutOutput componentprivate Hashtable<SocketAddress,UDPNetwork.ServerInfo>serversInfoAn hashtable linking a socket address to some information about datagrams sent/received/ackedprivate DatagramSocketsocketA socket used to send and receive datagramsprivate intsocketReceiveBufferSizeValue of the SO_RCVBUF option for the DatagramSocket, that is the buffer size used by the platform for input on the DatagramSocket.private intsocketSendBufferSizeValue of the SO_SNDBUF option for the DatagramSocket, that is the buffer size used by the platform for output on the DatagramSocket(package private) UDPNetwork.WatchDogwatchDog-
Fields inherited from class fr.dyade.aaa.agent.Network
ALREADY_DELIVERED, averageLoadTask, bootTSFN, DEBUG, DELIVER, domain, idxLS, logger, name, nbMessageIn, nbMessageOut, port, qout, servers, serversFN, sid, WDActivationPeriod, WDNbRetryLevel1, WDNbRetryLevel2, WDRetryPeriod1, WDRetryPeriod2, WDRetryPeriod3
-
-
Constructor Summary
Constructors Constructor Description UDPNetwork()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private StringgetMBeanName(String socketAddress)intgetSocketReceiveBufferSize()intgetSocketSendBufferSize()voidinit(String name, int port, short[] servers)Initializes a new network component.booleanisRunning()Tests if the engine is alive.voidstart()Causes this network to begin execution.voidstop()Forces the engine to stop executing-
Methods inherited from class fr.dyade.aaa.agent.Network
addServer, channelPostAndValidate, checkActive, delete, deleteMessage, deliver, delServer, getAverageLoad1, getAverageLoad15, getAverageLoad5, getBootTS, getDomainName, getMessageDest, getMessageSource, getName, getNbMessageReceived, getNbMessageSent, getNbWaitingMessages, getPort, getQueue, getStamp, getWDActivationPeriod, getWDNbRetryLevel1, getWDNbRetryLevel2, getWDRetryPeriod1, getWDRetryPeriod2, getWDRetryPeriod3, index, insert, isPrior, post, postAndValidate, postMessage, prepareMessage, prepareMessageWithoutStamp, resetServer, restore, save, saveChannel, setMessageSource, setPort, setProperties, setStamp, setWDActivationPeriod, setWDNbRetryLevel1, setWDNbRetryLevel2, setWDRetryPeriod1, setWDRetryPeriod2, setWDRetryPeriod3, testBootTS, testRecvUpdate, toString, validate, validateChannel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface fr.dyade.aaa.agent.NetworkMBean
getAverageLoad1, getAverageLoad15, getAverageLoad5, getName, getNbMessageReceived, getNbMessageSent, getNbWaitingMessages, getWDActivationPeriod, getWDNbRetryLevel1, getWDNbRetryLevel2, getWDRetryPeriod1, getWDRetryPeriod2, getWDRetryPeriod3, setWDActivationPeriod, setWDNbRetryLevel1, setWDNbRetryLevel2, setWDRetryPeriod1, setWDRetryPeriod2, setWDRetryPeriod3, toString
-
-
-
-
Field Detail
-
DATAGRAM_MAX_SIZE
static final int DATAGRAM_MAX_SIZE
The maximum number of bytes of one datagram- See Also:
- Constant Field Values
-
netServerIn
private UDPNetwork.NetServerIn netServerIn
Input component
-
netServerOut
private UDPNetwork.NetServerOut netServerOut
Output component
-
serversInfo
private Hashtable<SocketAddress,UDPNetwork.ServerInfo> serversInfo
An hashtable linking a socket address to some information about datagrams sent/received/acked
-
watchDog
UDPNetwork.WatchDog watchDog
-
socket
private DatagramSocket socket
A socket used to send and receive datagrams
-
socketReceiveBufferSize
private int socketReceiveBufferSize
Value of the SO_RCVBUF option for the DatagramSocket, that is the buffer size used by the platform for input on the DatagramSocket.
-
socketSendBufferSize
private int socketSendBufferSize
Value of the SO_SNDBUF option for the DatagramSocket, that is the buffer size used by the platform for output on the DatagramSocket
-
-
Method Detail
-
isRunning
public boolean isRunning()
Description copied from interface:NetworkMBeanTests if the engine is alive.- Specified by:
isRunningin interfaceMessageConsumer- Specified by:
isRunningin interfaceNetworkMBean- Returns:
- true if this
MessageConsumeris alive; false otherwise.
-
init
public void init(String name, int port, short[] servers) throws Exception
Description copied from class:NetworkInitializes a new network component. This method is used in order to easily creates and configure a Network component from a class name. So we can use theClass.newInstance()method for create (without any parameter) the component, then we can initialize it with this method.
This method initializes the logical clock for the domain.
-
start
public void start() throws ExceptionDescription copied from interface:NetworkMBeanCauses this network to begin execution.- Specified by:
startin interfaceMessageConsumer- Specified by:
startin interfaceNetworkMBean- Throws:
Exception- an error occurs.- See Also:
MessageConsumer.stop()
-
stop
public void stop()
Description copied from interface:NetworkMBeanForces the engine to stop executing- Specified by:
stopin interfaceMessageConsumer- Specified by:
stopin interfaceNetworkMBean- See Also:
MessageConsumer.start()
-
getSocketReceiveBufferSize
public int getSocketReceiveBufferSize() throws SocketException- Specified by:
getSocketReceiveBufferSizein interfaceUDPNetworkMBean- Throws:
SocketException
-
getSocketSendBufferSize
public int getSocketSendBufferSize() throws SocketException- Specified by:
getSocketSendBufferSizein interfaceUDPNetworkMBean- Throws:
SocketException
-
-