本文整理汇总了Java中org.apache.catalina.ContainerEvent.getData方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerEvent.getData方法的具体用法?Java ContainerEvent.getData怎么用?Java ContainerEvent.getData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.ContainerEvent
的用法示例。
在下文中一共展示了ContainerEvent.getData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: containerEvent
import org.apache.catalina.ContainerEvent; //导入方法依赖的package包/类
@Override
public void containerEvent(ContainerEvent event) {
// Only useful for hosts
if (disabled) return;
if (Container.ADD_CHILD_EVENT.equals(event.getType())) {
Context context = (Context) event.getData();
if ("".equals(context.getPath())) {
// Force re-calculation and disable listener since it won't
// be re-used
engine.defaultAccessLog.set(null);
uninstall();
}
}
}
示例2: 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);
}
}
}
示例3: containerEvent
import org.apache.catalina.ContainerEvent; //导入方法依赖的package包/类
@Override
public void containerEvent(ContainerEvent event) {
// Only useful for hosts
if (disabled)
return;
if (Container.ADD_CHILD_EVENT.equals(event.getType())) {
Context context = (Context) event.getData();
if ("".equals(context.getPath())) {
// Force re-calculation and disable listener since it won't
// be re-used
engine.defaultAccessLog.set(null);
uninstall();
}
}
}
示例4: containerEvent
import org.apache.catalina.ContainerEvent; //导入方法依赖的package包/类
/**
* Acknowledge the occurrence of the specified event.
*
* @param event ContainerEvent that has occurred
*/
@Override
public void containerEvent(ContainerEvent event) {
if(event.getType().equals(Container.ADD_CHILD_EVENT)) {
if(event.getData() instanceof StandardContext) {
//StandardContext context = (StandardContext)event.getData();
cur_progress++;
if(max_progress > 0) {
showProgress(cur_progress * 100 / max_progress);
}
}
}
}