org.cougaar.core.service
Interface SuicideService
- All Superinterfaces:
- org.cougaar.core.component.Service
public interface SuicideService
- extends org.cougaar.core.component.Service
This service is used to tell the agent (or node) to exit, for
example due to an OutOfMemoryError.
The intent is to allow major components to report that they
have recognised that they have been corrupted by various means and
so should be restarted.
- System Properties:
| org.cougaar.core.service.SuicideService.enable | If true, will enable
suicide of Nodes and Agents. Otherwise, the suicide API exists but only logs
attempts rather than actually kills anything. The default is false. |
| org.cougaar.core.service.SuicideService.proactive | If true, the SuicideService
will attempt to kill things proactively when it notices low-memory situations. Defaults
to true, but only takes effect if the SuicideService is enabled. |
| org.cougaar.core.service.SuicideService.proactivePeriod | Defines the period
of proactive suicide checks, in seconds. By default, this is 1. |
| org.cougaar.core.service.SuicideService.lowMem | Specify a quantity of
memory to use as the definition of "dangerously low" for proactive kill situations.
This is interpreted as a factor of Runtime.maxMemory(). The default value is "0.02" meaning
2 percent. If this value is greater than or equal to 1.0, then it is interpreted
as a number of kilobytes. Examples: if maxMemory is 100Mb, then "0.005" and "512" are both
interpreted as one half a megabyte. |
|
Method Summary |
void |
die(java.lang.Object component,
java.lang.Throwable error)
Report a fatal error and die. |
EXIT_CODE
static final int EXIT_CODE
- If the VM exits as a result of a suicide call, it will do so
using this value.
- See Also:
- Constant Field Values
SUICIDE_PROP
static final java.lang.String SUICIDE_PROP
isSuicideEnabled_default
static final boolean isSuicideEnabled_default
- See Also:
- Constant Field Values
isSuicideEnabled
static final boolean isSuicideEnabled
PROACTIVE_PROP
static final java.lang.String PROACTIVE_PROP
isProactiveEnabled_default
static final boolean isProactiveEnabled_default
- See Also:
- Constant Field Values
isProactiveEnabled
static final boolean isProactiveEnabled
PROPERIOD_PROP
static final java.lang.String PROPERIOD_PROP
proactivePeriod_default
static final double proactivePeriod_default
- See Also:
- Constant Field Values
proactivePeriod
static final double proactivePeriod
LOWMEM_PROP
static final java.lang.String LOWMEM_PROP
lowMem_default
static final double lowMem_default
- See Also:
- Constant Field Values
lowMem
static final double lowMem
die
void die(java.lang.Object component,
java.lang.Throwable error)
- Report a fatal error and die. This call might not return.
- Parameters:
component - Which component should be killed. May be specified as
null, implying that the whole node is suspect, or a specific component
descriptor (e.g. an agent name). It is probably illegal to specify a component
other than yourself or null.error - The error indicating the problem. An attempt will be made
to log the error during the component's death throws. May not be specified
as null.