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

## com.bea.wlcp.wlng.api.storage
Class StoreFactory

    java.lang.Object
      com.bea.wlcp.wlng.api.storage.StoreFactory

public abstract class StoreFactory
extends Object

Store factory class. Used to retrieve pre-configured stores and add listeners for stores.

  Copyright © 2008 Oracle Corporation Systems, Inc. All Rights Reserved.

Field Summary
`protected static String` | `DEFAULT_FACTORY_CLASS`
`protected static String` | `FACTORY_CLASS`
`protected static String` | `FACTORY_CLASS_PROPERTY`
`protected static StoreFactory` | `instance`

Constructor Summary
`StoreFactory()`

Method Summary
`static StoreFactory` | `getInstance()` Get store factory instance.
`abstract Store` | `getStore(Class keyClass, Class valueClass)` Get reference to a preconfigured store.
`abstract Store` | `getStore(String name, ClassLoader classloader)` Get reference to a preconfigured store.
`protected abstract void` | `initialize()` Initializes the store factory.

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

Field Detail

### DEFAULT_FACTORY_CLASS

    protected static final String DEFAULT_FACTORY_CLASS

See Also:
  Constant Field Values

### FACTORY_CLASS

    protected static final String FACTORY_CLASS

### FACTORY_CLASS_PROPERTY

    protected static final String FACTORY_CLASS_PROPERTY

See Also:
  Constant Field Values

### instance

    protected static volatile StoreFactory instance

Constructor Detail

### StoreFactory

    public StoreFactory()

Method Detail

### getInstance

    public static final StoreFactory getInstance()

  Get store factory instance.

  Returns:
    the store factory instance.

### getStore

    public abstract Store getStore(Class keyClass,
                                   Class valueClass)
                            throws StorageException

  Get reference to a preconfigured store. The store configuration is found using the key and value class names.
  Note that the Store instance retrieved should not be considered thread safe, and that users should retrieve different Store instances for each transaction.

  Parameters:
    `keyClass` - The class of the store key entries. Should be a primitive type.
    `valueClass` - The class of the store value entries. The class is required to have a public default (no argument) constructor. The value class should be a class that uniquely identifies the store.
  Throws:
    `StorageException` - If the store could not be initialized.

### getStore

    public abstract Store getStore(String name,
                                   ClassLoader classloader)
                            throws StorageException

  Get reference to a preconfigured store. It's recommended to use Store getStore(Class keyClass, Class valueClass) method and always define a custom class to use as valueClass.
  Note that the Store instance retrieved should not be considered thread safe, and that users should retrieve different Store instances for each transaction.
  This method can be used to retrieve a general named store without specifying a class. The typical use for this is when the user for some reason can not specify a unique class to identify the store, and need to separate stores sharing the same value class from each other. This method should only be used for stores with primitive data type values.

  Parameters:
    `name` - The store name.
    `classloader` - The classloader to use for store entries.
  Throws:
    `StorageException` - If the store could not be initialized.

### initialize

    protected abstract void initialize()

  Initializes the store factory. Subclass can perform any steps that need to be executed once at startup (e.g. preloading).

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