cad.simcad.cac.network
Class RMINetworkAcceptor
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--cad.simcad.cac.network.RMINetworkAcceptor
- All Implemented Interfaces:
- NetworkAcceptor, java.rmi.Remote, java.io.Serializable
- public class RMINetworkAcceptor
- extends java.rmi.server.UnicastRemoteObject
- implements NetworkAcceptor
Interface of the Dispatcher, server-side.
- Author:
- Charles-Philip Bentley
- See Also:
- Serialized Form
Field Summary |
static int |
PORT
|
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
PORT
public static int PORT
RMINetworkAcceptor
public RMINetworkAcceptor(CacMediatorI cacm,
MissionManager m)
throws java.rmi.RemoteException
acceptConnection
public boolean acceptConnection(CADConnection c)
- Description copied from interface:
NetworkAcceptor
- Method for accepting connections
- Specified by:
acceptConnection
in interface NetworkAcceptor
- Returns:
- true if connection is accepted
false if connection is not accepted
recieveData
public void recieveData(FieldSet fs)
- Method for recieving data from a NetworkConnector
- Specified by:
recieveData
in interface NetworkAcceptor
- Pre:
- Connection established
- Post:
- FieldSet fs is sent to the user of this NetworkAcceptor
closeConnection
public void closeConnection(CADConnection c)
- Close a connection. Dump it
- Specified by:
closeConnection
in interface NetworkAcceptor
- Parameters:
c
- a CADConnection object- Pre:
- The CADConnection is known by the NetworkAcceptor.
- Post:
- The NetworkAcceptor has closed the connection.
main
public static void main(java.lang.String[] args)
registerNewEmergencyVehicle
public EmergencyVehicule registerNewEmergencyVehicle()
throws java.rmi.RemoteException,
PersistentDataException
- Ask to CAC to register a new EmergencyVehicle in its Persistent Data storage
returns the newly create EmergencyVehicule
- Specified by:
registerNewEmergencyVehicle
in interface NetworkAcceptor
java.rmi.RemoteException
PersistentDataException
updateWorldMap
public void updateWorldMap(AbstractMap am)
throws java.rmi.RemoteException
- Update the Map ued by the Main Server. For example if a new road has been built
- Specified by:
updateWorldMap
in interface NetworkAcceptor
- Pre:
- -
java.rmi.RemoteException
- Post:
- The map used by the main server is now am
With the help of www.sourceforge.net and www.info.ucl.ac.be