|
Oracle® Coherence Java API Reference v3.5.3 E15583-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.tangosol.net.GuardSupport.Context
protected class GuardSupport.Context
Default implementation of GuardContext 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? This property is only used by the guarded thread. |
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 the Context. |
| Method Summary | |
|---|---|
protected void |
doRecover()
Attempt recovery of the guardable. |
protected void |
doTerminate()
Terminate the Guardable. |
protected Guardable |
getGuardable()
Return the Guardable represented by this GuardContext. |
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? |
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. |
java.lang.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.0| Method Detail |
|---|
protected Guardable getGuardable()
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 timestamp
protected boolean isSuspect(long ldtNow)
ldtNow - the current timestamp
public java.lang.String toString()
public Guardian getGuardian()
getGuardian in interface Guardian.GuardContextpublic void heartbeat()
heartbeat in interface Guardian.GuardContextpublic void heartbeat(long cMillis)
heartbeat in interface Guardian.GuardContextcMillis - the number of milliseconds for which the guardable
should not be considered timed outpublic int getState()
getState in interface Guardian.GuardContextpublic void release()
release in interface Guardian.GuardContextpublic long getSoftTimeoutMillis()
getSoftTimeoutMillis in interface Guardian.GuardContextprotected void doRecover()
protected void doTerminate()
|
Oracle® Coherence Java API Reference v3.5.3 E15583-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||