Package cern.dip

Class DipSubscriptionListenerAdapter

  • All Implemented Interfaces:
    DipSubscriptionListener

    public class DipSubscriptionListenerAdapter
    extends java.lang.Object
    implements DipSubscriptionListener
    Default adapter for the DipSubscriptionListener. So you only override methods that are useful in your implementation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connected​(DipSubscription subscription)
      Will be called when the subscription has been (re)connected to the publication's publisher.
      void disconnected​(DipSubscription subscription, java.lang.String reason)
      Will be called when the subscription has been disconnected from the message provider (Due to the publisher becoming unavailable or some failure in the DIP protocol).
      void handleException​(DipSubscription subscription, java.lang.Exception ex)
      Will be called when an exception, other than the disconnection has occured.
      void handleMessage​(DipSubscription subscription, DipData message)
      Will be called on reception of updated publication information.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DipSubscriptionListenerAdapter

        public DipSubscriptionListenerAdapter()
    • Method Detail

      • handleMessage

        public void handleMessage​(DipSubscription subscription,
                                  DipData message)
        Description copied from interface: DipSubscriptionListener
        Will be called on reception of updated publication information. Implementation must be provided by the developer. It is important to check the quality of the data as this may determine how its value is treated. It is essential that the implementor determines the quality of the message received before processing the messages data.
        Specified by:
        handleMessage in interface DipSubscriptionListener
        Parameters:
        subscription - - the subscription object whose publication has been updated (Thus allowing one handler to be used for multiple subscribtions).
        message - - contains updated publication data. The value, timestamp, data quality etc. can be extracted from the message with DipData methods.
      • disconnected

        public void disconnected​(DipSubscription subscription,
                                 java.lang.String reason)
        Description copied from interface: DipSubscriptionListener
        Will be called when the subscription has been disconnected from the message provider (Due to the publisher becoming unavailable or some failure in the DIP protocol). The developer must provide the appropriate implementation.
        Specified by:
        disconnected in interface DipSubscriptionListener
        Parameters:
        subscription - - indicates which subscription is broken (DIP will automatically attempt to resubscribe).
        reason - - why the subscription broke.
      • connected

        public void connected​(DipSubscription subscription)
        Description copied from interface: DipSubscriptionListener
        Will be called when the subscription has been (re)connected to the publication's publisher. The developer must provide the appropriate implementation.
        Specified by:
        connected in interface DipSubscriptionListener
        Parameters:
        subscription - - indicates which subscription is restored/active.
      • handleException

        public void handleException​(DipSubscription subscription,
                                    java.lang.Exception ex)
        Description copied from interface: DipSubscriptionListener
        Will be called when an exception, other than the disconnection has occured. These exceptions are generally asynch and , should they occur, related to the underlying DIP implementation. The exception to this is any uncaught exceptions in the above handlers will be forwarded to this handler.
        Specified by:
        handleException in interface DipSubscriptionListener
        Parameters:
        subscription - the subscription this is causing the problem
        ex - problem description