Package org.djutils.rmi
Class RMITest.Listener
- java.lang.Object
-
- java.rmi.server.RemoteObject
-
- java.rmi.server.RemoteServer
-
- java.rmi.server.UnicastRemoteObject
-
- org.djutils.rmi.RMIObject
-
- org.djutils.rmi.RMITest.Listener
-
- All Implemented Interfaces:
Serializable
,Remote
,RMITest.ListenerInterface
- Enclosing class:
- RMITest
public class RMITest.Listener extends RMIObject implements RMITest.ListenerInterface
Listener object.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.rmi.server.RemoteObject
ref
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getLastMessage()
String
getListenerName()
String
getName()
Return the name under which the listenerInterface is registered.void
notify(String payload)
Notify the listener of a message.void
setLastMessage(String lastMessage)
-
Methods inherited from class org.djutils.rmi.RMIObject
getRegistry, register
-
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
-
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
-
-
-
-
Constructor Detail
-
Listener
public Listener(String listenerName) throws RemoteException, AlreadyBoundException, NotBoundException
Explicit definition of constructor has to be included to be able to throws RemoteException.- Parameters:
listenerName
- the name of the listener in the registry- Throws:
RemoteException
- on network errorAlreadyBoundException
- on errorNotBoundException
- when producer cannot be found
-
-
Method Detail
-
getName
public String getName() throws RemoteException
Return the name under which the listenerInterface is registered.- Specified by:
getName
in interfaceRMITest.ListenerInterface
- Returns:
- the name
- Throws:
RemoteException
- on network error
-
notify
public void notify(String payload) throws RemoteException
Notify the listener of a message.- Specified by:
notify
in interfaceRMITest.ListenerInterface
- Parameters:
payload
- the message- Throws:
RemoteException
- on network error
-
getListenerName
public String getListenerName()
- Returns:
- listenerName
-
getLastMessage
public String getLastMessage()
- Returns:
- lastMessage
-
setLastMessage
public void setLastMessage(String lastMessage)
- Parameters:
lastMessage
- set lastMessage
-
-