Class AbstractRegistry.InstanceInformation
java.lang.Object
de.aristaflow.adept2.base.registry.AbstractRegistry.InstanceInformation
- Direct Known Subclasses:
ServiceInformation
- Enclosing class:
- AbstractRegistry
InstanceInformation encapsulates the properties from the
configuration relevant for a component instance. Per component instance a
3-tuple is stored: component type, instantiation mode and implementation
class or implementation object. This class realises the triple (one of the
four fields being null.
Subclasses of the registry may extend this class, and override
- Author:
- Ulrich Kreher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringThe type of the component instance, that is the type name in the configuration.protected final ObjectThe object used as implementation for the instance.protected final StringThe class (full name) which is used as implementation for the instance.protected booleanWhether the provided implementation been initialised.protected final AbstractRegistry.InstantiationModeHow many instances of the instance may exist (0, 1, many). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstanceInformation(String componentType, AbstractRegistry.InstantiationMode instantiationMode, String implementationClass) Creates a new 3-tuple with the configured component instance properties for an instance specified via its implementation class.protectedInstanceInformation(String componentType, Object implementation) Creates a new 3-tuple with the configured component instance properties for an instance specified via an injected implementation. -
Method Summary
Modifier and TypeMethodDescriptionGets the class (full name) which is used as implementation for the instance.voidSets this provided (injected) instance as initialised.booleanWhether this instance is provided (injected) as object and has not been initialised yet.booleanGets whether this instance is provided (injected) as object and therefore need not be created by the registry.
-
Field Details
-
componentType
The type of the component instance, that is the type name in the configuration. -
instantiationMode
How many instances of the instance may exist (0, 1, many). -
implementationClass
The class (full name) which is used as implementation for the instance. It is assured that this class implements the corresponding component type interface. This will benullin case the implementation is provided directly (injected into the configuration). -
implementation
The object used as implementation for the instance. This is usually provided via the configuration by injecting it there as implementation. It is assured that this object implements the corresponding component type interface. This will benullin case no object is provided but the corresponding implementation class. -
implInitialised
protected boolean implInitialisedWhether the provided implementation been initialised. Initialisation is used similar to the constructor of an instance provided by its class name.
-
-
Constructor Details
-
InstanceInformation
protected InstanceInformation(String componentType, AbstractRegistry.InstantiationMode instantiationMode, String implementationClass) Creates a new 3-tuple with the configured component instance properties for an instance specified via its implementation class.- Parameters:
componentType- The type of the component instance as specified in the configuration.instantiationMode- The configured instantiation mode of the corresponding component instance.implementationClass- The implementation (class name) to use for the component instance which conforms to the corresponding component type interface.
-
InstanceInformation
Creates a new 3-tuple with the configured component instance properties for an instance specified via an injected implementation. Such an instance is always singleton.- Parameters:
componentType- The type of the component instance as specified in the configuration.implementation- The object to use for the component instance which conforms to the corresponding component type interface.
-
-
Method Details
-
isInstantiated
public boolean isInstantiated()Gets whether this instance is provided (injected) as object and therefore need not be created by the registry.- Returns:
- Whether this instance is provided (injected) as object.
-
getImplementationClass
Gets the class (full name) which is used as implementation for the instance. It is assured that this class implements the corresponding component type interface.- Returns:
- The name of the class of the instance.
-
instantiatedInitRequired
public boolean instantiatedInitRequired()Whether this instance is provided (injected) as object and has not been initialised yet. Initialisation is used similar to the constructor of an instance provided by its class name.- Returns:
- Whether this instance is provided (injected) and has not been initialised yet.
-
instantiatedInitialised
public void instantiatedInitialised()Sets this provided (injected) instance as initialised. Initialisation is used similar to the constructor of an instance provided by its class name.
-