Class ConnectableAttr
- java.lang.Object
-
- com.automation_pros.odva.cip.types.CipTree
-
- com.automation_pros.odva.cip.types.CipTreeCtx
-
- com.automation_pros.odva.cip.types.CipObject
-
- com.automation_pros.odva.cip.core.CipAttribute
-
- com.automation_pros.odva.cip.types.ConnectableAttr
-
- All Implemented Interfaces:
DataContext
,Connectable
,DataWrapper
- Direct Known Subclasses:
Assembly.DynamicData
public class ConnectableAttr extends CipAttribute implements Connectable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ConnectableAttr.AttrConsumer
-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.core.CipAttribute
CipAttribute.Proxy
-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.types.CipObject
CipObject.FutureMultipleReply
-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.types.CipTree
CipTree.ChildMap
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.atomic.AtomicInteger
cipseq
protected AppOwner
owner
protected java.util.Map<AppProducer,AppProducer>
subscribers
-
Fields inherited from class com.automation_pros.odva.cip.types.CipTree
children, objEPath, parent, segment
-
Fields inherited from interface com.automation_pros.odva.cip.data.DataContext
emptyContext
-
-
Constructor Summary
Constructors Constructor Description ConnectableAttr(PathSegment seg, AttributeHolder parent, BaseDataType<?> attr, java.lang.String name)
ConnectableAttr(PathSegment seg, AttributeHolder parent, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
config(SimpleDataSeg dataseg)
Configuration assemblies or any other object that can be targeted for configuration data in a forward open service must implement this method.AppConsumer
connect(AppOwner owner, ConxClass.CxParams params, byte dirtrigcls)
This method requests that the given connection be assigned as the owner of this object and an appropriate AppConsumer shim be created to handle the incoming data.void
disconnect()
This method forces any owner's shim to shutdown (breaking a connection if applicable), and if there was an owner, shuts down subscribers too.void
disconnectSubscribers()
This method disconnects all subscribers, a requirement during shutdown.AppOwner
getOwner()
Obtain the current owner's shim if owned, or null.int
payloadBytes()
Report number of payload bytes expected, other than the mode & CIP short sequence.void
shutdown()
void
subscribe(AppProducer sub, ConxClass.CxParams params, byte dirtrigcls)
This method requests that the given connection be added to the list of subscribers to new data production from this object.void
txFresh()
This method notifies a producer that a data has been updated and a new sequence number should be generated.void
txTrigger()
This method notifies a producer that a transmission trigger has expired and new data would be appropriate if it can be assembled and delivered synchronously in this call.void
unsubscribe(AppProducer sub)
This method drops the given connection from the list of new data subscribers.-
Methods inherited from class com.automation_pros.odva.cip.core.CipAttribute
bytes, compareTo, getData, getHolder, intValue, isReadOnly, number, put, putType, service, set, setData
-
Methods inherited from class com.automation_pros.odva.cip.types.CipObject
executor, getChild, getDevice, getDisplayName, getName, getParent, isShutdown, logger, onReplacement, removeChildSymbol, scheduler, setChild, setChildSymbol, setName, setParent, toString
-
Methods inherited from class com.automation_pros.odva.cip.types.CipTreeCtx
getCtxDataImpl, getNamedDef, getParentDataCtx, getTypeByCRC, getTypeByName, getTypesImpl
-
Methods inherited from class com.automation_pros.odva.cip.types.CipTree
cleanup, entrySet, follow, getChildren, getEPath, getEPathImpl, getSegment, keySet, removeChild, setSegment
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.automation_pros.odva.cip.data.DataContext
fromEnum, getCtxData, getCtxDataOrNull, getTypes, makeHosted, makeUnhosted, toEnum
-
-
-
-
Field Detail
-
owner
protected AppOwner owner
-
subscribers
protected java.util.Map<AppProducer,AppProducer> subscribers
-
cipseq
protected java.util.concurrent.atomic.AtomicInteger cipseq
-
-
Constructor Detail
-
ConnectableAttr
public ConnectableAttr(PathSegment seg, AttributeHolder parent, java.lang.String name)
-
ConnectableAttr
public ConnectableAttr(PathSegment seg, AttributeHolder parent, BaseDataType<?> attr, java.lang.String name)
-
-
Method Detail
-
connect
public AppConsumer connect(AppOwner owner, ConxClass.CxParams params, byte dirtrigcls)
Description copied from interface:Connectable
This method requests that the given connection be assigned as the owner of this object and an appropriate AppConsumer shim be created to handle the incoming data. Application Consumer objects handle data flow from connections to application objects. The providedAppOwner
instance includes appropriate buffer handling, including removal/use of CIP short sequence numbers and originator idle/run mode indicators. This class's shutdown() method is used to disconnect.- Specified by:
connect
in interfaceConnectable
dirtrigcls
- Direction/Trigger/Class combination to use.- Returns:
-
payloadBytes
public int payloadBytes()
Description copied from interface:Connectable
Report number of payload bytes expected, other than the mode & CIP short sequence.- Specified by:
payloadBytes
in interfaceConnectable
- Returns:
-
disconnect
public void disconnect()
Description copied from interface:Connectable
This method forces any owner's shim to shutdown (breaking a connection if applicable), and if there was an owner, shuts down subscribers too.- Specified by:
disconnect
in interfaceConnectable
-
getOwner
public AppOwner getOwner()
Description copied from interface:Connectable
Obtain the current owner's shim if owned, or null.- Specified by:
getOwner
in interfaceConnectable
- Returns:
-
subscribe
public void subscribe(AppProducer sub, ConxClass.CxParams params, byte dirtrigcls)
Description copied from interface:Connectable
This method requests that the given connection be added to the list of subscribers to new data production from this object. Repeat subscriptions are ignored.- Specified by:
subscribe
in interfaceConnectable
dirtrigcls
- Direction/Trigger/Class combination to use.
-
unsubscribe
public void unsubscribe(AppProducer sub)
Description copied from interface:Connectable
This method drops the given connection from the list of new data subscribers.- Specified by:
unsubscribe
in interfaceConnectable
-
txTrigger
public void txTrigger()
Description copied from interface:Connectable
This method notifies a producer that a transmission trigger has expired and new data would be appropriate if it can be assembled and delivered synchronously in this call.- Specified by:
txTrigger
in interfaceConnectable
-
txFresh
public void txFresh()
Description copied from interface:Connectable
This method notifies a producer that a data has been updated and a new sequence number should be generated. Produces to subscribers with application or change of state trigger types.- Specified by:
txFresh
in interfaceConnectable
-
config
public void config(SimpleDataSeg dataseg)
Description copied from interface:Connectable
Configuration assemblies or any other object that can be targeted for configuration data in a forward open service must implement this method.- Specified by:
config
in interfaceConnectable
-
disconnectSubscribers
public void disconnectSubscribers()
Description copied from interface:Connectable
This method disconnects all subscribers, a requirement during shutdown.- Specified by:
disconnectSubscribers
in interfaceConnectable
-
-