Publishing Engine Programmer's Guide > The Arbortext Publishing Engine Request Manager > Customizing the Arbortext PE Request Manager > Writing a Custom Initializer
  
Writing a Custom Initializer
To write an initializer, you need to develop a Java class that implements the interface com.arbortext.e3.E3Initializer. Your Java class must provide the same getId and getStatus methods as described for cache managers. The Java class must also implement an init method that will be called after all other dynamic objects are loaded and initialized, and after the Arbortext PE sub-process pools are initialized. As a result, your init code can obtain an Arbortext PE sub-process and execute ACL commands and evaluate ACL functions. Your init code can also create a simulated Arbortext Publishing Engine request and send the request to a cache manager, queue manager, or request handler for processing. Make sure that your initializer is thread-safe, as it could be running at the same time as any number of client requests.
* 
In addition, an Initializer must also provide a destroy method, which currently will not be called (this is a known problem).
After compiling your Java class, put it in PE_HOME\e3\e3\WEB-INF\classes or place the classes in a JAR file and put the JAR in e3\e3\WEB-INF\lib. Remember to update e3config.xml to add an Initializer element to load it and determine when it should run.
You have the option of making your initializer a blocking or deferred initializer.
If you specify it as a blocking initializer (defer=no), your init method will be called before the Arbortext PE Request Managerinit method returns to the servlet container. That means that the Arbortext PE Request Manager will not start accepting requests from clients until after your initializer completes its operation.
If you specify that your object is a deferred initializer (defer=yes), then the Arbortext PE Request Managerinit method creates a background thread to run your init method (and any other deferred initializers) asynchronously after the Arbortext PE Request Managerinit method returns to the servlet container. That means that the Arbortext PE Request Manager may start accepting client requests before your initializer is called or before it completes its operation and returns.
The drawback to waiting for a blocking initializer to completes before the Arbortext PE Request Manager starts processing client requests is that you could substantially lengthen the time it takes for the Arbortext PE Request Manager to start. This wait time is directly related to the amount of work your initializer performs. The drawback to deferring the initializer is that you must be certain the Arbortext PE Request Manager can properly process requests before your initializer starts or finishes.