Skip navigation links

Oracle Communications Services Gatekeeper Java API Reference
6.0

E55513-02


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

java.lang.Object
  extended bycom.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.


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 a 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 a reference to a preconfigured store. It's recommended to use Store<K,V> getStore(Class<K> keyClass, Class<V> 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 (for example, preloading).

Skip navigation links

Oracle Communications Services Gatekeeper Java API Reference
6.0

E55513-02


Copyright © 2008, 2015, Oracle and/or its affiliates. All rights reserved.