Oracle Communications Services Gatekeeper Java API Reference
6.1

E65002-01

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

java.lang.Object
  extended bycom.bea.wlcp.wlng.api.storage.StoreFactory

public abstract class StoreFactory
extends java.lang.Object

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


Field Summary
protected static java.lang.String DEFAULT_FACTORY_CLASS
           
protected static java.lang.String FACTORY_CLASS
           
protected static java.lang.String FACTORY_CLASS_PROPERTY
           
protected static StoreFactory instance
           
 
Constructor Summary
StoreFactory()
           
 
Method Summary
protected static void changeStoreFactory(java.lang.String newStoreFactoryName)
          Change store factory instance.
static StoreFactory getInstance()
          Get store factory instance.
abstract  Store getStore(java.lang.Class keyClass, java.lang.Class valueClass)
          Get reference to a preconfigured store.
abstract  Store getStore(java.lang.String name, java.lang.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 java.lang.String DEFAULT_FACTORY_CLASS
See Also:
Constant Field Values

FACTORY_CLASS

protected static final java.lang.String FACTORY_CLASS

FACTORY_CLASS_PROPERTY

protected static final java.lang.String FACTORY_CLASS_PROPERTY
See Also:
Constant Field Values

instance

protected static volatile StoreFactory instance
Constructor Detail

StoreFactory

public StoreFactory()
Method Detail

changeStoreFactory

protected static final void changeStoreFactory(java.lang.String newStoreFactoryName)
Change store factory instance.


getInstance

public static final StoreFactory getInstance()
Get store factory instance.

Returns:
the store factory instance.

getStore

public abstract Store getStore(java.lang.Class keyClass,
                               java.lang.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(java.lang.String name,
                               java.lang.ClassLoader classloader)
                        throws StorageException
Get a 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 (for example, preloading).


Oracle Communications Services Gatekeeper Java API Reference
6.1

E65002-01

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