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.collection.Entity.Store.Provider,org.eclipse.net4j.util.concurrent.IExecutorServiceProvider,org.eclipse.net4j.util.container.IManagedContainerProvider,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
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe server-side implementation of aheart beat protocol.Nested classes/interfaces inherited from class org.eclipse.net4j.signal.SignalProtocol
SignalProtocol.InvalidSignalIDException, SignalProtocol.TimeoutChangedEventNested classes/interfaces inherited from class org.eclipse.spi.net4j.Protocol
Protocol.InfraStructureChangedEventNested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivationNested classes/interfaces inherited from interface org.eclipse.net4j.ILocationAware
ILocationAware.LocationNested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
org.eclipse.net4j.util.event.INotifier.INotifier2Nested classes/interfaces inherited from interface org.eclipse.net4j.signal.ISignalProtocol
ISignalProtocol.WithSignalCounters<INFRA_STRUCTURE> -
Field Summary
FieldsFields inherited from class org.eclipse.net4j.signal.SignalProtocol
COMPRESSED_STRINGS_ACKNOWLEDGE_TIMEOUT, SIGNAL_ACKNOWLEDGE_COMPRESSED_STRINGS, SIGNAL_ENTITY, SIGNAL_MONITOR_CANCELED, SIGNAL_MONITOR_PROGRESS, SIGNAL_REMOTE_EXCEPTION, SIGNAL_SET_TIMEOUTFields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
USE_LABELFields inherited from interface org.eclipse.net4j.protocol.IProtocol2
UNSPECIFIED_VERSIONFields inherited from interface org.eclipse.net4j.signal.ISignalProtocol
DEFAULT_TIMEOUT, NO_TIMEOUT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHeartBeatProtocol(String type, IConnector connector, Timer timer) HeartBeatProtocol(IConnector connector) HeartBeatProtocol(IConnector connector, Timer timer) HeartBeatProtocol(IConnector connector, org.eclipse.net4j.util.container.IManagedContainer container) -
Method Summary
Modifier and TypeMethodDescriptionprotected SignalReactorcreateSignalReactor(short signalID) Returns a new signal instance to serve the given signal ID ornullif the signal ID is invalid/unknown for this protocol.protected voidstatic TimergetDefaultTimer(org.eclipse.net4j.util.container.IManagedContainer container) getTimer()protected voidhandleTimeout(long untouched) protected voidrequestingStart(org.eclipse.net4j.util.io.ExtendedDataOutputStream out, long rate) voidstart(long rate) Same asstart(rate, 2 * rate).voidstart(long rate, long timeout) Methods inherited from class org.eclipse.net4j.signal.SignalProtocol
addStreamWrapper, close, doBeforeDeactivate, getEntityStore, getReceivedSignals, getSentSignals, getStreamWrapper, getStringCompressor, getTimeout, handleBuffer, handleChannelDeactivation, isSendingTimeoutChanges, open, provideSignalReactor, setStreamWrapper, setTimeout, setTimeout, toString, waitForSignalsMethods inherited from class org.eclipse.spi.net4j.Protocol
doBeforeActivate, getBufferProvider, getChannel, getContainer, getExecutorService, getInfraStructure, getLocation, getType, getUserID, getVersion, isClient, isServer, setChannel, setExecutorService, setInfraStructure, setUserIDMethods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, dump, getLifecycleState, isActive, isDeferredActivationMethods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.net4j.ILocationAware
getLocation, isClient, isServerMethods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListenerMethods inherited from interface org.eclipse.net4j.protocol.IProtocol
getBufferProvider, getChannel, getExecutorService, getInfraStructure, getType, setChannel, setExecutorService, setInfraStructureMethods inherited from interface org.eclipse.net4j.protocol.IProtocol3
doWhenFullyConnectedMethods inherited from interface org.eclipse.net4j.util.security.IUserAware
getUserID
-
Field Details
-
TYPE
- See Also:
-
-
Constructor Details
-
HeartBeatProtocol
- Since:
- 4.0
-
HeartBeatProtocol
-
HeartBeatProtocol
public HeartBeatProtocol(IConnector connector, org.eclipse.net4j.util.container.IManagedContainer container) - Since:
- 4.0
-
HeartBeatProtocol
-
-
Method Details
-
getTimer
-
start
public void start(long rate) Same asstart(rate, 2 * rate).- See Also:
-
start
public void start(long rate, long timeout) -
createSignalReactor
Description copied from class:SignalProtocolReturns a new signal instance to serve the given signal ID ornullif the signal ID is invalid/unknown for this protocol.- Overrides:
createSignalReactorin classSignalProtocol<Object>
-
handleTimeout
protected void handleTimeout(long untouched) -
doDeactivate
- Overrides:
doDeactivatein classSignalProtocol<Object>- Throws:
Exception
-
requestingStart
protected void requestingStart(org.eclipse.net4j.util.io.ExtendedDataOutputStream out, long rate) throws IOException - Throws:
IOException- Since:
- 4.0
-
getDefaultTimer
-