public class HeartBeatProtocol extends SignalProtocol<Object>
signal protocol
that keeps the connector
of its channel
open
or provides early deactivation feedback by exchanging periodic heart beats.Modifier and Type | Class and Description |
---|---|
static class |
HeartBeatProtocol.Server
The server-side implementation of a
heart beat protocol . |
SignalProtocol.TimeoutChangedEvent
ILocationAware.Location
ILifecycle.DeferrableActivation
Modifier and Type | Field and Description |
---|---|
static String |
TYPE |
SIGNAL_MONITOR_CANCELED, SIGNAL_MONITOR_PROGRESS, SIGNAL_REMOTE_EXCEPTION, SIGNAL_SET_TIMEOUT
DEFAULT_TIMEOUT, NO_TIMEOUT
UNSPECIFIED_VERSION
Modifier | Constructor and Description |
---|---|
|
HeartBeatProtocol(IConnector connector) |
|
HeartBeatProtocol(IConnector connector,
IManagedContainer container) |
|
HeartBeatProtocol(IConnector connector,
Timer timer) |
protected |
HeartBeatProtocol(String type,
IConnector connector,
Timer timer) |
Modifier and Type | Method and Description |
---|---|
protected SignalReactor |
createSignalReactor(short signalID)
Returns a new signal instance to serve the given signal ID or
null if the signal ID is invalid/unknown
for this protocol. |
protected void |
doDeactivate() |
static Timer |
getDefaultTimer(IManagedContainer container) |
Timer |
getTimer() |
protected void |
handleTimeout(long untouched) |
protected void |
requestingStart(ExtendedDataOutputStream out,
long rate) |
void |
start(long rate)
Same as
start(rate, 2 * rate) . |
void |
start(long rate,
long timeout) |
addStreamWrapper, close, doBeforeDeactivate, getStreamWrapper, getTimeout, handleBuffer, handleChannelDeactivation, isSendingTimeoutChanges, open, provideSignalReactor, setStreamWrapper, setTimeout, setTimeout, toString, waitForSignals
doBeforeActivate, getBufferProvider, getChannel, getExecutorService, getInfraStructure, getLocation, getType, getUserID, getVersion, isClient, isServer, setChannel, setExecutorService, setInfraStructure, setUserID
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, dump, getLifecycleState, isActive, isDeferredActivation
addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBufferProvider, getChannel, getExecutorService, getInfraStructure, getType, setChannel, setExecutorService, setInfraStructure
getUserID
getLocation, isClient, isServer
addListener, getListeners, hasListeners, removeListener
public static final String TYPE
protected HeartBeatProtocol(String type, IConnector connector, Timer timer)
public HeartBeatProtocol(IConnector connector, Timer timer)
public HeartBeatProtocol(IConnector connector, IManagedContainer container)
public HeartBeatProtocol(IConnector connector)
public Timer getTimer()
public void start(long rate)
start(rate, 2 * rate)
.start(long, long)
public void start(long rate, long timeout)
protected SignalReactor createSignalReactor(short signalID)
SignalProtocol
null
if the signal ID is invalid/unknown
for this protocol.createSignalReactor
in class SignalProtocol<Object>
protected void handleTimeout(long untouched)
protected void doDeactivate() throws Exception
doDeactivate
in class SignalProtocol<Object>
Exception
protected void requestingStart(ExtendedDataOutputStream out, long rate) throws IOException
IOException
public static Timer getDefaultTimer(IManagedContainer container)
Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html