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-2025 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
ConstructorsConstructorDescriptionProducer()Register the producer on the localhost RMI registry at the default port. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(ListenerInterface listener) Add a listener to the producer.protected voidcommands()create a small interactive application.protected voidFire a message.static voidSystem.exit(...) calls help to shut down RMI / socket thread that might wait for a timeout.Methods inherited from class org.djutils.rmi.RmiObject
getRegistry, registerMethods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObjectMethods 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:ProducerInterfaceAdd a listener to the producer.- Specified by:
addListenerin 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
-