Overview | Package | Class | Tree | Index | Help

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

## com.tangosol.net
Interface Guardable

All Known Implementing Classes:
  AsyncBinaryStore.QueueDaemon, Daemon, LoadBalancer.RequestHandler, LoadBalancer.ResponseHandler, LoadBalancer.SocketHandler, MulticastTest.Listener, ReadWriteBackingMap.ReadThread, ReadWriteBackingMap.WriteThread, RefreshableAddressProvider.RefreshThread, SessionHelper.SessionReaperDaemon, TaskDaemon

    public interface Guardable

A Guardable is a logical execution unit whose lifetime may be guarded by a Guardian. A Guardable may be a simple thread, or a more complex service.

Guardable objects are responsible for periodically proving that they are alive. Failure to do so will cause the Guardian to take corrective actions:

1. The Guardian may attempt to revive the Guardable by calling `recover`.
2. Upon failure to recover, the Guardian will abandon the Guardable by unregistering it and calling `terminate`.

Note: To prevent cascading failure (e.g. deadlock) all corrective actions are performed by the Guardian on temporary threads.

Guardable objects should be registered with an sufficiently sized SLA to accommodate variances in system-load, GC latencies etc. Guardians are not responsible for detecting or correcting for these conditions.

Since:
  Coherence 3.5
Author:
  rhl

Method Summary
`void` | `recover()` Attempt to recover this Guardable.
`void` | `setContext(Guardian.GuardContext context)` Set the guard context.
`void` | `terminate()` Terminate this Guardable.

Method Detail

### setContext

    void setContext(Guardian.GuardContext context)

  Set the guard context. Passing in `null` indicates that the Guardable is no longer being monitored by a Guardian.

  Parameters:
    `context` - the context guarding this Guardable

### recover

    void recover()

  Attempt to recover this Guardable.

  In a common case where the Guardable has an associated thread, a suitable action would be to interrupt the thread.

  If this method does not return before the timeout expires, the Guardable will be considered unrecoverable and will be terminated.

### terminate

    void terminate()

  Terminate this Guardable.

  This is the final action taken by the Guardian before the Guardable is removed from its responsibility list.

Overview | Package | Class | Tree | Index | Help

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

Copyright © 2000, 2010, Oracle. All rights reserved.