Chapter 6: Advanced Tomcat Features Configuring Lifecycle Listeners
Chapter 6: Advanced Tomcat Features Configuring Lifecycle Listeners Many top-level and nested components in the Tomcat 6 architecture (including Server, Service, Realm, and so on) support the configuration of lifecycle listeners. Lifecycle listeners are Java code modules that can be hooked into the server logic and executed during specific moments during the lifecycle of a component. This capability enables new custom functionality to be introduced to the Tomcat 6 server without having to change the core server code base. With Tomcat 6, the only explicit use of a lifecycle listener is to insert code that enables the server to be managed remotely (through JMX support). Using a simple example, the following section shows how this support code is configured. Lifecycle Events Sent by Tomcat Components Lifecycle listeners are customized code that listens to specific lifecycle events. Lifecycle events are sent by a component, to any configured listener, at well-defined points in a component s lifecycle. These points include the following: . Just before component startup . During component startup . Just after component startup . Just before component stop . During component stop . Just after component stop Developers may use lifecycle listeners to add new processing logic to the Tomcat server. As an administrator, you can add these custom listeners by creating a
For high quality website hosting services please check cheap web hosting website.