public class PubSubIMBMessageHandler extends Object implements org.opentrafficsim.imb.transceiver.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,
nl.tudelft.simulation.event.EventType eventType,
IMBToOTSTransformer imbToOTSTransformer,
org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator)
Construct a new PubSubIMBMessageHandler.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getIMBEventName() |
void |
handle(nl.tno.imb.TByteBuffer imbPayload)
Handle the event by notifying the EventListener that was identified by the imbPayload through the imbToOTSTransformer.
|
public PubSubIMBMessageHandler(String imbEventName, nl.tudelft.simulation.event.EventType eventType, IMBToOTSTransformer imbToOTSTransformer, org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator) throws org.opentrafficsim.imb.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 onorg.opentrafficsim.imb.IMBException - in case the construction failspublic void handle(nl.tno.imb.TByteBuffer imbPayload)
throws org.opentrafficsim.imb.IMBException
handle in interface org.opentrafficsim.imb.transceiver.IMBMessageHandlerimbPayload - TByteBuffer; the IMB payloadorg.opentrafficsim.imb.IMBException - in case the message cannot be handledpublic final String getIMBEventName()
getIMBEventName in interface org.opentrafficsim.imb.transceiver.IMBMessageHandlerCopyright © 2014–2016 Delft University of Technology. All rights reserved.