org.apache.ode.utils

## Class InternPool

- java.lang.Object
- - org.apache.ode.utils.InternPool

-     public class InternPool
      extends java.lang.Object

  A key value based cache that internalizes immutable values so that they can be shared across various BPEL objects.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `InternPool.InternableBlock` An interface that clients should implement to run their blocks of code in the context of this caching mechanism.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `InternPool()` Creates a new KeyValueCache object.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static void` | `clearAll(java.lang.String processId)` Clears all the values corresponding to the given process
    `static java.lang.Object` | `intern(java.lang.Object key, java.lang.Object value)` Returns an internalized value if it already exists in the cache
    `static void` | `runBlock(InternPool.InternableBlock block)` Runs the given block in the context of a cache.

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

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

- - ### Constructor Detail

    - #### InternPool

          protected InternPool()

      Creates a new KeyValueCache object.

  - ### Method Detail

    - #### runBlock

          public static void runBlock(InternPool.InternableBlock block)

      Runs the given block in the context of a cache. If you do not run your block this way, the caching mechanism will be disabled.
      Parameters:
        `block` - block

    - #### intern

          public static java.lang.Object intern(java.lang.Object key,
                                                java.lang.Object value)

      Returns an internalized value if it already exists in the cache
      Parameters:
        `value` - value
      Returns:
        the internalized value

    - #### clearAll

          protected static void clearAll(java.lang.String processId)

      Clears all the values corresponding to the given process
      Parameters:
        `processId` - processId