Package org.eclipse.equinox.events

# Class MemoryEventConstants

java.lang.Object
org.eclipse.equinox.events.MemoryEventConstants

public final class MemoryEventConstants extends Object
Defines constants for memory event handlers. A memory event handler implements the `org.osgi.service.event.EventHandler` interface as specified by the OSGi Event Admin Service Specification.

For example, the following handler is registered to handle critical memory events:

     BundleContext context = getContext();
     EventHandler handler = getHandler();
     Hashtable ht = new Hashtable();
     ht.put(EventConstants.EVENT_TOPIC, MemoryEventConstants.TOPIC_CRITICAL);
     context.registerService(EventHandler.class.getName(), handler, ht);

There is no policy implemented for sending memory events in Equinox or Eclipse by default. Another bundle must implement the policy that determines when to send memory events. This policy must use the Event Admin Service to fire memory events to the registered handlers.

Since:
  3.6

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`TOPIC_ALL`
A memory event topic for all memory events.
`static final String`
`TOPIC_BASE`
The base topic that all memory events use.
`static final String`
`TOPIC_CRITICAL`
A memory event topic for critical memory events.
`static final String`
`TOPIC_NORMAL`
A memory event topic for normal memory events.
`static final String`
`TOPIC_SERIOUS`
A memory event topic for serious memory events.

## Method Summary

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### TOPIC_BASE

public static final String TOPIC_BASE
The base topic that all memory events use.

See Also:
  - Constant Field Values

### TOPIC_NORMAL

public static final String TOPIC_NORMAL
A memory event topic for normal memory events. Indicates memory is running low at the lowest severity. Listeners are requested to release caches that can easily be recomputed. The Java VM is not seriously in trouble, but process size is getting higher than is deemed acceptable.

See Also:
  - Constant Field Values

### TOPIC_SERIOUS

public static final String TOPIC_SERIOUS
A memory event topic for serious memory events. Indicates memory is running low at medium severity. Listeners are requested to release complex intermediate models (.e.g. intermediate build results). Memory is getting low and may cause operating system level stress, such as swapping.

See Also:
  - Constant Field Values

### TOPIC_CRITICAL

public static final String TOPIC_CRITICAL
A memory event topic for critical memory events. Indicates memory is running low at highest severity. Listeners are requested to do what ever is possible to free memory. Things like free in memory caches, close editors and perspectives, close database connections, etc. Restoring these resources and caches constitutes lots of work, but memory is so low that drastic measures are required.

See Also:
  - Constant Field Values

### TOPIC_ALL

public static final String TOPIC_ALL
A memory event topic for all memory events.

See Also:
  - Constant Field Values