Class MsgOriginator
- java.lang.Object
-
- com.automation_pros.odva.cip.core.MsgOriginator
-
- All Implemented Interfaces:
AppConsumer,AppLinkBase,CipMsgProcessor,LinkProducer
public class MsgOriginator extends java.lang.Object implements CipMsgProcessor, LinkProducer, AppConsumer
-
-
Field Summary
Fields Modifier and Type Field Description protected ConxInstanceconxprotected Deadlineconxdlprotected java.util.Map<java.lang.Short,CipRequest>pendingprotected java.nio.ByteBufferresendContentprotected longresendIntervalprotected longresendTargetprotected java.util.concurrent.atomic.AtomicIntegerseqstatic org.slf4j.LoggersLogger
-
Constructor Summary
Constructors Constructor Description MsgOriginator(FwdOpenRsp reply)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappConsume(long txID, java.nio.ByteBuffer payload)Application Consumer objects handle data flow from connections to application objects.voiddisconnect()When a connection is closed or an application forces a disconnect, this shutdown method is called to clean up.intgetMaxMsg()Return this message processor's max allowed message size in bytes.booleanisDisconnected()voidlinkProduce(long txID, java.nio.ByteBuffer payload)Link Producer objects handle data flow from generic connections to abstract transport links.protected longprune(long now)protected voidresend(long now)voidsend(CipRequest req)Core method to send or execute a request.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.automation_pros.odva.cip.types.CipMsgProcessor
send
-
-
-
-
Field Detail
-
sLogger
public static final org.slf4j.Logger sLogger
-
conx
protected final ConxInstance conx
-
conxdl
protected final Deadline conxdl
-
seq
protected final java.util.concurrent.atomic.AtomicInteger seq
-
pending
protected final java.util.Map<java.lang.Short,CipRequest> pending
-
resendInterval
protected final long resendInterval
-
resendTarget
protected volatile long resendTarget
-
resendContent
protected volatile java.nio.ByteBuffer resendContent
-
-
Constructor Detail
-
MsgOriginator
public MsgOriginator(FwdOpenRsp reply)
-
-
Method Detail
-
prune
protected long prune(long now)
-
send
public void send(CipRequest req)
Description copied from interface:CipMsgProcessorCore method to send or execute a request.- Specified by:
sendin interfaceCipMsgProcessor
-
resend
protected void resend(long now)
-
getMaxMsg
public int getMaxMsg()
Description copied from interface:CipMsgProcessorReturn this message processor's max allowed message size in bytes. Applies to both request and reply.- Specified by:
getMaxMsgin interfaceCipMsgProcessor- Returns:
-
appConsume
public void appConsume(long txID, java.nio.ByteBuffer payload)Description copied from interface:AppConsumerApplication Consumer objects handle data flow from connections to application objects. Connectable objects will provide instances with the appropriate buffer handling and ownership tracking, including removal/use of CIP short sequence numbers and originator idle/run mode indicators. Bridge connections cross connect their application consumers, passing the complete payload to the peer's appProduce() method.- Specified by:
appConsumein interfaceAppConsumer- Parameters:
txID- Transport layer transaction ID to use with any reply.payload- Complete CIP data payload, including CIP sequence number, if any.
-
linkProduce
public void linkProduce(long txID, java.nio.ByteBuffer payload)Description copied from interface:LinkProducerLink Producer objects handle data flow from generic connections to abstract transport links. When carrying messaging traffic, the txID uniquely identifies the request/reply pair; typically the encapsulation sender context.- Specified by:
linkProducein interfaceLinkProducer- 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.
-
disconnect
public void disconnect()
Description copied from interface:AppLinkBaseWhen 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:
disconnectin interfaceAppLinkBase
-
isDisconnected
public boolean isDisconnected()
- Specified by:
isDisconnectedin interfaceAppLinkBase
-
-