public final class StoreObjectFactoryRegistry extends OdsObject
The object factory registry, a singleton class, stores references to configured object factories. It loads and instantiates object factories and serves them out by name and id.
Modifier and Type | Field and Description |
---|---|
static String |
ADM_COMPATIBILITY_LEVEL
The ODS ADM Generated Code Compatibility level.
|
Modifier and Type | Method and Description |
---|---|
void |
dumpFactoryVersionInfo(StringBuilder builder)
Dump the registered factories' version information.
|
static StoreObjectFactoryRegistry |
getInstance()
Get the singleton object factory registry instance.
|
IStoreObjectFactory |
getObjectFactory(short factoryId)
Get an object factory.
|
Set<String> |
getStoreObjectFactoryNames(Set<String> factories)
Get the names of the set of registered factories.
|
static IStoreObjectFactory |
loadObjectFactory(String className)
Load (instantiate) an object factory class
|
boolean |
registerIfNoConflict(IStoreObjectFactory factory)
Registers the given factory, if it doesn't conflict with an existing factory.
|
boolean |
registerIfNoConflict(String factoryClassName)
Register a object factory by class name, if it doesn't conflict with an existing factory.
|
void |
registerObjectFactory(IStoreObjectFactory factory)
Register an object factory
|
void |
registerObjectFactory(String factoryClassName)
Register an object factory by class name
|
getChecked, getThreaded, getTracer, setChecked, setTracer
public static final String ADM_COMPATIBILITY_LEVEL
public static final StoreObjectFactoryRegistry getInstance()
public static final IStoreObjectFactory loadObjectFactory(String className) throws Exception
className
- The name of the object factory class to instantiateException
public final void registerObjectFactory(String factoryClassName) throws Exception
factoryClassName
- The name of the object factory to registerException
This method instantiates an object factory of the supplied class name and adds the instantiated factory to the object factory registry. It will replace a factory of the same id if one exists.
public final void registerObjectFactory(IStoreObjectFactory factory)
factory
- The object factory to registerThis method adds the supplied object factory to the object factory registry. It will replace a factory of the same id if one exists.
public final boolean registerIfNoConflict(String factoryClassName) throws OdsFactoryIdConflictException, Exception
factoryClassName
- The name of the factory class to load and register.EAdmCompatibilityException
- If the factory is not compatible with the runtimeOdsFactoryIdConflictException
- If another factory of a different type is already registered.Exception
- If the factoryClassName cannot be loaded as a store object factory.This method adds the supplied object factory to the object factory registry. It will not replace a factory of the same id if one exists.
public final boolean registerIfNoConflict(IStoreObjectFactory factory) throws OdsFactoryIdConflictException
factory
- The object factory to registerEAdmCompatibilityException
- If the factory is not compatible with the runtimeOdsFactoryIdConflictException
- If another factory of a different type is already registered.This method adds the supplied object factory to the object factory registry. It will not replace a factory of the same id if one exists.
public final IStoreObjectFactory getObjectFactory(short factoryId)
factoryId
- The factory's unique identifier.public final Set<String> getStoreObjectFactoryNames(Set<String> factories)
factories
- The set to add the factory names to.public final void dumpFactoryVersionInfo(StringBuilder builder)
builder
- The set to add the factory names to.Copyright © 2019 Neeve Research, LLC. All Rights Reserved.