@ConfigurationDescription(properties={@Property(name="Components.<ComponentTypeName>",documentationOnly=true,description="The value is the name of an interface or class that represents a component type. Such a configuration entry declares a component type having this interface and the designated component type name, e.g. \"Components.C = InterfaceClass1\" declares a component type \"C\" having the interface \"InterfaceClass1\"."),,,,,,}) public abstract class AbstractRegistry extends AbstractAuthenticatedService implements ConfMgrRegistry, NameResolution
org.apache.commons.configuration2.Configuration).
Classes specified as implementation for a component type may be annotated
with a ConfigurationDescription. This description is used to
automatically validate actual configurations at creation/request time. This
tremendously simplifies the task of manual validation or makes it even
unnecessary in some cases. But even manual validation can be performed before
any instance of the component is created by the means of a
ConfigurationValidator.
Instances of components are declared in the root configuration of this
registry configuration:
Instances.<ComponentType> = <x>, <y>. The
instance names can be used to have instance-specific configurations in the
root configuration of this registry:
<SimpleName>.<PropertyName> = <PropertyValue>.
The simple names are just arbitrary alphanumeric characters. They may not
contain any characters that are meaningful when used in a URI. At runtime
this name is prepended by the corresponding component type name, creating a
hierarchical instance name. Normally, the difference between the simple and
the hierarchical instance name can be ignored since the simple name is only
used in configuration files and within the registry.
The properties can also be configured for the component type:
<ComponentType>.<PropertyName> = <PropertyValue>
. These properties are used as default values in case a specific instance
does not have a particular property. An exception is the implementing class
of a declared component instance. This must always be declared per instance.
If no instances are declared for a component type, the so called
"anonymous instance" is implicitly declared. This instance always
exists - except its instantiation mode is set to
InstantiationMode.OFF. The configuration of the anonymous
instance corresponds to the component type and its simple name equals the
corresponding type name.
Any declared instance can refuse to be instantiated, instantiated once or
multiple times. In case instantiation is set to off, an exception will be
thrown when requesting the corresponding component instance. Singleton
instances exist only once and are therefore cached internally. If the
instantiation mode is not set for a specific instance, the instantiation mode
of the corresponding anonymous instance will be used. If this is also not
set, singleton will be used.
There are some components that do not allow to configure their instantiation
mode. This includes registries which are always singletons and execution
environments of which always multiple instances are allowed.
Component instances may be retrieved by providing the name of the instance -
unique with respect to the root configuration. If the component instance is
to be a singleton and is already instantiated, the existing instance will be
returned. When instantiating a component, its constructor is provided at
least the configuration (
org.apache.commons.configuration2.Configuration) for the
particular instance. The instance has to provide an appropriate constructor!
One may also provide additional parameters as well as a class loader.
The instantiation of a component instance is done with a lock to prevent
concurrent instantiations. Otherwise it would be possible to retrieve
different component instances declared as singleton. The lock implies that
the constructor of a component instance must access the registry. This may
lead to a deadlock.
Component instances need not be instantiated by the registry, they may also
be provided by the configuration of the registry. Just provide the
corresponding instance for
ConfigurationConstants.PROPERTY_REGISTRY_IMPLEMENTATION instead of
the classname. Such an injected component instance is checked for its
appropriate interfaces. It is per se singleton. It may have an initialisation
method . If this
method is present and has the appropriate parameters, it will be called when
the component instance is requested. That is, the method is called for
injected objects instead of the constructor of methods created by the
registry (components that provide a class name instead of a component
instance). Therefore the initialisation method needs to have the same
parameters as the constructor.
The configurations of all injected objects to be initialised by the registry
will be validated.
At construction time, the abstract registry reads all interfaces of all
managed component types from its configuration. This allows for later
checking whether a requested component implementation does fulfil the needs.
The corresponding interfaces are declared by:
Components.<ComponentType> = <InterfaceOrClass>.
Additionally important information concerning a component instance is also
read. This includes the name, the type and the instantiation mode (note: the
implementing class of a component has to be specified explicitly). If the
instantiation mode is not configured, the configuration of the anonymous
instance will be used.
Registries are treated just like ordinary components, except that they are
always singleton and there must not be any instances declared. Therefore only
the anonymous instance exists - having the name of the type (the anonymous
instance). This implies, that each must have its own configuration file to
prevent collisions of property names and they must have a public constructor
with at least their configuration and the corresponding parent registry.
Subclasses of the abstract registry need to provide their configuration to
the constructor of this class which handles the management of component
interfaces and instance configurations as described above.
Registries are also ADEPT2Services which means they support the
normal service lifecycle. This allows to initialise and shut down registries.
Therefore the initial registry, called bootstrap-registry, has to support
services and is a subclass of LocalServiceRegistry.
One important issue is the difference in the lifecycle. Since registries may
be accessed when starting services, they must be fully available after
init(URI[], URI[]). Otherwise a may try to start a service which in turn
needs to access the same registry but already started. This implies that
subclasses notify waiting threads at the beginning of
their own AbstractADEPT2Service.start().
When shutting down, every registry can decide on how long it allows access.
To prevent access shutdown(boolean) has to
be called. After that all access (except by privileged threads) is forbidden.
This class provides access to the initial registry, called bootstrap-registry. The bootstrap-registry extends an abstract registry to include at least configurations for (sub-)registries needed for ADEPT2, which are:
ConfigurationConstants.PREFIX_PROPERTY_REGISTRY_TYPES )ConfigurationConstants.PREFIX_PROPERTY_REGISTRY_INSTANCES)ConfigurationConstants.PROPERTY_REGISTRY_INSTANTIATION_MODE)ConfigurationConstants.PROPERTY_REGISTRY_IMPLEMENTATION)| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractRegistry.DefaultNameResolution
Default implementation for resolving service name and component types.
|
static class |
AbstractRegistry.InstanceInformation
InstanceInformation encapsulates the properties from the
configuration relevant for a component instance. |
static class |
AbstractRegistry.InstantiationMode
The instantiation modes an instance may have.
|
AbstractADEPT2Service.ActiveSessions| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Class<?>> |
componentInterfaces
Interfaces (and classes) of all components managed by this registry.
|
protected UrlConfigurationManager |
configurationManager
The configuration-manager used for this registry.
|
protected java.util.Map<java.lang.String,AbstractRegistry.InstanceInformation> |
declaredInstances
All hierarchical instance names (with anonymous instances) declared for the
underlying configuration.
|
static java.lang.String |
INIT_INSTANTIATED_OBJECT_METHOD
The name of the method that is called to initialise instantiated (injected)
objects.
|
protected NameResolution |
nameResolution
The implementation for resolving service name and component types.
|
protected java.util.Map<java.lang.ClassLoader,java.util.Map<java.lang.String,java.lang.Object>> |
singletonInstances
All singleton instances of all managed components.
|
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_USERNAMECONF_CSV_LOGGING, configuration, logger, registry, runtimeRequiredServices, startupRequiredServices| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRegistry(UrlConfigurationManager confMgr,
Configuration configuration,
Registry registry)
Constructs a new registry by setting the parent registry, the configuration
and the initial configuration manager.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkAndStoreProvidedObject(java.lang.String instanceName,
AbstractRegistry.InstanceInformation instInf)
Checks whether the designated instance that is provided as object via
injection corresponds to its declared component interface and if so, stores
it for the classloader of this class in the singleton instances.
|
protected static Configuration |
checkConfiguration(Configuration configuration,
java.lang.String instanceName,
java.lang.Class<?> implementationClass)
Check the configuration description of the implementation class and whether
the configuration contains the necessary values.
|
protected void |
checkImplementingClass(java.lang.String instanceName,
java.lang.String implementingClassName)
Checks whether the implementing class has the right interface.
|
protected void |
checkSupertype(java.lang.String instanceName,
java.lang.Class<?> superType,
java.lang.Class<?> subType)
Checks, if the given
subType is an assignable form of
superType. |
protected <T> T |
createInstanceForInterface(java.lang.Class<? extends T> implClass,
java.lang.Class<T> compIface,
java.lang.Class<?>[] paramTypes,
java.lang.Object[] paramValues)
Creates an new instance of the designated class having the designated
component interface or super class.
|
protected MethodWrapper |
getAppropriateMethod(MethodWrapper[] methods,
java.lang.Class<?>[] parameterTypes)
Looks for an appropriate method (or constructor) accepting the designated parameter types (or
the corresponding supertypes) in the designated class.
|
protected <T> T |
getArbitrarilyNamedObject(java.lang.String instName,
Configuration instConf,
java.lang.Class<T> componentType,
java.lang.ClassLoader classLoader,
java.lang.Class<?>[] parameterTypes,
java.lang.Object[] parameterValues,
AbstractRegistry.InstantiationMode instantiationMode)
Gets an arbitrary object for the designated component instance of the
requested component type.
|
java.lang.String |
getComponentType(java.lang.String instanceName)
Returns the name of the component type of the designated component
instance as used in configuration files.
|
java.lang.String |
getFormattedSignature(java.lang.Class<?>[] parameterTypes)
Helper method for getting a string describing the parameter types as method
signature for use in log messages and exceptions.
|
java.lang.String |
getHierarchicalInstanceName(java.lang.String componentType,
java.lang.String simpleName)
Returns a hierarchical instance name containing the component type as well
as the instance name.
|
protected AbstractRegistry.InstanceInformation |
getInstanceInformation(java.lang.String instanceName)
Returns the information (component type, instantiation mode and
implementation class) for the designated component instance.
|
protected AbstractRegistry.InstantiationMode |
getInstantiationMode(java.lang.String componentType,
java.lang.String simpleInstanceName,
Configuration registryConfiguration)
Returns the instantiation mode for the designated component instance as
specified in the corresponding configuration.
|
java.lang.Class<?> |
getInterfaceForComponentType(java.lang.String componentType)
Returns the class object of the corresponding interface / superclass, if
the component type is declared.
|
protected <T> T |
getObjectForInstanceName(java.lang.String instanceName,
java.lang.Class<T> componentType)
Gets an object for the designated instance name of the requested component
type and retrieves the instantiation mode from the corresponding
configuration.
|
protected <T> T |
getObjectForInstanceName(java.lang.String instanceName,
java.lang.Class<T> componentType,
java.lang.Class<?>[] addParameterTypes,
java.lang.Object[] addParameterValues)
Gets an object for the designated instance name of the requested component
type and retrieves the instantiation mode from the corresponding
configuration.
|
protected <T> T |
getObjectForInstanceName(java.lang.String instanceName,
java.lang.Class<T> componentType,
java.lang.Class<?>[] addParameterTypes,
java.lang.Object[] addParameterValues,
AbstractRegistry.InstantiationMode instantiationMode)
Gets an object for the designated instance name of the requested component
type using the designated instantiation mode from the corresponding
configuration.
|
java.lang.String |
getSimpleInstanceName(java.lang.String instanceName)
Returns the simple name of the designated component instance as used in
configuration files.
|
void |
init(java.net.URI[] localExportedUris,
java.net.URI[] globalExportedUris)
Initialises a new registry by setting the configuration manager to the
ADEPT2-configuration.
|
protected void |
initialiseInstantiatedObject(java.lang.Object instance,
java.lang.String compIface,
java.lang.Class<?>[] paramTypes,
java.lang.Object[] paramValues)
Initialises the designated instance having the designated component
interface or super class.
|
protected abstract void |
readMetaConfiguration(Configuration registryConfiguration,
java.lang.String componentType)
Reads the available meta-configuration for components loaded at runtime.
|
protected void |
readMetaConfiguration(Configuration registryConfiguration,
java.lang.String componentType,
java.lang.String simpleInstanceName)
Reads the meta-configuration (implementing class, instantiation mode,...)
|
protected void |
renewConfiguration(Configuration conf)
Renews the configuration of this registry by creating a new configuration
manager.
|
void |
shutdown(boolean emergency)
Signals the shutdown of this registry.
|
_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, startpublic static final java.lang.String INIT_INSTANTIATED_OBJECT_METHOD
protected final NameResolution nameResolution
protected UrlConfigurationManager configurationManager
protected java.util.Map<java.lang.String,java.lang.Class<?>> componentInterfaces
Class which is the interface or the superclass of the
component type.protected java.util.Map<java.lang.String,AbstractRegistry.InstanceInformation> declaredInstances
protected java.util.Map<java.lang.ClassLoader,java.util.Map<java.lang.String,java.lang.Object>> singletonInstances
protected AbstractRegistry(UrlConfigurationManager confMgr, Configuration configuration, Registry registry) throws ConfigurationException
confMgr - The initial configuration manager that provides
configurations for the loaded component instances.configuration - The configuration of the created registry instance.registry - The parent registry of this registry.ConfigurationException - If the password cannot be parsed from the
configuration, a ConfigurationException will be
thrown.public void init(java.net.URI[] localExportedUris,
java.net.URI[] globalExportedUris)
throws AbortServiceException
Components.<ComponentType> = <ClassOrInterfaceName>Instances.<ComponentType> = <DeclaredInstances><InstanceName>.InstantiationMode<InstanceName>.ImplementationThis method should be called at the beginning of overriding methods.
Registries must not start or initialise the own managed services while
it is initialised itself! The initialised services may access the
registry which in turn is not correctly started itself. This is prevented
by locks and therefore might cause deadlocks.
To allow registries to initialise and start other services, a registry
is considered started after returning from its own init(URI[], URI[]).
init in interface ADEPT2Serviceinit in class AbstractAuthenticatedServicelocalExportedUris - The URIs with which this service is exported
locally or a local URI or an empty array for internal services.globalExportedUris - The URIs with which this service is published
globally or null in case the service is not
published.PropertyNotSetException - If a mandatory property is not set, a
PropertyNotSetException will be thrown.AbortServiceException - If the registry configuration contains an
entry for a managed component but it is not configured properly,
a ConfigurationExceptionwill be thrown.public void shutdown(boolean emergency)
This method has to be called at an arbitrary time in the shutdown-procedure of overriding classes.
shutdown in interface ADEPT2Serviceshutdown in class AbstractAuthenticatedServiceemergency - Whether the shutdown will be an emergency shutdown.protected void renewConfiguration(Configuration conf) throws ConfigurationException
conf - The (new) root configuration for this registry.ConfigurationException - If
PropertyNotSetException),ConfigurationException will be thrown.protected abstract void readMetaConfiguration(Configuration registryConfiguration, java.lang.String componentType) throws ConfigurationException
readMetaConfiguration(Configuration, String, String) has to be
done when loading the corresponding components. registryConfiguration - The configuration which contains the
(registry) information for runtime instances of the designated
component type.componentType - The type of the component to retrieve the
meta-configuration.ConfigurationException - If some of the required information is
missing, for instance, the classpath for loading the components
at runtime is not specified, a
ConfigurationException will be thrown.protected void readMetaConfiguration(Configuration registryConfiguration, java.lang.String componentType, java.lang.String simpleInstanceName) throws ConfigurationException
registryConfiguration - The configuration which contains the
(registry) information for the designated instance.componentType - The type of the component to retrieve the
meta-configuration.simpleInstanceName - The simple name of the component instance as
declared in the configuration.ConfigurationException - If no implementing class name is defined for
the designated instance or the instance is injected as object but
it is not declared as singleton or it does not correspond to its
declared component type, a ConfigurationException
will be thrown.protected void checkSupertype(java.lang.String instanceName,
java.lang.Class<?> superType,
java.lang.Class<?> subType)
throws ConfigurationException
subType is an assignable form of
superType. Throws an exception if not.instanceName - The hierarchical instance name of the component.superType - The super type (interface or super class).subType - The sub-type.ConfigurationException - If the subType is not an
assignable form of superType, a
ConfigurationException will be thrown.protected static Configuration checkConfiguration(Configuration configuration, java.lang.String instanceName, java.lang.Class<?> implementationClass) throws ConfigurationException
This method is called during the initialisation of the configuration,
readMetaConfiguration(Configuration, String, String).
The method is intended to be overridden by subclasses, for bypassing or extending the checks.
configuration - The configuration for the designated instance.instanceName - The hierarchical instance name.implementationClass - The implementation class for the designated
instance or null.ConfigurationException - If the designated configuration does not
provide the necessary configuration values for the designated
instance of the designated implementation class, a
ConfigurationException will be thrown.protected void checkImplementingClass(java.lang.String instanceName,
java.lang.String implementingClassName)
throws ConfigurationException
createInstanceForInterface(Class, Class, Class[], Object[])). The
desired class loader may have another class path which prevents the class
from being found and checked here. In this case the configuration of the
class will not be checked until really loaded by the desired class loader
just before creation.instanceName - The hierarchical instance name.implementingClassName - The name of the implementing class.ConfigurationException - If the designated component type is not
configured for this registry or the designated implementing class
is not a subtype of the registered component interface, a
ConfigurationException will be thrown.protected void checkAndStoreProvidedObject(java.lang.String instanceName,
AbstractRegistry.InstanceInformation instInf)
throws ConfigurationException
instanceName - The hierarchical instance name of the component.instInf - The instance information for the instance.ConfigurationException - If the declared component interface does not
correspond to the provided (injected) object instance, a
ConfigurationException will be thrown.protected AbstractRegistry.InstantiationMode getInstantiationMode(java.lang.String componentType, java.lang.String simpleInstanceName, Configuration registryConfiguration)
InstantiationMode.SINGLETON will be returned.
componentType - The type of the component to retrieve the
meta-configuration.simpleInstanceName - The simple name of the component instance as
declared in the configuration.registryConfiguration - The configuration which contains the declaration of
the instantiation mode.InstantiationMode.SINGLETON.public java.lang.String getHierarchicalInstanceName(java.lang.String componentType,
java.lang.String simpleName)
NameResolution/ProcessManager/PM1.getHierarchicalInstanceName in interface NameResolutioncomponentType - The type of the component to create the hierarchical
name for.simpleName - The simple name of the component instance as defined in
the configuration.public java.lang.String getSimpleInstanceName(java.lang.String instanceName)
NameResolutiongetSimpleInstanceName in interface NameResolutioninstanceName - The hierarchical name of a component instance.public java.lang.String getFormattedSignature(java.lang.Class<?>[] parameterTypes)
NameResolutiongetFormattedSignature in interface NameResolutionparameterTypes - All the parameter types of a method as instances of
Class.public java.lang.String getComponentType(java.lang.String instanceName)
NameResolutiongetComponentType in interface NameResolutioninstanceName - The hierarchical name of a component instance.protected AbstractRegistry.InstanceInformation getInstanceInformation(java.lang.String instanceName) throws ConfigurationException
instanceName - The hierarchical name of the component instance for
which to retrieve its information.ConfigurationException - If the designated instance is not configured
properly, that is, it is not declared, a
ConfigurationException will be thrown.protected <T> T getObjectForInstanceName(java.lang.String instanceName,
java.lang.Class<T> componentType)
throws ConfigurationException
T - The type which the requested object is expected to be of which
is either the registered component type or a super type hereof.instanceName - The hierarchical name of the component instance to
retrieve. This may neither be null nor the empty string.componentType - 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
componentInterfaces), getInstanceInformation(String)),
getInstanceInformation(String)),
createInstanceForInterface(Class, Class, Class[], Object[])),
ConfigurationException will be thrown.protected <T> T getObjectForInstanceName(java.lang.String instanceName,
java.lang.Class<T> componentType,
java.lang.Class<?>[] addParameterTypes,
java.lang.Object[] addParameterValues)
throws ConfigurationException
Configuration)
will be used. The same class loader as for this class 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.instanceName - The hierarchical name of the component instance to
retrieve. This may neither be null nor the empty string.componentType - The type of which the requested object is expected to
be. This is either the registered component type interface or a
super type hereof.addParameterTypes - Additional parameter types (besides
Configuration) of the constructor to be used for
instantiation. If no additional parameter is to be used, an empty
array needs to be provided. This has to correspond to
additionalParameterValues.addParameterValues - Additional parameter (besides the configuration)
of the constructor to be used for instantiation. If no additional
parameter is to be used, an empty array needs to be provided. This
has to correspond to additionalParameterTypes.ConfigurationException - If
componentInterfaces),getInstanceInformation(String)),getInstanceInformation(String)),createInstanceForInterface(Class, Class, Class[], Object[])),ConfigurationException will be thrown.protected <T> T getObjectForInstanceName(java.lang.String instanceName,
java.lang.Class<T> componentType,
java.lang.Class<?>[] addParameterTypes,
java.lang.Object[] addParameterValues,
AbstractRegistry.InstantiationMode instantiationMode)
throws ConfigurationException
Configuration)
will be used. The same class loader as for this class 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.instanceName - The hierarchical name of the component instance to
retrieve. This may neither be null nor the empty string.componentType - The type of which the requested object is expected to
be. This is either the registered component type interface or a
super type hereof.addParameterTypes - Additional parameter types (besides
Configuration) of the constructor to be used for
instantiation. If no additional parameter is to be used, an empty
array needs to be provided. This has to correspond to
additionalParameterValues.addParameterValues - Additional parameter (besides the configuration)
of the constructor to be used for instantiation. If no additional
parameter is to be used, an empty array needs to be provided. This
has to correspond to additionalParameterTypes.instantiationMode - Whether the designated component instance may be
instantiated never, once or multiple.ConfigurationException - If
componentInterfaces),getInstanceInformation(String)),getInstanceInformation(String)),createInstanceForInterface(Class, Class, Class[], Object[])
),ConfigurationException will be thrown.protected <T> T getArbitrarilyNamedObject(java.lang.String instName,
Configuration instConf,
java.lang.Class<T> componentType,
java.lang.ClassLoader classLoader,
java.lang.Class<?>[] parameterTypes,
java.lang.Object[] parameterValues,
AbstractRegistry.InstantiationMode instantiationMode)
throws ConfigurationException
createInstanceForInterface(Class, Class, Class[], Object[]) while
having the write lock.T - The type which the requested object is expected to be of which
is either the registered component type or a super type hereof.instName - The hierarchical name of the component instance to
retrieve. This may neither be null nor the empty string.instConf - The configuration of the component instance to check for
whether all configuration values are present.componentType - The type of which the requested object is expected to
be. This is either the registered component type interface or a
super type hereof.classLoader - The class loader to use for a new instance.parameterTypes - Parameter types of the constructor to be used for
instantiation. This has to correspond to
parameterValues.parameterValues - The parameter of the constructor to be used for
instantiation. This has to correspond to
parameterTypes.instantiationMode - Whether the designated component instance may be
instantiated never, once or multiple.ConfigurationException - If
componentInterfaces),getInstanceInformation(String)),getInstanceInformation(String)),createInstanceForInterface(Class, Class, Class[], Object[])
),ConfigurationException will be thrown.protected final <T> T createInstanceForInterface(java.lang.Class<? extends T> implClass,
java.lang.Class<T> compIface,
java.lang.Class<?>[] paramTypes,
java.lang.Object[] paramValues)
throws ConfigurationException
ConfigurationException will be thrown. T - The requested type of the object - a super type of the
registered component type.implClass - The class which implements or extends the designated
interfaces.compIface - The interface of the component type of the requested
instance.paramTypes - Parameter types for the constructor to be called. This
has to correspond to paramValues.paramValues - Parameter values for the constructor to be called. This
has to correspond to paramTypes.java.lang.AssertionError - If assertions are enabled and the length of the
designated parameter type array differs from the designated
parameter value array, an AssertionError will be
thrown.ConfigurationException - If
ConfigurationException will be thrown,
encapsulating the actual exception if appropriate.protected final void initialiseInstantiatedObject(java.lang.Object instance,
java.lang.String compIface,
java.lang.Class<?>[] paramTypes,
java.lang.Object[] paramValues)
throws ConfigurationException
ConfigurationException will be thrown.
Contrary to
createInstanceForInterface(Class, Class, Class[], Object[]) this
method does not thrown an exception but just logs them. Initialisation is
not required (contrary to object construction).
instance - The object instance which to initialise.compIface - The interface of the component type of the instance.paramTypes - Parameter types for the initialisation method to be
called. This has to correspond to paramValues.paramValues - Parameter values for the initialisation method to be
called. This has to correspond to paramTypes.ConfigurationException - If a method with the right signature (name and parameter types)
exists but it fails to be called, an ConfigurationException will be
thrown.java.lang.AssertionError - If assertions are enabled and the length of the
designated parameter type array differs from the designated
parameter value array, an AssertionError will be
thrown.public java.lang.Class<?> getInterfaceForComponentType(java.lang.String componentType)
throws ConfigurationException
ConfigurationException. This method must not to be called
by clients; it is only for the registry and the communication framework.componentType - The name of the component type of which to retrieve
the configured interface.ConfigurationException - If the designated component type is not
configured for this registry, a
ConfigurationException will be thrown.protected MethodWrapper getAppropriateMethod(MethodWrapper[] methods, java.lang.Class<?>[] parameterTypes)
null will be returned.methods - The methods to get an appropriate method of.parameterTypes - The types of the method parametersnull in case
no constructor of the class is appropriate.