本文整理汇总了Java中org.apache.catalina.ContainerEvent.getType方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerEvent.getType方法的具体用法?Java ContainerEvent.getType怎么用?Java ContainerEvent.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.ContainerEvent
的用法示例。
在下文中一共展示了ContainerEvent.getType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: containerEvent
import org.apache.catalina.ContainerEvent; //导入方法依赖的package包/类
@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);
}
}
示例2: containerEvent
import org.apache.catalina.ContainerEvent; //导入方法依赖的package包/类
/**
* Handle a <code>ContainerEvent</code> from one of the Containers we are
* interested in.
*
* @param event The event that has occurred
*/
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) {
log.error("Exception processing event " + event, e);
}
}
示例3: containerEvent
import org.apache.catalina.ContainerEvent; //导入方法依赖的package包/类
/**
* Handle a <code>ContainerEvent</code> from one of the Containers we are
* interested in.
*
* @param event The event that has occurred
*/
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.ADD_VALVE_EVENT.equals(type)) {
processContainerAddValve(event.getContainer(),
(Valve) event.getData());
} else if (Container.REMOVE_CHILD_EVENT.equals(type)) {
processContainerRemoveChild(event.getContainer(),
(Container) event.getData());
} else if (Container.REMOVE_VALVE_EVENT.equals(type)) {
processContainerRemoveValve(event.getContainer(),
(Valve) event.getData());
}
} catch (Exception e) {
log("Exception processing event " + event, e);
}
}
示例4: containerEvent
import org.apache.catalina.ContainerEvent; //导入方法依赖的package包/类
/**
* Acknowledge the occurrence of the specified event.
*
* @param event ContainerEvent that has occurred
*/
public void containerEvent(ContainerEvent event) {
Container source = (Container) event.getSource();
String type = event.getType();
if (source == engine) {
if (Container.ADD_CHILD_EVENT.equals(type))
addHost((Host) event.getData());
else if (Container.REMOVE_CHILD_EVENT.equals(type))
removeHost((Host) event.getData());
} else if (source instanceof Host) {
if (Host.ADD_ALIAS_EVENT.equals(type))
addAlias((String) event.getData(), (Host) source);
else if (Host.REMOVE_ALIAS_EVENT.equals(type))
removeAlias((String) event.getData());
}
}
示例5: containerEvent
import org.apache.catalina.ContainerEvent; //导入方法依赖的package包/类
public void containerEvent(ContainerEvent event) {
if (event.getType() == Host.ADD_ALIAS_EVENT) {
mapper.addHostAlias(((Host) event.getSource()).getName(),
event.getData().toString());
} else if (event.getType() == Host.REMOVE_ALIAS_EVENT) {
mapper.removeHostAlias(event.getData().toString());
}
}
示例6: containerEvent
import org.apache.catalina.ContainerEvent; //导入方法依赖的package包/类
/**
* Acknowledge the occurrence of the specified event.
* Note: Will never be called when the listener is associated to a Server,
* since it is not a Container.
*
* @param event ContainerEvent that has occurred
*/
public void containerEvent(ContainerEvent event) {
Container container = event.getContainer();
Object child = event.getData();
String type = event.getType();
if (type.equals(Container.ADD_CHILD_EVENT)) {
if (container instanceof Host) {
// Deploying a webapp
((Lifecycle) child).addLifecycleListener(this);
addContext((Context) child, -1);
} else if (container instanceof Engine) {
// Deploying a host
container.addContainerListener(this);
}
} else if (type.equals(Container.REMOVE_CHILD_EVENT)) {
if (container instanceof Host) {
// Undeploying a webapp
((Lifecycle) child).removeLifecycleListener(this);
removeContext((Context) child, -1);
} else if (container instanceof Engine) {
// Undeploying a host
container.removeContainerListener(this);
}
}
}
示例7: containerEvent
import org.apache.catalina.ContainerEvent; //导入方法依赖的package包/类
@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);
}
}