Class RemoteContext.RemoteChangeEventProducer
java.lang.Object
org.djutils.event.rmi.RmiEventProducer
nl.tudelft.simulation.naming.context.RemoteContext.RemoteChangeEventProducer
- All Implemented Interfaces:
Serializable
,Remote
,org.djutils.event.EventProducer
- Enclosing class:
- RemoteContext
protected class RemoteContext.RemoteChangeEventProducer
extends org.djutils.event.rmi.RmiEventProducer
The RemoteChangeEventProducer is a RmiEventProducer that can fire an OBJECT_CHANGED_EVENT on behalf of an object that was
changed, but does not extend an EventProducer itself.
Copyright (c) 2020-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Author:
- Alexander Verbraeck
- See Also:
-
Field Summary
Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION
-
Constructor Summary
ConstructorDescriptionRemoteChangeEventProducer
(String host, int port, String bindingKey) Create a remote event listener and register the listener in the RMI registry. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
fireChangedEvent
(org.djutils.event.EventType eventType, Serializable value) Transmit an changed event with a serializable object as payload to all interested listeners.Methods inherited from class org.djutils.event.rmi.RmiEventProducer
getEventListenerMap, getRegistry
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
-
Constructor Details
-
RemoteChangeEventProducer
public RemoteChangeEventProducer(String host, int port, String bindingKey) throws RemoteException, AlreadyBoundException Create a remote event listener and register the listener in the RMI registry. When the RMI registry does not exist yet, it will be created, but only on the local host. Remote creation of a registry on another computer is not possible. Any attempt to do so will cause an AccessException to be fired.- Parameters:
host
- String; the host where the RMI registry resides or will be created. Creation is only possible on localhost.port
- int; the port where the RMI registry can be found or will be createdbindingKey
- the key under which this object will be bound in the RMI registry- Throws:
RemoteException
- when there is a problem with the RMI registryAlreadyBoundException
- when there is already another object bound to the bindingKeyNullPointerException
- when host, path, or bindingKey is nullIllegalArgumentException
- when port < 0 or port > 65535AccessException
- when there is an attempt to create a registry on a remote host
-
-
Method Details
-
fireChangedEvent
protected void fireChangedEvent(org.djutils.event.EventType eventType, Serializable value) throws RemoteException Transmit an changed event with a serializable object as payload to all interested listeners.- Parameters:
eventType
- EventType; the eventType of the eventvalue
- Serializable; the object sent with the event- Throws:
RemoteException
- on network error
-