Life Cycle Events
The ActiveMatrix runtime exposes component life cycle events—Init and Destroy—to component implementations.
Methods annotated with @Init and @Destroy are invoked when the life cycle events trigger.
Life Cycle Events describes the meaning of each event and how component implementations can handle each event.
Event | When Invoked |
---|---|
Init | When the application containing the component or the component is started.
When this event is triggered all the component's properties, references, and resources have been initialized. The method invoked when this event is triggered is typically used to validate component configuration and open connection to resources. |
Destroy | When the application containing the component or the component is stopped. |
When TIBCO Business Studio generates a Java or Spring component implementation, it automatically adds the appropriately annotated initialization and destruction methods:
org.osoa.sca.annotations.Init;
org.osoa.sca.annotations.Destroy;
@Init
public void init()
{
// Component initialization code.
// All properties are initialized and references are injected.
}
@Destroy
public void destroy()
{
// Component disposal code.
// All properties are disposed.
}
You can customize these methods to perform application-specific initialization and cleanup.
Copyright © Cloud Software Group, Inc. All rights reserved.