FileDocCategorySizeDatePackage
BackingStoreFactory.javaAPI DocGlassfish v2 API5038Fri May 04 22:35:26 BST 2007com.sun.appserv.ha.spi

BackingStoreFactory

public interface BackingStoreFactory
A factory for creating BackingStore(s). Every provider must provide an implementation of this interface.

The createBackingStore(env) method is called typically during container creation time. A store instance is typically used to store state for a single container whose id is passed (as appId) to createStore() method.

The createBatchBackingStore() method will be called whenever the container decides to save a set of states that belong different applications. Thus the store returned by createBatchBackingStore method is different from createBackingStore in that the data passed in the collection may potentially be from different containers/applications.

Any runtime exception thrown from createBackingStore and createBatchBackingStore method will cause the container to use a default persistence-type (typically no replication) and a log message will be logged at WARNING level.

Both BackingStore and BatchBackingStore must be thread safe.

see
BackingStoreRegistry

Fields Summary
Constructors Summary
Methods Summary
public BackingStorecreateBackingStore(java.lang.Class type, java.lang.String appId, java.util.Properties env)
This method is called to create a BackingStore that will store SimpleMetadata or CompositeMetadata. This class must be thread safe.

The factory must return a fully initialized and operational BackingStore

param
type The type of data that will be saved (using the save() method in BackingStore) in the store.
param
appId the application id for which this store is created
param
env Properties that contain any additional configuration paramters to successfully initialize and use the store.
return
a BackingStore. The returned BackingStore will be used only to store data of type K. The returned BackingStore must be thread safe.
throws
BackingStoreException If the store could not be created

public BatchBackingStorecreateBatchBackingStore(java.util.Properties env)
This method is called to store a set of BatchMetadata objects atomically. The factory must return a fully initialized and operational BatchBackingStore

The factory must return a fully initialized and operational BatchBackingStore

param
env Properties that contain any additional configuration paramters to successfully initialize and use the store.
return
A BatchBackingStore
throws
BackingStoreException If the store could not be created