Initialization
When an Applicazione Arbortext PE Context receives a request, it first determines that the request specifies f=java, then examines the class parameter to see if this is the first time the class has been invoked since the Sottoprocesso Arbortext PE started. If so, the Applicazione Arbortext PE Context loads the Java class into the Sottoprocesso Arbortext PE's embedded Java Virtual Machine. In order for this to happen, the Applicazione Arbortext PE class must be present in a custom\classes directory either as a .class file or as a member of a .jar file. After loading the application, the Applicazione Arbortext PE Context calls its init method and passes a parameter specifying an instance of com.arbortext.e3.E3ApplicationConfig, allowing the Arbortext Publishing Engine application to access configuration information from e3config.xml. The configuration parameters include the global parameters plus any other parameters defined for the Sottoprocesso Arbortext PE pool, both defined in e3config.xml.
If initialization succeeds and the init method returns normally, then the Applicazione Arbortext PE Context passes the request to the Java application's doGet or doPost method.
If any error is detected, the init should throw an exception. In that case, the Applicazione Arbortext PE Context will return an error to the Arbortext PE Request Manager.
If a Java Applicazione Arbortext PE initializes successfully, the Applicazione Arbortext PEContext will retain a reference to the application object. If the Arbortext PE Request Manager sends another request for the same application, the Applicazione Arbortext PE Context will again invoke the doGet or doPost method. The Applicazione Arbortext PE Context will not create another instance of the application object, nor will it call the application’s init method again.
If a Java application fails to initialize (meaning its init method throws an exception), the Applicazione Arbortext PE Context will discard the application object. It will not call the object's destroy method. If the Arbortext PE Request Manager sends another request for the same application, the Applicazione Arbortext PE Context will allocate another new object and call its init method. Depending on the condition which caused the first call to throw an exception, this attempt could succeed or throw another exception.
Parent topic