Interface ActiveObject

  • All Known Implementing Classes:
    AbstractTcpPacketHandler, LocalQueue, TcpPacketReceiver, TcpPacketSender

    public interface ActiveObject

    An active object is supposed to have regular activity.

    If the object last activity gets too old (older than the configured timeout delay), the activity watchdog will kick in and call the onActivityTimeout() method of the object.

    • Method Detail

      • getLastActivity

        long getLastActivity()
        Get a timestamp of this object's last activity
        Returns:
        a java timestamp
      • getTimeoutDelay

        long getTimeoutDelay()
        Get the maximum allowed time between activities
        Returns:
        a delay in milliseconds
      • onActivityTimeout

        boolean onActivityTimeout()
                           throws Exception
        Called if the object has been inactive for more
        Returns:
        true if the object should be unregistered immediately upon return
        Throws:
        Exception