|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mx4j.remote.AbstractHeartBeat
Base implementation for the HeartBeat interface.
Constructor Summary | |
protected |
AbstractHeartBeat(ConnectionNotificationEmitter emitter,
java.util.Map environment)
Creates a new HeartBeat. |
Method Summary | |
int |
getMaxRetries()
Returns the maximum number of retries this heart beat attempts after a first connection failure before declaring the connection or the server as dead. |
long |
getPulsePeriod()
Returns the period of time in milliseconds between two heart beats |
protected abstract void |
pulse()
Subclasses will implement this method using protocol specific connections. |
void |
run()
|
protected void |
sendConnectionNotificationFailed()
Sends the connection failed notification using the emitter specified in AbstractHeartBeat(mx4j.remote.ConnectionNotificationEmitter, java.util.Map) |
void |
start()
Starts the heart beat |
void |
stop()
Stops the heart beat |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected AbstractHeartBeat(ConnectionNotificationEmitter emitter, java.util.Map environment)
emitter
- The NotificationEmitter that sends connection failures notifications.environment
- The environment that may contain properties that specify heart beat's behaviorsendConnectionNotificationFailed()
,
MX4JRemoteConstants.CONNECTION_HEARTBEAT_PERIOD
,
MX4JRemoteConstants.CONNECTION_HEARTBEAT_RETRIES
Method Detail |
public long getPulsePeriod()
HeartBeat
getPulsePeriod
in interface HeartBeat
MX4JRemoteConstants.CONNECTION_HEARTBEAT_PERIOD
,
HeartBeat.getMaxRetries()
public int getMaxRetries()
HeartBeat
getMaxRetries
in interface HeartBeat
MX4JRemoteConstants.CONNECTION_HEARTBEAT_RETRIES
,
HeartBeat.getPulsePeriod()
protected abstract void pulse() throws java.io.IOException
MBeanServerConnection.getDefaultDomain()
is used
to "ping" the server side.
java.io.IOException
public void start() throws java.io.IOException
HeartBeat
start
in interface HeartBeat
java.io.IOException
- If there are problems contacting the serverHeartBeat.stop()
public void stop() throws java.io.IOException
HeartBeat
stop
in interface HeartBeat
java.io.IOException
- If there are problems contacting the serverHeartBeat.start()
public void run()
run
in interface java.lang.Runnable
protected void sendConnectionNotificationFailed()
AbstractHeartBeat(mx4j.remote.ConnectionNotificationEmitter, java.util.Map)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |