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 org.djutils.rmi.RMIObject implements RMITest.ListenerInterface
Listener object.
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
-
Method Summary
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 java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
-
Constructor Details
-
Listener
public Listener(String listenerName) throws RemoteException, AlreadyBoundException, NotBoundExceptionExplicit 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 Details
-
getName
Return the name under which the listenerInterface is registered.- Specified by:
getName
in interfaceRMITest.ListenerInterface
- Returns:
- the name
- Throws:
RemoteException
- on network error
-
notify
Notify the listener of a message.- Specified by:
notify
in interfaceRMITest.ListenerInterface
- Parameters:
payload
- the message- Throws:
RemoteException
- on network error
-
getListenerName
- Returns:
- listenerName
-
getLastMessage
- Returns:
- lastMessage
-
setLastMessage
- Parameters:
lastMessage
- set lastMessage
-