Chapter 4: Tomcat Architecture The lifecycleEvent()method takes a
Saturday, February 7th, 2009Chapter 4: Tomcat Architecture The lifecycleEvent()method takes a LifecycleEventobject, which is a wrapper for the event to contain the event type as well as additional payload data that may be associated with the event. For example, let s say you want to receive an e-mail every time the Host starts or shuts down. You can write a listener similar to the following: public MyListener implements LifecycleListener { public void lifecycleEvent(LifecycleEvent event){ if (Lifecycle.START_EVENT.equals(event.getType())){ //Code here to email that a Start Event was received } if (Lifecycle.STOP_EVENT.equals(event.getType())){ //Code here to email that a Stop Event was received } } } The payload data could be used if you were to write your own events that are a part of your own components (engine, host, or context) and fire specialized events of your own. As you can see, the plug-ability of the Tomcat container is extremely powerful as any components that work with the lifecycle interfaces can become an integrated part of the Tomcat infrastructure immediately. Configuration by Architecture Throughout this chapter, you have seen the different components of the Tomcat architecture and the parent-child relationships that they build upon each other. If you understand these relationships, configuring Tomcat is much easier. The most important and critical configuration file in Tomcat is
If you looking for unlimited one inclusive web hosting plan please check web hosting plan website.