Class HeartBeatProtocol

java.lang.Object
org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.lifecycle.Lifecycle
org.eclipse.spi.net4j.Protocol<INFRA_STRUCTURE>
org.eclipse.net4j.signal.SignalProtocol<Object>
org.eclipse.net4j.signal.heartbeat.HeartBeatProtocol
All Implemented Interfaces:
IBufferHandler, ILocationAware, IProtocol<Object>, IProtocol2<Object>, IProtocol3<Object>, ISignalProtocol<Object>, ISignalProtocol.WithSignalCounters<Object>, org.eclipse.net4j.util.concurrent.IExecutorServiceProvider, org.eclipse.net4j.util.event.INotifier, org.eclipse.net4j.util.event.INotifier.INotifier2, org.eclipse.net4j.util.lifecycle.IDeactivateable, org.eclipse.net4j.util.lifecycle.ILifecycle, org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation, org.eclipse.net4j.util.security.IUserAware

public class HeartBeatProtocol extends SignalProtocol<Object>
A signal protocol that keeps the connector of its channel open or provides early deactivation feedback by exchanging periodic heart beats.
Since:
2.0
Author:
Eike Stepper
  • Field Details

  • Constructor Details

    • HeartBeatProtocol

      protected HeartBeatProtocol(String type, IConnector connector, Timer timer)
      Since:
      4.0
    • HeartBeatProtocol

      public HeartBeatProtocol(IConnector connector, Timer timer)
    • HeartBeatProtocol

      public HeartBeatProtocol(IConnector connector, org.eclipse.net4j.util.container.IManagedContainer container)
      Since:
      4.0
    • HeartBeatProtocol

      public HeartBeatProtocol(IConnector connector)
  • Method Details

    • getTimer

      public Timer getTimer()
    • start

      public void start(long rate)
      Same as start(rate, 2 * rate).
      See Also:
    • start

      public void start(long rate, long timeout)
    • createSignalReactor

      protected SignalReactor createSignalReactor(short signalID)
      Description copied from class: SignalProtocol
      Returns a new signal instance to serve the given signal ID or null if the signal ID is invalid/unknown for this protocol.
      Overrides:
      createSignalReactor in class SignalProtocol<Object>
    • handleTimeout

      protected void handleTimeout(long untouched)
    • doDeactivate

      protected void doDeactivate() throws Exception
      Overrides:
      doDeactivate in class SignalProtocol<Object>
      Throws:
      Exception
    • requestingStart

      protected void requestingStart(org.eclipse.net4j.util.io.ExtendedDataOutputStream out, long rate) throws IOException
      Throws:
      IOException
      Since:
      4.0
    • getDefaultTimer

      public static Timer getDefaultTimer(org.eclipse.net4j.util.container.IManagedContainer container)