Package de.aristaflow.adept2.model
Class ModelFactoryRegistry
-
- All Implemented Interfaces:
ConfMgrRegistry
,ADEPT2Service
,AuthenticatingService
,LogService
,NameResolution
,ServiceThreadHandling
,ModelViewerProvider
@ConfigurationDescription(properties={@Property(name="Components.ProcessModelFactory",isRequired=true,description="the process model factory"),,,,,,,,,,}) public final class ModelFactoryRegistry extends InstanceToInstanceRegistry implements ModelViewerProvider
This class extends theInstanceToInstanceRegistry
to support all model factories in ADEPT2. These factories are used to encapsulate the users of data models (defined via interfaces) from the underlying implementations.This class parses the following properties from the registry configuration (when checking instance declarations):
- Components.<ComponentType>
- PluginData.Instances
- <InstanceName>.Implementation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.aristaflow.adept2.base.registry.PluginRegistry
PluginRegistry.ConfigurationValidator, PluginRegistry.URLClassloaderPrivilegedAction
-
Nested classes/interfaces inherited from class de.aristaflow.adept2.base.registry.AbstractRegistry
AbstractRegistry.DefaultNameResolution, AbstractRegistry.InstanceInformation, AbstractRegistry.InstantiationMode
-
Nested classes/interfaces inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
AbstractADEPT2Service.ActiveSessions
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Class<?>>
declaredModelViewers
The model viewer class objects for the plug-in data (ID -> class).-
Fields inherited from class de.aristaflow.adept2.base.registry.InstanceToInstanceRegistry
usedInstances
-
Fields inherited from class de.aristaflow.adept2.base.registry.PluginRegistry
declaredPluginTypes, defaultInstances, dynamicPlugins, pluginInstances, runtimePlugins, runtimePluginTypeCLs, singletonPlugins
-
Fields inherited from class de.aristaflow.adept2.base.registry.AbstractRegistry
componentInterfaces, configurationManager, declaredInstances, INIT_INSTANTIATED_OBJECT_METHOD, nameResolution, singletonInstances
-
Fields inherited from class de.aristaflow.adept2.base.service.AbstractAuthenticatedService
CFG_EARLY_SERVICEAUTH_ORGPOSID, CFG_EARLY_SERVICEAUTH_ORGPOSNAME, CFG_EARLY_SERVICEAUTH_PASSWORD, CFG_EARLY_SERVICEAUTH_USERNAME, CFG_SERVICEAUTH_ORGPOSID, CFG_SERVICEAUTH_ORGPOSNAME, CFG_SERVICEAUTH_PASSWORD, CFG_SERVICEAUTH_USERNAME
-
Fields inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
CONF_CSV_LOGGING, configuration, logger, registry, runtimeRequiredServices, startupRequiredServices
-
-
Constructor Summary
Constructors Constructor Description ModelFactoryRegistry(UrlConfigurationManager confMgr, org.apache.commons.configuration2.Configuration configuration, Registry registry)
Constructs a new model factory registry supporting factory for the creation of model implementations.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
authenticateService()
TheModelFactoryRegistry
does not need an authentication, therefore this implementation is empty.ActivityModelFactory
getActivityModelFactory(String usingInstance)
Gets the instance of the activity model factory configured for the designated component instance.ExecutionFactory
getExecutionFactory(String usingInstance)
Gets the instance of the execution factory configured for the designated component instance.protected <T> T
getFactory(String usingInstance, String factoryType, Class<T> factoryClass)
Gets the instance of the designated factory configured for the component instance with the designated instance name.SystemDataFormatterFactory
getFormatterFactory(String usingInstance)
Gets the instance of the system data formatter configured for the designated component instance.GraphicalModelFactory
getGraphicalModelFactory(String usingInstance)
Gets the instance of the graphical model factory configured for the designated component instance.InitTabFactory
getInitTabFactory(String usingInstance)
Gets the instance of the init tab model factory configured for the designated component instance.LocalisationFactory
getLocalisationFactory(String usingInstance)
Gets the instance of the localisation factory configured for the designated component instance.static ModelFactoryRegistry
getModelFactoryRegistry()
Deprecated.FilterFactory
getModelFilterFactory(String usingInstance)
Gets the instance of the filter factory configured for the designated component instance.Class<?>
getModelViewerClass(String pluginID)
Gets the model viewer class for the designated plugin ID.ProcessModelFactory
getProcessModelFactory(String usingInstance)
Gets the instance of the process model factory configured for the designated component instance.de.aristaflow.adept2.model.resourcemodel.builder.ResourceModelFactory
getResourceModelFactory(String usingInstance)
Gets the instance of the resource model factory configured for the designated component instance.WorklistModelFactory
getWorklistModelFactory(String usingInstance)
Gets the instance of the worklist model factory configured for the designated component instance.protected void
readDeclaredModelViewerClasses(org.apache.commons.configuration2.Configuration conf)
Reads all declared model viewer classes from the configuration and loads the classes.protected void
renewConfiguration(org.apache.commons.configuration2.Configuration conf)
Renews the configuration of this registry by renewing via the superclass and reading the declared model viewer classes for plugin data.void
shutdown(boolean emergency)
Signals the shutdown of this registry.-
Methods inherited from class de.aristaflow.adept2.base.registry.InstanceToInstanceRegistry
getUsedComponentInstanceNameForInstance, getUsedObjectForInstance
-
Methods inherited from class de.aristaflow.adept2.base.registry.PluginRegistry
createPluginLoader, getConfiguredPlugin, getConfiguredPlugin, getConfiguredPlugin, getConfiguredPlugins, getConfiguredPluginTypes, prepareRuntimePlugin, readMetaConfiguration
-
Methods inherited from class de.aristaflow.adept2.base.registry.AbstractRegistry
checkAndStoreProvidedObject, checkConfiguration, checkImplementingClass, checkSupertype, createInstanceForInterface, getAppropriateMethod, getArbitrarilyNamedObject, getComponentType, getFormattedSignature, getHierarchicalInstanceName, getInstanceInformation, getInstantiationMode, getInterfaceForComponentType, getNames, getObjectForInstanceName, getObjectForInstanceName, getObjectForInstanceName, getSimpleInstanceName, init, initialiseInstantiatedObject, readMetaConfiguration
-
Methods inherited from class de.aristaflow.adept2.base.service.AbstractAuthenticatedService
_sessionActive, awaitActiveSessions, createChildSession, createSession, getAgent, getSecurityManager, getSessionFactory, getStartupRequired, getTopLevelAgent, getUserCredentials, globalSecurityManagerAvailable, isEarlyService, sessionHasAllCapabilities, sessionHasAllTopLevelCapabilities, sessionHasCapability, sessionHasOneCapability, sessionHasOneTopLevelCapability
-
Methods inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
_sessionFinished, activeOrInvalidServiceStateException, changeLogContext, changeLogContext, changeLogContext, consoleLog, csvLoggingEnabled, getClassSpecificJulLogger, getDependencyRegistry, getLocalUris, getLogger, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, isActive, isSessionActive, isShutdown, logMethodEntry, logMethodEntry, logMethodEntry, logMethodExit, logMethodExit, ping, preShutdown, privilegeSession, privilegeThread, revertLogContextChanges, sessionActive, sessionActive, sessionActive, sessionActive, sessionFinished, sessionFinished, signalShutdown, signalStart, start, unprivilegeThread
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.aristaflow.adept2.base.service.ADEPT2Service
getLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, ping, preShutdown, start
-
-
-
-
Field Detail
-
declaredModelViewers
protected final Map<String,Class<?>> declaredModelViewers
The model viewer class objects for the plug-in data (ID -> class). Model viewer allow to extend normal model elements (PluginDataContainer
) by additional data and provide type-safe access. This way they build a special view on the model elements and their additional plugin data.
-
-
Constructor Detail
-
ModelFactoryRegistry
public ModelFactoryRegistry(UrlConfigurationManager confMgr, org.apache.commons.configuration2.Configuration configuration, Registry registry) throws ConfigurationException
Constructs a new model factory registry supporting factory for the creation of model implementations. It calls the constructor ofInstanceToInstanceRegistry
.- Parameters:
confMgr
- The initial configuration manager that provides configurations for the loaded component instances.configuration
- The configuration of the registry.registry
- The parent registry of this registry.- Throws:
ConfigurationException
- If the password cannot be parsed from the configuration, aConfigurationException
will be thrown.
-
-
Method Detail
-
authenticateService
protected void authenticateService()
TheModelFactoryRegistry
does not need an authentication, therefore this implementation is empty.- Overrides:
authenticateService
in classAbstractAuthenticatedService
-
renewConfiguration
protected void renewConfiguration(org.apache.commons.configuration2.Configuration conf) throws ConfigurationException
Renews the configuration of this registry by renewing via the superclass and reading the declared model viewer classes for plugin data.- Overrides:
renewConfiguration
in classInstanceToInstanceRegistry
- Parameters:
conf
- The (new) root configuration for this registry.- Throws:
ConfigurationException
- If a model viewer class is declared but it is not found by this registry, aConfigurationException
will be thrown.
-
readDeclaredModelViewerClasses
protected void readDeclaredModelViewerClasses(org.apache.commons.configuration2.Configuration conf) throws ConfigurationException
Reads all declared model viewer classes from the configuration and loads the classes.- Parameters:
conf
- The (new) root configuration for this registry containing the declared model viewer classes.- Throws:
ConfigurationException
- If a model viewer class is declared but it is not found by this registry, aConfigurationException
will be thrown.
-
getProcessModelFactory
public ProcessModelFactory getProcessModelFactory(String usingInstance) throws ServiceNotKnownException
Gets the instance of the process model factory configured for the designated component instance.- Parameters:
usingInstance
- The name of the component instance requesting the process model factory. Use the empty string if the instance name is not defined.- Returns:
- The instance of a process model factory configured for the requesting component instance or the anonymous instance of the process model factory.
- Throws:
ServiceNotKnownException
- If- no component interface is registered/configured for the process model factory,
- the instantiation mode of the process model factory is set to off,
- the creation of the process model factory instance fails,
- the used instance of the process model factory is not declared properly,
- the configuration of the used instance does not provide required configuration values,
ServiceNotKnownException
will be thrown.
-
getActivityModelFactory
public ActivityModelFactory getActivityModelFactory(String usingInstance) throws ServiceNotKnownException
Gets the instance of the activity model factory configured for the designated component instance.- Parameters:
usingInstance
- The name of the component instance requesting the activity model factory. Use the empty string if the instance name is not defined.- Returns:
- The instance of an activity model factory configured for the requesting component instance or the anonymous instance of the activity model factory.
- Throws:
ServiceNotKnownException
- If- no component interface is registered/configured for the activity model factory,
- the instantiation mode of the activity model factory is set to off,
- the creation of the activity model factory instance fails,
- the used instance of the activity model factory is not declared properly,
- the configuration of the used instance does not provide required configuration values,
ServiceNotKnownException
will be thrown.
-
getWorklistModelFactory
public WorklistModelFactory getWorklistModelFactory(String usingInstance) throws ServiceNotKnownException
Gets the instance of the worklist model factory configured for the designated component instance.- Parameters:
usingInstance
- The name of the component instance requesting the worklist model factory. Use the empty string if the instance name is not defined.- Returns:
- The instance of a worklist model factory configured for the requesting component instance or the anonymous instance of the worklist model factory.
- Throws:
ServiceNotKnownException
- If- no component interface is registered/configured for the worklist model factory,
- the instantiation mode of the worklist model factory is set to off,
- the creation of the worklist model factory instance fails,
- the used instance of the worklist model factory is not declared properly,
- the configuration of the used instance does not provide required configuration values,
ServiceNotKnownException
will be thrown.
-
getModelFilterFactory
public FilterFactory getModelFilterFactory(String usingInstance) throws ServiceNotKnownException
Gets the instance of the filter factory configured for the designated component instance.- Parameters:
usingInstance
- The name of the component instance requesting the filter factory. Use the empty string if the instance name is not defined.- Returns:
- The instance of a filter factory configured for the requesting component instance or the anonymous instance of the filter factory.
- Throws:
ServiceNotKnownException
- If- no component interface is registered/configured for the filter factory,
- the instantiation mode of the filter factory is set to off,
- the creation of the filter factory instance fails,
- the used instance of the filter factory is not declared properly,
- the configuration of the used instance does not provide required configuration values,
ServiceNotKnownException
will be thrown.
-
getExecutionFactory
public ExecutionFactory getExecutionFactory(String usingInstance) throws ServiceNotKnownException
Gets the instance of the execution factory configured for the designated component instance.- Parameters:
usingInstance
- The name of the component instance requesting the execution factory. Use the empty string if the instance name is not defined.- Returns:
- The instance of an execution factory configured for the requesting component instance or the anonymous instance of the execution factory.
- Throws:
ServiceNotKnownException
- If- no component interface is registered/configured for the execution factory,
- the instantiation mode of the execution factory is set to off,
- the creation of the execution factory instance fails,
- the used instance of the execution factory is not declared properly,
- the configuration of the used instance does not provide required configuration values,
ServiceNotKnownException
will be thrown.
-
getGraphicalModelFactory
public GraphicalModelFactory getGraphicalModelFactory(String usingInstance) throws ServiceNotKnownException
Gets the instance of the graphical model factory configured for the designated component instance.- Parameters:
usingInstance
- The name of the component instance requesting the graphical model factory. Use the empty string if the instance name is not defined.- Returns:
- The instance of a graphical model factory configured for the requesting component instance or the anonymous instance of the graphical model factory.
- Throws:
ServiceNotKnownException
- If- no component interface is registered/configured for the graphical model factory,
- the instantiation mode of the graphical model factory is set to off,
- the creation of the graphical model factory instance fails,
- the used instance of the graphical model factory is not declared properly,
- the configuration of the used instance does not provide required configuration values,
ServiceNotKnownException
will be thrown.
-
getInitTabFactory
public InitTabFactory getInitTabFactory(String usingInstance) throws ServiceNotKnownException
Gets the instance of the init tab model factory configured for the designated component instance.- Parameters:
usingInstance
- The name of the component instance requesting the init tab model factory. Use the empty string if the instance name is not defined.- Returns:
- The instance of an init tab factory configured for the requesting component instance or the anonymous instance of the init tab model factory.
- Throws:
ServiceNotKnownException
- If- no component interface is registered/configured for the init tab model factory,
- the instantiation mode of the init tab factory is set to off,
- the creation of the init tab factory instance fails,
- the used instance of the init tab factory is not declared properly,
- the configuration of the used instance does not provide required configuration values,
ServiceNotKnownException
will be thrown.
-
getResourceModelFactory
public de.aristaflow.adept2.model.resourcemodel.builder.ResourceModelFactory getResourceModelFactory(String usingInstance) throws ServiceNotKnownException
Gets the instance of the resource model factory configured for the designated component instance.- Parameters:
usingInstance
- The name of the component instance requesting the resource model factory. Use the empty string if the instance name is not defined.- Returns:
- The instance of a resource model factory configured for the requesting component instance or the anonymous instance of the resource model factory.
- Throws:
ServiceNotKnownException
- If- no component interface is registered/configured for the resource model factory,
- the instantiation mode of the resource model factory is set to off,
- the creation of the resource model factory instance fails,
- the used instance of the resource model factory is not declared properly,
- the configuration of the used instance does not provide required configuration values,
ServiceNotKnownException
will be thrown.
-
getLocalisationFactory
public LocalisationFactory getLocalisationFactory(String usingInstance) throws ServiceNotKnownException
Gets the instance of the localisation factory configured for the designated component instance.- Parameters:
usingInstance
- The name of the component instance requesting the localisation factory. Use the empty string if the instance name is not defined.- Returns:
- The instance of a localisation factory configured for the requesting component instance or the anonymous instance of the localisation factory.
- Throws:
ServiceNotKnownException
- If- no component interface is registered/configured for the localisation factory,
- the instantiation mode of the localisation factory is set to off,
- the creation of the localisation factory instance fails,
- the used instance of the localisation factory is not declared properly,
- the configuration of the used instance does not provide required configuration values,
ServiceNotKnownException
will be thrown.
-
getFormatterFactory
public SystemDataFormatterFactory getFormatterFactory(String usingInstance) throws ServiceNotKnownException
Gets the instance of the system data formatter configured for the designated component instance.- Parameters:
usingInstance
- The name of the component instance requesting the system data formatter factory. Use the empty string if the instance name is not defined.- Returns:
- The instance of a system data formatter factory configured for the requesting component instance or the anonymous instance of the system data formatter factory.
- Throws:
ServiceNotKnownException
- If- no component interface is registered/configured for the system data formatter factory,
- the instantiation mode of the system data formatter factory is set to off,
- the creation of the system data formatter factory instance fails,
- the used instance of the system data formatter factory is not declared properly,
- the configuration of the used instance does not provide required configuration values,
ServiceNotKnownException
will be thrown.
-
getFactory
protected <T> T getFactory(String usingInstance, String factoryType, Class<T> factoryClass) throws ServiceNotKnownException
Gets the instance of the designated factory configured for the component instance with the designated instance name.- Type Parameters:
T
- The type of the model factory which to retrieve.- Parameters:
usingInstance
- The name of the component instance requesting the model factory. Use the empty string if the instance name is not defined.factoryType
- The type name of the model factory which to retrieve.factoryClass
- The class of the model factory which to retrieve.- Returns:
- The instance of a model factory configured for the requesting component instance or the anonymous instance of the model factory.
- Throws:
ServiceNotKnownException
- If- no component interface is registered/configured for the model factory,
- the instantiation mode of the model factory is set to off,
- the creation of the model factory instance fails,
- the used instance of the model factory is not declared properly,
- the configuration of the used instance does not provide required configuration values,
ServiceNotKnownException
will be thrown.
-
getModelViewerClass
public Class<?> getModelViewerClass(String pluginID)
Gets the model viewer class for the designated plugin ID. If the plugin ID is not known,null
will be returned.- Specified by:
getModelViewerClass
in interfaceModelViewerProvider
- Parameters:
pluginID
- The ID of the plugin to retrieve a model viewer class for. This provides type-safe access to the data of the plugin which is stored by aPluginDataContainer
.- Returns:
- The model viewer class for the designated plugin or
null
in case the plugin ID is not known.
-
getModelFactoryRegistry
@Deprecated public static ModelFactoryRegistry getModelFactoryRegistry() throws ServiceNotKnownException
Deprecated.- Throws:
ServiceNotKnownException
-
shutdown
public void shutdown(boolean emergency)
Description copied from class:PluginRegistry
Signals the shutdown of this registry. No access except the privileged threads may access this registry afterwards.This method has to be called at an arbitrary time in the shutdown-procedure of overriding classes. Closes all corresponding class loaders in case of a non-emergency shutdown.
- Specified by:
shutdown
in interfaceADEPT2Service
- Overrides:
shutdown
in classPluginRegistry
- Parameters:
emergency
- Whether the shutdown will be an emergency shutdown.
-
-