cad.simcad.worldsimulator.objects.parts
Class MDT

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--cad.simcad.worldsimulator.objects.parts.MDT
All Implemented Interfaces:
MDTSim, java.rmi.Remote, java.io.Serializable

public class MDT
extends java.rmi.server.UnicastRemoteObject
implements MDTSim

This Object belongs to a SimAmbulance. It creates a rmi service and connect to a rmi service called mdt_service

Author:
cbentley, pfernand
See Also:
Serialized Form

Field Summary
static java.lang.String MDT_PORT
           
static java.lang.String MDT_REMOTE_PORT
           
static int PERIOD
           
static java.lang.String PORT
          Port used by the MDT server
static java.lang.String SERVER
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
MDT(EmergencyVehicule ev)
          Creates a new instance of MDT
MDT(SimAmbulance sa, EmergencyVehicule ev)
          Creates a new instance of MDT
 
Method Summary
 void beep()
          Alert the Team that a new Mission has arrived
static MDTSim createMDT(SimAmbulance sa, EmergencyVehicule ev)
           
 java.lang.String getDisplayableString()
          Returns what a MDT User should see on the screen
 Status getMDTStatus()
          Returns the status of the simulated MDT
 void receiveIncident(Incident incident)
          Recieve an Incident.
static void registerToRegistry(java.lang.String name, java.rmi.Remote obj, boolean create)
          Register mdt_serverI object with the RMI registry.
 void setMDTStatus(Status newStatus)
          Set the status for the simulated MDT
 
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
 

Field Detail

SERVER

public static java.lang.String SERVER

MDT_PORT

public static java.lang.String MDT_PORT

MDT_REMOTE_PORT

public static java.lang.String MDT_REMOTE_PORT

PORT

public static java.lang.String PORT
Port used by the MDT server


PERIOD

public static int PERIOD
Constructor Detail

MDT

public MDT(EmergencyVehicule ev)
    throws java.rmi.RemoteException
Creates a new instance of MDT


MDT

public MDT(SimAmbulance sa,
           EmergencyVehicule ev)
    throws java.rmi.RemoteException
Creates a new instance of MDT

Method Detail

registerToRegistry

public static void registerToRegistry(java.lang.String name,
                                      java.rmi.Remote obj,
                                      boolean create)
                               throws java.rmi.RemoteException,
                                      java.net.MalformedURLException
Register mdt_serverI object with the RMI registry.

Parameters:
name - - name identifying the service in the RMI registry
create - - create local registry if necessary
Throws:
java.rmi.RemoteException - if cannot be exported or bound to RMI registry
java.net.MalformedURLException - if name cannot be used to construct a valid URL
java.lang.IllegalArgumentException - if null passed as name

getMDTStatus

public Status getMDTStatus()
Returns the status of the simulated MDT

Specified by:
getMDTStatus in interface MDTSim
Pre:
mdt init
Returns:
a Status object
Post:
The internal status of the MDT is returned

receiveIncident

public void receiveIncident(Incident incident)
Recieve an Incident. Do whatever has to be done with it (display ...)

Specified by:
receiveIncident in interface MDTSim
Pre:
Incident object
Post:
The incident information is displayed on the MDT screen

setMDTStatus

public void setMDTStatus(Status newStatus)
Set the status for the simulated MDT

Specified by:
setMDTStatus in interface MDTSim
Pre:
Status object correspond to this MDT
Returns:
a Status object
Post:
The internal status of the MDT has been set

getDisplayableString

public java.lang.String getDisplayableString()
Description copied from interface: MDTSim
Returns what a MDT User should see on the screen

Specified by:
getDisplayableString in interface MDTSim
Returns:
The String to be displayed

beep

public void beep()
Alert the Team that a new Mission has arrived


createMDT

public static MDTSim createMDT(SimAmbulance sa,
                               EmergencyVehicule ev)
                        throws java.rmi.RemoteException
java.rmi.RemoteException

Logo

With the help of www.sourceforge.net and www.info.ucl.ac.be