Class ConnectableAttr

    • Field Detail

      • cipseq

        protected java.util.concurrent.atomic.AtomicInteger cipseq
    • 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 provided AppOwner 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 interface Connectable
        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 interface Connectable
        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 interface Connectable
      • getOwner

        public AppOwner getOwner()
        Description copied from interface: Connectable
        Obtain the current owner's shim if owned, or null.
        Specified by:
        getOwner in interface Connectable
        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 interface Connectable
        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 interface Connectable
      • 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 interface Connectable
      • 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 interface Connectable
      • 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 interface Connectable
      • disconnectSubscribers

        public void disconnectSubscribers()
        Description copied from interface: Connectable
        This method disconnects all subscribers, a requirement during shutdown.
        Specified by:
        disconnectSubscribers in interface Connectable