Package mondrian.util

Interface LockBox.Entry

Enclosing class:
LockBox

public static interface LockBox.Entry
Entry in a LockBox.

Entries are created using LockBox.register(Object).

The object can be retrieved using getValue() if you have the entry, or LockBox.get(String) if you only have the string key.

Holding onto an Entry will prevent the entry, and the associated value from being garbage collected. Holding onto the moniker will not prevent garbage collection.

  • Method Summary

    Modifier and Type
    Method
    Description
    String key by which to identify this object.
    Returns the value in this lock box entry.
    boolean
    Returns whether the entry is still valid.
  • Method Details

    • getValue

      Object getValue()
      Returns the value in this lock box entry.
      Returns:
      Value in this lock box entry.
    • getMoniker

      String getMoniker()
      String key by which to identify this object. Not null, not easily forged, and unique within the lock box.

      Given this moniker, you retrieve the Entry using LockBox.get(String). The retrieved Entry will will have the same moniker, and will be able to access the same value.

      Returns:
      String key
    • isRegistered

      boolean isRegistered()
      Returns whether the entry is still valid. Returns false if LockBox.deregister(mondrian.util.LockBox.Entry) has been called on this Entry or any entry with the same moniker.
      Returns:
      whether entry is registered