|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.net.GuardSupport.Context
protected class GuardSupport.Context
Base implementation for GuardContext's used by GuardSupport.
Field Summary | |
---|---|
protected long |
m_cRecoveryMillis The amount of time to allow for recovery |
protected long |
m_cSoftTimeoutMillis The soft-timeout interval to use for the represented Guardable. |
protected long |
m_cTimeoutMillis The timeout interval to use for the represented Guardable. |
protected boolean |
m_fHeartbeatDefault Was the last heartbeat issued on this context for the default interval? |
protected float |
m_flPctRecover Percentage of the timeout after which to attempt recovery of the Guardable. |
protected Guardable |
m_guardable The Guardable represented by this GuardContext |
protected long |
m_ldtLastMissedSoftTimeout The soft-timeout stamp that was violated, resulting in a recovery attempt. |
protected long |
m_ldtSoftTimeout The next soft-timeout for the Guardable |
protected long |
m_ldtTimeout The next timeout for the Guardable. |
protected int |
m_nState The current state of the Context. |
Fields inherited from interface com.tangosol.net.Guardian.GuardContext |
---|
STATE_HEALTHY, STATE_RECOVERY, STATE_TERMINATING |
Constructor Summary | |
---|---|
protected |
GuardSupport.Context(Guardable guardable, long cTimeoutMillis, float flPctRecover) Construct a Context. |
Method Summary | |
---|---|
Guardable |
getGuardable() Return the Guardable for this context. |
Guardian |
getGuardian() Return the Guardian for this context. |
protected long |
getMissedSoftTimeout() Return the last missed soft-timeout for this Guardable (that resulted in a recovery attempt). |
protected long |
getRecoveryMillis() Return the recovery interval for this Guardable. |
protected long |
getSoftTimeout() Return the next soft-timeout for this Guardable. |
long |
getSoftTimeoutMillis() Return the soft timeout interval for the represented Guardable. |
int |
getState() Return the state of the Guardable. |
protected long |
getTimeout() Return the next timeout for this Guardable. |
void |
heartbeat() Called by the Guardable to signal that it is still alive. |
void |
heartbeat(long cMillis) Called by the Guardable to signal that it is still alive, and that it should not be considered timed out for the specified number of milliseconds. |
protected boolean |
isSuspect(long ldtNow) Is the Guardable represented by this GuardContext suspect (in danger of timing out soon). |
protected boolean |
isTimedOut(long ldtNow) Is the Guardable represented by this GuardContext timed out? |
protected void |
onRecovery() Called when the guardable enters the "RECOVERY" state. |
protected void |
onTerminate() Called when the guardable enters the "TERMINATING" state. |
void |
release() Release this context, causing the Guardian to discontinue monitoring of the represented Guardable. |
protected void |
setMissedSoftTimeout(long ldtSoftTimeout) Set the missed soft-timeout for this guardable. |
protected void |
setRecoveryMillis(long cRecoveryMillis) Set the recovery interval for this Guardable. |
protected void |
setSoftTimeout(long ldtSoftTimeout) Set the next soft-timeout for this Guardable. |
protected void |
setState(int nState) Set the state of the GuardContext to the specified value. |
protected void |
setTimeout(long ldtTimeout) Set the next timeout for this Guardable. |
String |
toString() Return a human-readable description. |
Field Detail |
---|
protected volatile int m_nState
protected boolean m_fHeartbeatDefault
protected long m_ldtTimeout
protected volatile long m_cRecoveryMillis
protected volatile long m_ldtSoftTimeout
protected Guardable m_guardable
protected long m_cTimeoutMillis
protected long m_cSoftTimeoutMillis
protected long m_ldtLastMissedSoftTimeout
protected float m_flPctRecover
Constructor Detail |
---|
protected GuardSupport.Context(Guardable guardable, long cTimeoutMillis, float flPctRecover)
guardable
- the guardable represented by this ContextcTimeoutMillis
- the timeout interval for the specified GuardableflPctRecover
- the percentage of the timeout after which to attempt recovery of the Guardable; 0 < flPctRecover <eq; 1.0Method Detail |
---|
protected void setState(int nState)
nState
- the state to set this GuardContext toprotected long getTimeout()
protected void setTimeout(long ldtTimeout)
ldtTimeout
- the next timestamp, after which this Guardable should be considered timed outprotected long getSoftTimeout()
protected void setSoftTimeout(long ldtSoftTimeout)
ldtSoftTimeout
- the next timestamp, after which this Guardable should be considered suspect, and recovery attemptedprotected long getRecoveryMillis()
protected void setRecoveryMillis(long cRecoveryMillis)
cRecoveryMillis
- the recovery interval for this Guardableprotected long getMissedSoftTimeout()
protected void setMissedSoftTimeout(long ldtSoftTimeout)
ldtSoftTimeout
- the soft-timeout that was missedprotected boolean isTimedOut(long ldtNow)
ldtNow
- the current timestampprotected boolean isSuspect(long ldtNow)
ldtNow
- the current timestamppublic String toString()
public Guardian getGuardian()
getGuardian
in interface Guardian.GuardContext
public Guardable getGuardable()
getGuardable
in interface Guardian.GuardContext
public void heartbeat()
heartbeat
in interface Guardian.GuardContext
public void heartbeat(long cMillis)
heartbeat
in interface Guardian.GuardContext
cMillis
- the number of milliseconds for which the guardable should not be considered timed outpublic int getState()
getState
in interface Guardian.GuardContext
public void release()
release
in interface Guardian.GuardContext
public long getSoftTimeoutMillis()
getSoftTimeoutMillis
in interface Guardian.GuardContext
protected void onRecovery()
protected void onTerminate()
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |