|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jgroup.relacs.simulator.SocketStatusImpl
public class SocketStatusImpl
Implementation of the SocketStatus
interface,
allowing an external entity (the simulator) to set the status
of particular links from the JVM hosting this instance of the
SocketStatusImpl. Note that objects within the local JVM may
obtain a reference to a "singlton" instance of this class, and
thus query the link connectivity map through the
isReliable()
method.
Field Summary |
---|
Fields inherited from interface jgroup.relacs.simulator.SocketStatus |
---|
BASE, SOCKET_STATUS |
Method Summary | |
---|---|
void |
commit()
This method must be invoked before the current reachability pattern will be activated. |
java.util.Map<java.net.InetAddress,java.lang.Integer> |
getStatus()
Returns the content of the current socket status object. |
static SocketStatusImpl |
instance()
Obtain the local instance of the socket status object. |
boolean |
isReliable(java.net.InetAddress address)
Check if the link to the given internet address is considered reliable. |
boolean |
isReliable(java.lang.String hostname)
Check if the link to the given internet host is considered reliable. |
void |
notifyStatus(java.util.Map<java.net.InetAddress,java.lang.Integer> committedLinks)
Notifies any registered socket status implementations of the most recently commited reachability pattern of the local socket status instance. |
void |
register(SocketStatus sStatus)
Register the given socket status object with this socket status implementation, so as to notify the other socket status instances of changes to the reachability pattern. |
void |
setStatus(java.net.InetAddress inet,
int prob)
Set the probability of a datagram packet to be correctly delivered at the host identified by inet . |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static SocketStatusImpl instance()
public boolean isReliable(java.net.InetAddress address)
public boolean isReliable(java.lang.String hostname) throws java.net.UnknownHostException
java.net.UnknownHostException
public void register(SocketStatus sStatus) throws java.rmi.RemoteException
SocketStatus
register
in interface SocketStatus
java.rmi.RemoteException
public void commit() throws java.rmi.RemoteException
SocketStatus
setStatus
methods, an invocation of this method
will activate the newly set reachability pattern.
commit
in interface SocketStatus
java.rmi.RemoteException
public void notifyStatus(java.util.Map<java.net.InetAddress,java.lang.Integer> committedLinks) throws java.rmi.RemoteException
SocketStatus
notifyStatus
in interface SocketStatus
java.rmi.RemoteException
public java.util.Map<java.net.InetAddress,java.lang.Integer> getStatus() throws java.rmi.RemoteException
SocketStatus
getStatus
in interface SocketStatus
java.rmi.RemoteException
public void setStatus(java.net.InetAddress inet, int prob) throws java.rmi.RemoteException
SocketStatus
inet
. The probability is
defined as prob
/ BASE
.
setStatus
in interface SocketStatus
java.rmi.RemoteException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |