public class PubSubIMBMessageHandler extends Object implements IMBMessageHandler
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Constructor and Description |
|---|
PubSubIMBMessageHandler(String imbEventName,
EventType eventType,
IMBToOTSTransformer imbToOTSTransformer,
org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator)
Construct a new PubSubIMBMessageHandler.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getIMBEventName()
Return the IMB event name for which this hander is registered.
|
void |
handle(TByteBuffer imbPayload)
Handle the event by notifying the EventListener that was identified by the imbPayload through the imbToOTSTransformer.
|
public PubSubIMBMessageHandler(String imbEventName, EventType eventType, IMBToOTSTransformer imbToOTSTransformer, org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator) throws IMBException
imbEventName - String; the name of the IMB eventeventType - EventType; the event type that the listener subscribes toimbToOTSTransformer - IMBToOTSTransformer; the transformer that creates the event content and identifies the exact
listener on the basis of the IBM event payload, e.g., on the basis of an id within the payloadsimulator - OTSDEVSSimulatorInterface; The simulator to schedule the incoming notifications onIMBException - in case the construction failspublic void handle(TByteBuffer imbPayload) throws IMBException
handle in interface IMBMessageHandlerimbPayload - TByteBuffer; the IMB payloadIMBException - in case the message cannot be handledpublic final String getIMBEventName()
getIMBEventName in interface IMBMessageHandlerCopyright © 2014–2016 Delft University of Technology. All rights reserved.