|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.UCL.xmiddle.framework.controller.Network | +--edu.UCL.xmiddle.controller.UDPNetwork
Field Summary | |
static java.lang.String |
IP
|
static int |
MAX_SEGMENT
|
static int |
PORT
|
int |
PRIVATE_PORT
|
Fields inherited from class edu.UCL.xmiddle.framework.controller.Network |
activeSessions, caller, CONNECTED, DISCONNECTED, localhost, locator, status |
Constructor Summary | |
UDPNetwork(LocalHost localhost,
Manager manager)
Creates a new UDPNetwork instance. |
Method Summary | |
boolean |
connect()
Connects to the network |
Listener |
createListener(Host host,
java.lang.Object sessionID)
Returns a listener to the given host for the given protocol session. |
Sender |
createSender(Host host,
java.lang.Object sessionID)
Not implemented (see createListener) |
void |
disconnect()
Immediatly disconnects from the network, killing all protocols and acknowledgers that are running |
void |
exit()
Signifies that we are about to exit |
java.net.MulticastSocket |
getConnection()
Returns the multicast socket used to communicate with the xmiddle group |
void |
registerSession(ProtocolChooser session)
Registers a new protocol session |
void |
removeSession(java.lang.Object sessionID)
Removes a protocol session |
void |
run()
receives messages sent and queues them to be processed by the message queue processor |
boolean |
send(Data data)
Sends data to a remote host |
Methods inherited from class edu.UCL.xmiddle.framework.controller.Network |
getStatus, setLocator |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public int PRIVATE_PORT
public static final int PORT
public static final java.lang.String IP
public static int MAX_SEGMENT
Constructor Detail |
public UDPNetwork(LocalHost localhost, Manager manager)
UDPNetwork
instance.
localhost
- a reference to the localhost so that we can
queue requestsmanager
- not used currently (can be null)Method Detail |
public void run()
run
in interface java.lang.Runnable
run
in class Network
public java.net.MulticastSocket getConnection()
MulticastSocket
valuepublic boolean connect()
connect
in class Network
public void disconnect()
disconnect
in class Network
public void exit()
exit
in class Network
public boolean send(Data data)
send
in class Network
data
- a Data
value
boolean
valuepublic Sender createSender(Host host, java.lang.Object sessionID)
createSender
in class Network
host
- a Host
valuesessionID
- an Object
value
Sender
valuepublic Listener createListener(Host host, java.lang.Object sessionID)
createListener
in class Network
host
- the remote hostsessionID
- The id of the session for which this listener
is being created
Listener
valuepublic void removeSession(java.lang.Object sessionID) throws InvalidSessionIDException
removeSession
in class Network
sessionID
- The session ID
InvalidSessionIDException
- if the session was not registeredpublic void registerSession(ProtocolChooser session) throws ExistingSessionIDException
registerSession
in class Network
session
- a ProtocolChooser
value
ExistingSessionIDException
- if a session with the
same ID has been registered
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |