Class AppProducerAdapter
- java.lang.Object
-
- com.automation_pros.odva.cip.types.AppProducerAdapter
-
- All Implemented Interfaces:
AppLinkBase
,AppProducer
public class AppProducerAdapter extends java.lang.Object implements AppProducer
Provides a generic intermediary between an AppProducer and its application (connectable). Intended to be overridden by anonymous classes where a specific application connection producer's behaviour needs to be adjusted. Otherwise passes the method calls through to the real producer.
-
-
Field Summary
Fields Modifier and Type Field Description protected AppProducer
producer
-
Constructor Summary
Constructors Constructor Description AppProducerAdapter(AppProducer producer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appProduce(long txID, java.nio.ByteBuffer payload)
App Producer objects handle data flow from generic Connectable application objects to their subscribers.void
disconnect()
When a connection is closed or an application forces a disconnect, this shutdown method is called to clean up.int
getProduceRTF()
An Application Producer must supply an indicator of the desired real-time mode handling format.int
getRealTimeMode()
When an application needs to encode a packet, and the producer expects a real-time mode indicator, the application obtains the 32-bit mode indicator from the producer with this method.boolean
isDisconnected()
-
-
-
Field Detail
-
producer
protected final AppProducer producer
-
-
Constructor Detail
-
AppProducerAdapter
public AppProducerAdapter(AppProducer producer)
-
-
Method Detail
-
disconnect
public void disconnect()
Description copied from interface:AppLinkBase
When a connection is closed or an application forces a disconnect, this shutdown method is called to clean up. It should close the connection when called by the application.- Specified by:
disconnect
in interfaceAppLinkBase
-
isDisconnected
public boolean isDisconnected()
- Specified by:
isDisconnected
in interfaceAppLinkBase
-
appProduce
public void appProduce(long txID, java.nio.ByteBuffer payload)
Description copied from interface:AppProducer
App Producer objects handle data flow from generic Connectable application objects to their subscribers. When carrying messaging traffic, the txID uniquely identifies the request/reply pair; typically the encapsulation sender context.- Specified by:
appProduce
in interfaceAppProducer
- Parameters:
txID
- Transport layer transaction ID uniquely identifying this message or reply, if applicable. Zero for I/O connections.payload
- Complete CIP data payload, including CIP sequence number, if any.
-
getProduceRTF
public int getProduceRTF()
Description copied from interface:AppProducer
An Application Producer must supply an indicator of the desired real-time mode handling format. The following values are allowed: -1: Application default 0: Modeless 1: Zero length packet==idle 3: Heartbeat 4: 32-bit run/idle header is present 5: Safety- Specified by:
getProduceRTF
in interfaceAppProducer
- Returns:
- Produced payload real-time mode format
-
getRealTimeMode
public int getRealTimeMode()
Description copied from interface:AppProducer
When an application needs to encode a packet, and the producer expects a real-time mode indicator, the application obtains the 32-bit mode indicator from the producer with this method.- Specified by:
getRealTimeMode
in interfaceAppProducer
- Returns:
- 32-bit run/idle header to encode or imply
-
-