Methods Summary |
---|
public java.util.Properties | getFactoryClassEnv(java.lang.String type)Get the registered factory for the type specified in the parameter
BackingStoreInfo info = type2BackingStoreInfo.get(type);
return (info == null) ? null : info.props;
|
public java.lang.String | getFactoryClassName(java.lang.String type)Get the registered factory for the type specified in the parameter
BackingStoreInfo info = type2BackingStoreInfo.get(type);
return (info == null) ? null : info.className;
|
public BackingStoreFactory | getFactoryInstance(java.lang.String type)Return an instance of BackingStoreFactory for the specified type. If a
factory instance for this persistence type has not yet been instantiated
then an instance is created using the public no-arg constructor. Then
{@link BackingStore#initialize(String, Properties)} will be called to
properly initialize the BsackingStore.
BackingStoreFactory factory = null;
BackingStoreInfo info = type2BackingStoreInfo.get(type);
if (info != null) {
if (info.factory == null) {
synchronized (info) {
Class clazz = Class.forName(info.className);
info.factory = (BackingStoreFactory) clazz.newInstance();
}
}
factory = info.factory;
}
return factory;
|
public static com.sun.appserv.ha.spi.BackingStoreRegistry | getInstance()Return the (singleton) instance of BackingStoreRegistry
return _instance;
|
public java.util.Collection | getRegisteredTypes()Get a list of all registered store type
return type2BackingStoreInfo.keySet();
|
public synchronized void | register(java.lang.String type, java.lang.String factoryClassName, java.util.Properties props)Register a BackingStoreFactory class name and any associated Properties
for the given persistence type. The properties must contain any
additional configuration paramters to properly initialize and use the
store.
if (type2BackingStoreInfo.get(type) != null) {
throw new DuplicateFactoryRegistrationException(
"Duplicate factory class (" + factoryClassName
+ ") for type: " + type);
} else {
type2BackingStoreInfo.put(type, new BackingStoreInfo(
factoryClassName, props));
}
|
public boolean | remove(java.lang.String type)Unregister the factory
return (type2BackingStoreInfo.remove(type) != null);
|