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 deactivated is save memory.

Author:
  Joe Walker
See Also:
  `The GNU Lesser General Public License for details.`

Field Summary
`private static Set<Activatable>` | `activated` The list of things that we have activated
`private static Lock` | `lock` The object we use to prevent others from

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

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` | `deactivateAll()`
`static void` | `reduceMemoryUsage(Kill 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

### activated

    private static Set<Activatable> 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 instantiation

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(Kill amount)

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

  Parameters:
    `amount` - the amount by which to to reduce memory

### 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 deactivate

### deactivateAll

    public static void deactivateAll()

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