org.jgroups.persistence

Class PersistenceFactory


public class PersistenceFactory
extends java.lang.Object

Author:
Mandar Shinde This class is the factory to get access to any DB based or file based implementation. None of the implementations should expose directly to user for migration purposes

Field Summary

protected static Log
log

Method Summary

PersistenceManager
createManager()
Reads the default properties and creates a persistencemanager The default properties are picked up from the $USER_HOME or from the classpath.
PersistenceManager
createManager(String filePath)
Duplicated signature to create PersistenceManager to allow user to provide property path.
static PersistenceFactory
getInstance()
Singular public method to get access to any of the Persistence Manager implementations.
void
registerManager(PersistenceManager manager)
Register a custom persistence manager as opposed to the FilePersistenceManager or DBPersistenceManager.

Field Details

log

protected static final Log log

Method Details

createManager

public PersistenceManager createManager()
            throws Exception
Reads the default properties and creates a persistencemanager The default properties are picked up from the $USER_HOME or from the classpath. Default properties are represented by "persist.properties"
Returns:
PersistenceManager

createManager

public PersistenceManager createManager(String filePath)
            throws Exception
Duplicated signature to create PersistenceManager to allow user to provide property path.
Parameters:
filePath - complete pathname to get the properties
Returns:
PersistenceManager;

getInstance

public static PersistenceFactory getInstance()
Singular public method to get access to any of the Persistence Manager implementations. It is important to known at this point that properties determine the implementation of the Persistence Manager, there is no direct interface which gives access to either DB implemented ot FILE implemented storage API.
Returns:
PersistenceFactory;

registerManager

public void registerManager(PersistenceManager manager)
Register a custom persistence manager as opposed to the FilePersistenceManager or DBPersistenceManager.

Copyright B) 1998-2005 Bela Ban. All Rights Reserved.