Java Code Examples for org.apache.catalina.ContainerEvent#getType()

The following examples show how to use org.apache.catalina.ContainerEvent#getType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ThreadLocalLeakPreventionListener.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
@Override
public void containerEvent(ContainerEvent event) {
    try {
        String type = event.getType();
        if (Container.ADD_CHILD_EVENT.equals(type)) {
            processContainerAddChild(event.getContainer(),
                (Container) event.getData());
        } else if (Container.REMOVE_CHILD_EVENT.equals(type)) {
            processContainerRemoveChild(event.getContainer(),
                (Container) event.getData());
        }
    } catch (Exception e) {
        String msg =
            sm.getString(
                "threadLocalLeakPreventionListener.containerEvent.error",
                event);
        log.error(msg, e);
    }

}
 
Example 2
Source File: ThreadLocalLeakPreventionListener.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
@Override
public void containerEvent(ContainerEvent event) {
    try {
        String type = event.getType();
        if (Container.ADD_CHILD_EVENT.equals(type)) {
            processContainerAddChild(event.getContainer(),
                (Container) event.getData());
        } else if (Container.REMOVE_CHILD_EVENT.equals(type)) {
            processContainerRemoveChild(event.getContainer(),
                (Container) event.getData());
        }
    } catch (Exception e) {
        String msg =
            sm.getString(
                "threadLocalLeakPreventionListener.containerEvent.error",
                event);
        log.error(msg, e);
    }

}
 
Example 3
Source File: ThreadLocalLeakPreventionListener.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
@Override
public void containerEvent(ContainerEvent event) {
    try {
        String type = event.getType();
        if (Container.ADD_CHILD_EVENT.equals(type)) {
            processContainerAddChild(event.getContainer(),
                (Container) event.getData());
        } else if (Container.REMOVE_CHILD_EVENT.equals(type)) {
            processContainerRemoveChild(event.getContainer(),
                (Container) event.getData());
        }
    } catch (Exception e) {
        String msg =
            sm.getString(
                "threadLocalLeakPreventionListener.containerEvent.error",
                event);
        log.error(msg, e);
    }

}