@ConfigurationDescription(properties=) public abstract class InstanceToInstanceRegistry extends PluginRegistry
PM1.DataManager = DM1. "PM1" can retrieve the corresponding by
calling
getUsedObjectForInstance(session, "/ProcessManager/PM1", "DataManager", DataManager.class).
The used component can be configured for all instances of the using type by
configuring it: ProcessManager.LogManager = LM1. This
configuration is used, in case no specific one for the using instance is
found. If a usage relation is omitted, the default instance (see
PluginRegistry) will be used.
This class parses the following properties from the registry configuration - besides the properties parsed by super classes:
ConfigurationConstants.PREFIX_PROPERTY_REGISTRY_INSTANCES)
PluginRegistry.ConfigurationValidator, PluginRegistry.URLClassloaderPrivilegedActionAbstractRegistry.DefaultNameResolution, AbstractRegistry.InstanceInformation, AbstractRegistry.InstantiationModeAbstractADEPT2Service.ActiveSessions| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
usedInstances
The usage relations for instances.
|
declaredPluginTypes, defaultInstances, dynamicPlugins, pluginInstances, runtimePlugins, runtimePluginTypeCLs, singletonPluginscomponentInterfaces, configurationManager, declaredInstances, INIT_INSTANTIATED_OBJECT_METHOD, nameResolution, singletonInstancesCFG_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_USERNAMECONF_CSV_LOGGING, configuration, logger, registry, runtimeRequiredServices, startupRequiredServices| Modifier | Constructor and Description |
|---|---|
protected |
InstanceToInstanceRegistry(UrlConfigurationManager confMgr,
Configuration configuration,
Registry registry)
Constructs a new registry supporting instance to instance relations.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
getUsedComponentInstanceNameForInstance(java.lang.String usingInstance,
java.lang.String usedComponentType)
Returns the hierarchical name of the instance of the designated type for
usage by the designated instance (specified by its instance name).
|
protected <T> T |
getUsedObjectForInstance(java.lang.String usingInstance,
java.lang.String usedComponentType,
java.lang.Class<T> requestedType)
Gets an object for use by the the designated component instance which
conforms to the designated component type (
usedComponentType)
and is of the requested type. |
protected void |
renewConfiguration(Configuration conf)
Renews the configuration of this registry by renewing via the superclass
and reading of usage relations.
|
createPluginLoader, getConfiguredPlugin, getConfiguredPlugin, getConfiguredPlugin, getConfiguredPlugins, prepareRuntimePlugin, readMetaConfigurationcheckAndStoreProvidedObject, checkConfiguration, checkImplementingClass, checkSupertype, createInstanceForInterface, getAppropriateMethod, getArbitrarilyNamedObject, getComponentType, getFormattedSignature, getHierarchicalInstanceName, getInstanceInformation, getInstantiationMode, getInterfaceForComponentType, getObjectForInstanceName, getObjectForInstanceName, getObjectForInstanceName, getSimpleInstanceName, init, initialiseInstantiatedObject, readMetaConfiguration, shutdown_sessionActive, authenticateService, awaitActiveSessions, createChildSession, createSession, getAgent, getSecurityManager, getSessionFactory, getStartupRequired, getTopLevelAgent, getUserCredentials, globalSecurityManagerAvailable, isEarlyService, sessionHasCapability_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, unprivilegeThreadclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, ping, preShutdown, startprotected final java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> usedInstances
protected InstanceToInstanceRegistry(UrlConfigurationManager confMgr, Configuration configuration, Registry registry) throws ConfigurationException
PluginRegistry which sets the
registry configuration, the configuration manager and the logger.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.ConfigurationException - If the password cannot be parsed from the
configuration, a ConfigurationException will be
thrown.protected void renewConfiguration(Configuration conf) throws ConfigurationException
renewConfiguration in class PluginRegistryconf - The (new) root configuration for this registry.ConfigurationException - If
PropertyNotSetException),ConfigurationException will be thrown.protected <T> T getUsedObjectForInstance(java.lang.String usingInstance,
java.lang.String usedComponentType,
java.lang.Class<T> requestedType)
throws ConfigurationException
usedComponentType)
and is of the requested type. The instantiation mode of the used component
is obeyed. If the instantiation mode is not set, singleton will be used. Configuration) will be used. T - The type which the requested object is expected to be of which
is either the registered component type or a super type hereof.usingInstance - The hierarchical name of the using component instance.
Use the component type if the instance name is not defined. Use
the empty string if the instance name is unknown.usedComponentType - The component type of the instance to be retrieved
for usage. This may neither be null nor the empty string.requestedType - The type of which the requested object is expected to
be. This is either the registered component type interface or a
super type hereof.ConfigurationException - If
ConfigurationException will be thrown.AbstractRegistry.getObjectForInstanceName(String, Class, Class[], Object[])protected java.lang.String getUsedComponentInstanceNameForInstance(java.lang.String usingInstance,
java.lang.String usedComponentType)
throws ConfigurationException
usingInstance - The hierarchical name of the component instance for
which to retrieve the used component instance. Use the empty
string if the instance name is not defined.usedComponentType - The component type to retrieve an instance name
for. This may neither be null nor the empty string.ConfigurationException - If there is no used component name found
particularly even no default instance, a
ConfigurationException will be thrown.