|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.net.GuardSupport
public class GuardSupport
A concrete implementation of Guardian/Guardable interactions. GuardSupport is used by a Guardian to manage its responsibilities.
Nested Class Summary | |
---|---|
protected class |
GuardSupport.Context Base implementation for GuardContext's used by GuardSupport. |
Field Summary | |
---|---|
protected static long |
GUARDIAN_EARLY_THRESHOLD The threshold before which than which a guardian considers itself early in checking its guardiables. |
protected static long |
GUARDIAN_LATE_THRESHOLD The threshold past which a guardian considers itself late in checking its guardiables. |
protected static long |
GUARDIAN_LOG_INTERVAL The minimum interval at which the Guardian should log thread dumps. |
static long |
GUARDIAN_MAX_CHECK_INTERVAL The maximum interval at which the Guardian thread should call check() to verify its guardables. |
protected GuardSupport.Context[] |
m_aGuardContext Array of GuardContexts for the registered Guardables. |
protected int |
m_cGuardable The number of registered Guardables. |
protected Guardian |
m_guardian The Guardian that is managing this GuardSupport. |
protected long |
m_ldtNextCheck The next time at which the Guardables should be checked. |
protected static java.lang.ThreadLocal |
m_tlContext ThreadLocal containing the GuardContext associated with the current thread. |
protected static java.util.concurrent.atomic.AtomicLong |
s_atomicLogTime Atomic counter containing the last log time stamp. |
Constructor Summary | |
---|---|
GuardSupport(Guardian guardian) Construct a GuardSupport for the specified Guardian. |
Method Summary | |
---|---|
Guardian.GuardContext |
add(Guardable guardable, long cMillis, float flPctRecover) Add the specified guardable to the set of Guardables managed by this manager, subject to the specified service parameters. |
long |
check() Check the registered Guardable objects for timeout, taking appropriate action and calculate the timestamp when the next check should be performed. |
int |
getGuardableCount() Return the number of Guardables that are registered with this GuardSupport. |
protected GuardSupport.Context[] |
getGuardContexts() Return the array of GuardContext objects for the Guardables managed by this GuardSupport. |
protected Guardian |
getGuardian() Return the Guardian that manages this GuardSupport. |
long |
getNextCheckTime() Return the next time at which the Guardables should be checked. |
static Guardian.GuardContext |
getThreadContext() Obtain the GuardContext associated with the current thread. |
static void |
heartbeat() Issue a heartbeat on the GuardContext associated with the current thread. |
static void |
heartbeat(long cMillis) Issue a heartbeat of the specified duration on the GuardContext associated with the current thread. |
protected GuardSupport.Context |
instantiateContext(Guardable guardable, long cMillis, float flPctRecover) |
static void |
logStackTraces() Collect stack traces for all running threads and write them to the error log. |
void |
release() Release the Guardables managed by this GuardSupport. |
void |
remove(Guardable guardable) Remove the specified Guardable from the set of Guardables managed by this manager. |
protected void |
setGuardableCount(int cGuardable) Set the number of Guardables that are registered with this GuardSupport. |
protected void |
setGuardContexts(GuardSupport.Context[] aGuardContext) Set the array of GuardContext objects for the Guardables that are managed by this GuardSupport. |
protected void |
setNextCheckTime(long ldtNextCheck) Set the next time at which the Guardables should be checked. |
static void |
setThreadContext(Guardian.GuardContext context) Associate the specified GuardContext with the current thread. |
Field Detail |
---|
public static final long GUARDIAN_MAX_CHECK_INTERVAL
protected static final long GUARDIAN_LATE_THRESHOLD
protected static final long GUARDIAN_EARLY_THRESHOLD
protected static final long GUARDIAN_LOG_INTERVAL
protected GuardSupport.Context[] m_aGuardContext
protected int m_cGuardable
protected Guardian m_guardian
protected long m_ldtNextCheck
protected static java.lang.ThreadLocal m_tlContext
protected static java.util.concurrent.atomic.AtomicLong s_atomicLogTime
Constructor Detail |
---|
public GuardSupport(Guardian guardian)
guardian
- the guardian managing this GuardSupportMethod Detail |
---|
protected GuardSupport.Context[] getGuardContexts()
protected void setGuardContexts(GuardSupport.Context[] aGuardContext)
aGuardContext
- the array of managed GuardContext objectsprotected Guardian getGuardian()
public long getNextCheckTime()
protected void setNextCheckTime(long ldtNextCheck)
ldtNextCheck
- the next time at which the Guardables should be checkedpublic Guardian.GuardContext add(Guardable guardable, long cMillis, float flPctRecover)
guardable
- the Guardable object to be managedcMillis
- the timeout for the specified GuardableflPctRecover
- the percentage of the timeout after which to attempt recovery of the Guardable; 0 < flPctRecover <eq; 1.0public void remove(Guardable guardable)
guardable
- the guardable to removepublic int getGuardableCount()
protected void setGuardableCount(int cGuardable)
cGuardable
- the number of registered Guardable objectspublic long check()
getNextCheckTime()
method.public void release()
protected GuardSupport.Context instantiateContext(Guardable guardable, long cMillis, float flPctRecover)
guardable
- the Guardable object to be managedcMillis
- the timeout for the specified GuardableflPctRecover
- the percentage of the timeout after which to attempt recovery of the Guardable; 0 < flPctRecover <eq; 1.0public static Guardian.GuardContext getThreadContext()
public static void setThreadContext(Guardian.GuardContext context)
context
- the GuardContext to associate with the current threadpublic static void heartbeat()
public static void heartbeat(long cMillis)
cMillis
- the number of milliseconds to heartbeat forpublic static void logStackTraces()
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |