Package org.djutils.demo.rmi
Class Producer
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
org.djutils.rmi.RmiObject
org.djutils.demo.rmi.Producer
- All Implemented Interfaces:
Serializable
,Remote
,ProducerInterface
Producer.java.
Copyright (c) 2019-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUTILS License.
- Author:
- Alexander Verbraeck
- See Also:
-
Field Summary
Fields inherited from class java.rmi.server.RemoteObject
ref
-
Constructor Summary
ConstructorDescriptionProducer()
Register the producer on the localhost RMI registry at the default port. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(ListenerInterface listener) Add a listener to the producer.protected void
commands()
create a small interactive application.protected void
Fire a message.static void
System.exit(...) calls help to shut down RMI / socket thread that might wait for a timeout.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 Details
-
Producer
Register the producer on the localhost RMI registry at the default port.- Throws:
RemoteException
- on network errorAlreadyBoundException
- on error
-
-
Method Details
-
addListener
Description copied from interface:ProducerInterface
Add a listener to the producer.- Specified by:
addListener
in interfaceProducerInterface
- Parameters:
listener
- the listener to add- Throws:
RemoteException
- on network error
-
fire
Fire a message.- Parameters:
payload
- String the payload to send to the listener- Throws:
RemoteException
- on network error
-
commands
protected void commands()create a small interactive application. -
main
System.exit(...) calls help to shut down RMI / socket thread that might wait for a timeout.- Parameters:
args
- nothing needed
-