Interface ComponentInstancePostConstruction
-
public interface ComponentInstancePostConstruction
It is a process implied within the manufacturing of a new component instance in Silverpeas. Usually such process is about allocating some specific resources for the component instance being created. When an application component is instantiated, it is first created and then registered into Silverpeas. In some circumstances, according to the application, some actions have to be performed in the behalf of the new application instance. The application instantiation is unaware of these circumstances and it cannot know what actions to perform; It is the responsibility of the application to perform such actions. This is why an implementation of this interface qualified by a name that satisfies the following convention[COMPONENT NAME]InstancePostConstruction
is looked for by the instantiation process and then invoked if it is has been found. Any application that requires specific actions when a new application component is instantiated has to implement this interface and the implementation has to be qualified with the @Named annotation by a name satisfying the following convention[COMPONENT NAME]InstancePostConstruction
. For example, for an application Kmelia, the implementation must be qualified with@Named("kmeliaInstancePostConstruction")
- Author:
- mmoquillon
-
-
Field Summary
Fields Modifier and Type Field Description static String
NAME_SUFFIX
The predefined suffix that must compound the name of each implementation of this interface.static String
WORKFLOW_POST_CONSTRUCTION
Each workflow is an application but all of them uses the same post construction process.
So, when the name of a workflow component is detected, the post constructor implementation retrieved will be the one named like this constant value.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Optional<ComponentInstancePostConstruction>
get(String constructionName)
Gets the implementation of this interface with the specified qualified name.void
postConstruct(String componentInstanceId)
Performs post construction tasks in the behalf of the specified component instance.
-
-
-
Field Detail
-
NAME_SUFFIX
static final String NAME_SUFFIX
The predefined suffix that must compound the name of each implementation of this interface. An implementation of this interface by a Silverpeas application named Kmelia must be namedkmelia[NAME_SUFFIX]
where NAME_SUFFIX is the predefined suffix as defined below.- See Also:
- Constant Field Values
-
WORKFLOW_POST_CONSTRUCTION
static final String WORKFLOW_POST_CONSTRUCTION
Each workflow is an application but all of them uses the same post construction process.
So, when the name of a workflow component is detected, the post constructor implementation retrieved will be the one named like this constant value.- See Also:
- Constant Field Values
-
-
Method Detail
-
get
static Optional<ComponentInstancePostConstruction> get(String constructionName)
Gets the implementation of this interface with the specified qualified name.- Parameters:
constructionName
- the qualified name of the implementation as specified by a@Named
annotation.- Returns:
- either an implementation of this interface or nothing.
-
postConstruct
void postConstruct(String componentInstanceId)
Performs post construction tasks in the behalf of the specified component instance.- Parameters:
componentInstanceId
- the unique identifier of the component instance.
-
-