!--a11y-->
Life Cycle 
The life cycle mechanism comes into action when a portal application, SAP J2EE Application, library, interface or service starts or stops. When one of these starts, a check is performed if the referenced items exist. Referenced portal and SAP J2EE Applications are also started and SAP J2EE Libraries and interfaces are loaded at this point in time. SAP J2EE Services are not started. If the referenced item does not exist or if it cannot be started (except for SAP J2EE Services), an exception is thrown.
Two states can be distinguished for the life cycle. For example:
Portal application A1 uses SAP J2EE Application E1 and Service S1, thus:
A1 -> E1, S1
The two states which can be distinguished are:
...
1. A1 starts
2. A1 uses E1 and S1A1 starts
With respect to the life cycle, everything happens at state 1, that is, when A1 starts. At this point in time it is checked whether E1 and S1 are available or loaded. E1 is also started if it is not yet running. Note that the state of S1, either stopped or stated, is not changed. For the two states, this means there is no life cycle functionality in state 2. This applies to the use of a SAP J2EE application, library or service in a portal application.
However, for the use of a portal application in a SAP J2EE application, there is a difference between state 1 and 2. Here is another example:
SAP J2EE Application E2 uses portal service S1 contained in portal application A2, thus:
E2 -> A2
Now the two states are:
...
1. E2 starts
2. E2 uses A2.S1
In this case, when E2 starts, portal application A2 is loaded but the portal service S1 is not yet started. S1 is started when it is actually accessed in the JNDI lookup during step 2. In that sense, the load-on-demand functionality of the PRT is used when a portal application is used in a SAP J2EE application.
It is also ensured that if a portal application, SAP J2EE application or library or interface becomes inactive, all applications, libraries and services that use it are stopped too.
This life cycle mechanism applies to both use cases:
· Use a SAP J2EE Application or interface library in a portal application
· Use a portal application in a SAP J2EE Application
Note that if a SAP J2EE Service stops, the portal applications using this service are not stopped. In the second case, 'Use a portal application in a SAP J2EE Application', SAP J2EE provides different types of references: strong and weak. The mechanism described here does not make any difference if the reference is weak or strong.
Here is an overview of the actions taken when an item that references another items is started or stopped. Items on the left-hand side show items that use items on the right-hand side in the table. A box that is underlined in gray means that this reference type does not exist, or is not treated by the mechanism described here:
· During start:
Startup refers to the startup of the item in the left column. Usage means the item in the left column uses the item in the right column
/ |
Portal Application |
SAP J2EE Application |
SAP J2EE Service |
SAP J2EE Library |
Portal Application |
Reference type not treated by this mechanism |
Startup: check if SAP J2EE Application exists; SAP J2EE Application is loaded and started usage: no action |
Startup: check if SAP J2EE Service exists; state of the SAP J2EE Service is not changed usage: no action |
Startup: check if SAP J2EE library exists; SAP J2EE library is loaded usage: no action |
SAP J2EE Application |
Startup: check if portal application exists; portal application is loaded usage: used portal Service is initialized |
Reference type not treated by this mechanism |
Reference type not treated by this mechanism |
Reference type not treated by this mechanism |
SAP J2EE Service |
Reference type not existing |
Reference type not existing |
Reference type not treated by this mechanism |
Reference type not treated by this mechanism |
SAP J2EE Library |
Reference type not existing |
Reference type not existing |
Reference type not treated by this mechanism |
Reference: type not treated by this mechanism |
· During stop:
Stop means the item in the right column stops.
/ |
Portal Application |
SAP J2EE Application |
SAP J2EE Service |
SAP J2EE Library |
Portal Application |
Reference type not treated by this mechanism |
Stop: portal application is released |
Stop: no action |
Stop: portal application is released |
SAP J2EE Application |
Stop: SAP J2EE application is released |
Reference type not treated by this mechanism |
Reference type not treated by this mechanism |
Reference type not treated by this mechanism |
SAP J2EE Service |
Reference type not existing |
Reference type not existing |
Reference: type not treated by this mechanism |
Reference type not treated by this mechanism |
SAP J2EE Library |
Reference type not existing |
Reference: type not existing |
Reference type not treated by this mechanism |
Reference: type not treated by this mechanism |
