fr.lifl.magique.platform.rmi
Class PlatformServer
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
fr.lifl.magique.platform.rmi.PlatformServer
- All Implemented Interfaces:
- Communicate, Connect, java.rmi.Remote, java.io.Serializable
- public class PlatformServer
- extends java.rmi.server.UnicastRemoteObject
- implements Communicate, Connect
The rmi server for the platform. It accepts 2 remote methods :
connection and message "sending" between platforms.
- See Also:
- Serialized Form
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Method Summary |
void |
connect(java.lang.String platformName)
method remotely invoked by other platform to connect to my platform |
void |
disconnect(java.lang.String platformName)
performs (rmi) disconnection fom platformName. |
void |
haveAMessage(byte[] bytesMsg)
method remotely invoked by other platform to send a message to my platform |
java.lang.Boolean |
ping(java.lang.String platformName)
test if the platform hostname is alive |
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 |
PlatformServer
public PlatformServer(Platform platform)
throws java.rmi.RemoteException
- Parameters:
platform
- the platform i am the server of
haveAMessage
public void haveAMessage(byte[] bytesMsg)
throws java.lang.ClassNotFoundException
- method remotely invoked by other platform to send a message to my platform
- Specified by:
haveAMessage
in interface Communicate
- Returns:
- Boolean.TRUE iff alive
- Throws:
java.lang.ClassNotFoundException
- See Also:
Communicate
ping
public java.lang.Boolean ping(java.lang.String platformName)
- test if the platform hostname is alive
- Specified by:
ping
in interface Connect
- Parameters:
platformName
- the platform to test- See Also:
Connect
connect
public void connect(java.lang.String platformName)
- method remotely invoked by other platform to connect to my platform
- Specified by:
connect
in interface Connect
- Parameters:
platformName
- the name of the platform who wants to be connected to my platform- See Also:
Connect
disconnect
public void disconnect(java.lang.String platformName)
- performs (rmi) disconnection fom platformName.
- Specified by:
disconnect
in interface Connect