Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.crosswire.common.activate
Class Activator

    java.lang.Object
      org.crosswire.common.activate.Activator

    public final class Activator

extends Object

Manager for instances of Activatable. Activator should be used to manage all activate()ions and deactivate()ions so that it can keep a track of exactly what is active and what can be deactivate()d is save memory.

Author:
  Joe Walker [joe at eireneh dot com]
See Also:
  `for license details. The copyright to this program is held by it's authors.`

Field Summary
`private static Set` | `activated` The list of things that we have activated
`static int` | `KILL_EVERYTHING` Try as hard as possible to conserve memory
`static int` | `KILL_LEAST_USED` Reduce memory usage, but only where sensible
`static int` | `KILL_ONLY_IF_TIGHT` Reduce memory usage, but only if we really need to
`private static Lock` | `lock` The object we use to prevent others from

Constructor Summary
`private` | `Activator()` Prevent instansiation

Method Summary
`static void` | `activate(Activatable subject)` Check that a subject is activated and call activate() if not.
`static void` | `deactivate(Activatable subject)` Deactivate an Activatable object.
`static void` | `reduceMemoryUsage(int amount)` If we need to tighten things up a bit we can save memory with this

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### KILL_EVERYTHING

    public static final int KILL_EVERYTHING

  Try as hard as possible to conserve memory

  See Also:
    Constant Field Values

### KILL_LEAST_USED

    public static final int KILL_LEAST_USED

  Reduce memory usage, but only where sensible

  See Also:
    Constant Field Values

### KILL_ONLY_IF_TIGHT

    public static final int KILL_ONLY_IF_TIGHT

  Reduce memory usage, but only if we really need to

  See Also:
    Constant Field Values

### activated

    private static Set activated

  The list of things that we have activated

### lock

    private static Lock lock

  The object we use to prevent others from

Constructor Detail

### Activator

    private Activator()

  Prevent instansiation

Method Detail

### activate

    public static void activate(Activatable subject)

  Check that a subject is activated and call activate() if not.

  Parameters:
    `subject` - The thing to activate

### reduceMemoryUsage

    public static void reduceMemoryUsage(int amount)

  If we need to tighten things up a bit we can save memory with this

### deactivate

    public static void deactivate(Activatable subject)

  Deactivate an Activatable object. It is safe to activate() something and then forget to deactivate() it since we keep a track of activated objects and will automatically deactivate() when needed, so this method should only be used when we are sure that something will not be needed again.

  Parameters:
    `subject` - The thing to de-activate

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¨ 2003-2005
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD