Initialization
When an 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 Arbortext PE 子进程 started. If so, the Arbortext PE 应用程序 Context loads the Java class into the Arbortext PE 子进程's embedded Java Virtual Machine. In order for this to happen, the 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 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 Arbortext PE 子进程 pool, both defined in e3config.xml.
If initialization succeeds and the init method returns normally, then the 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 Arbortext PE 应用程序 Context will return an error to the Arbortext PE Request Manager.
If a Java Arbortext PE 应用程序 initializes successfully, the Arbortext PE 应用程序Context will retain a reference to the application object. If the Arbortext PE Request Manager sends another request for the same application, the Arbortext PE 应用程序 Context will again invoke the doGet or doPost method. The 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 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 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.