10-6 Developing Applications for Oracle WebLogic Server
Application version life cycle events are invoked:
■
For both static and dynamic deployments.
■
Using either anonymous ID or using user identity.
■
Only if the current application is versioned; otherwise, version life cycle events are ignored.
■
for all application versions, including the version that registers the listener. Use the ApplicationVersionLifecycleEvent.isOwnVersion method to determine
if an event belongs to a particular version. See the ApplicationVersionLifecycleEvent class for more information on types of
version life cycle events.
10.6.2 Types of Application Version Life Cycle Events
Four application version life cycle events are provided with WebLogic Server:
■
public void preDeployApplicationVersionLifecycleEvent evt
– The preDeloy event is invoked when an application version deploy or
redeploy operation is initiated.
■
public void postDeployApplicationVersionLifecycleEvent evt
– The postDeloy event is invoked when an application version is deployed or
redeployed successfully.
■
public void preUndeployApplicationVersionLifecycleEvent evt
– The preUndeloy event is invoked when an application version undeploy
operation is initiated.
■
public void postDeleteApplicationVersionLifecycleEvent evt
– The postDelete event is invoked when an application version is deleted.
10.6.3 Example of Production Deployment Sequence When Using Application Version Life Cycle Events
The following table provides an example of a deployment V1, production redeployment V2, and an undeploy V2.
Note: A postDelete event is only fired after the entire application
version is completely removed. It does not include a partial undeploy, such as undeploying a module or from a subset of targets.
Table 10–1 Sequence of Deployment Actions and Application Version Life Cycle Events
Deployment action Time
Version V1 Version V2
Deployment of Version V1 T0 preDeployV1 invoked.
T1 Deployment starts.
T2 Application life cycle listeners for V1
are registered. T3
V1 is active version, Deployment is complete.
T4 postDeployV1 invoked.
Programming Application Life Cycle Events 10-7
T5 Application Listeners gets
postDeployV1. Production Redeployment
of Version V2 T6
preDeployV2 invoked. T7
Application version listener receives preDeployV1.
T8 Deployment starts.
T9 Application life cycle listeners for V2
are registered. T10
If deployV2 succeeds, V1 ceases to be active version.
If deployV2 succeeds, V2 replaces V1 as active version.
Deployment is complete. T11
postDeployV2 invoked.
Note:
This event occurs even if the deployment fails.
T12 Application version listener gets
postDeployV2. If deployV2 fails, V1 remains active.
T13 Application listeners gets
postDeployV2. T14
If deployV2 succeeds, V1 begins retirement.
T15 Application listeners for V1 are
unregistered. T16
V1 is retired. Undeployment of V2
T17 preUndeployv2 invoked.
T18 Application listeners gets
preUndeployv2 invoked. T19
Undeployment begins. T20
V2 is no longer active version. T21
Application version listeners for V2 are unregistered.
T22 Undeployment is complete.
T23 If the entire application is
undeployed, postDeleteV2 is invoked.
Note:
This event occurs even if the undeployment fails.
Table 10–1 Cont. Sequence of Deployment Actions and Application Version Life Cycle Events
Deployment action Time
Version V1 Version V2
10-8 Developing Applications for Oracle WebLogic Server
11
Programming Context Propagation 11-1
11
Programming Context Propagation
The following sections describe how to use the context propagation APIs in your applications:
■
Section 11.1, Understanding Context Propagation