Java 类org.apache.catalina.ContainerEvent 实例源码

项目:tomcat7    文件:ThreadLocalLeakPreventionListener.java   
@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);
    }

}
项目:lams    文件:ServerLifecycleListener.java   
/**
 * 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);
    }

}
项目:jerrydog    文件:ServerLifecycleListener.java   
/**
 * 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);
    }

}
项目:jerrydog    文件:FastEngineMapper.java   
/**
 * 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());
    }

}
项目:apache-tomcat-7.0.73-with-comment    文件:ThreadLocalLeakPreventionListener.java   
@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);
    }

}
项目:class-guard    文件:ThreadLocalLeakPreventionListener.java   
@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);
    }

}
项目:apache-tomcat-7.0.57    文件:ThreadLocalLeakPreventionListener.java   
@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);
    }

}
项目:apache-tomcat-7.0.57    文件:ThreadLocalLeakPreventionListener.java   
@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);
    }

}
项目:HowTomcatWorks    文件:ServerLifecycleListener.java   
/**
 * 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);
    }

}
项目:HowTomcatWorks    文件:FastEngineMapper.java   
/**
 * 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());
    }

}
项目:WBSAirback    文件:ThreadLocalLeakPreventionListener.java   
@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);
    }

}
项目:tomcat7    文件:StandardEngine.java   
@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();
        }
    }
}
项目:tomcat7    文件:ContainerBase.java   
/**
 * Notify all container event listeners that a particular event has
 * occurred for this Container.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
@Override
public void fireContainerEvent(String type, Object data) {

    if (listeners.size() < 1)
        return;

    ContainerEvent event = new ContainerEvent(this, type, data);
    // Note for each uses an iterator internally so this is safe
    for (ContainerListener listener : listeners) {
        listener.containerEvent(event);
    }
}
项目:lams    文件:MapperListener.java   
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());
        }
    }
项目:lams    文件:ContainerBase.java   
/**
 * Notify all container event listeners that a particular event has
 * occurred for this Container.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireContainerEvent(String type, Object data) {

    if (listeners.size() < 1)
        return;
    ContainerEvent event = new ContainerEvent(this, type, data);
    ContainerListener list[] = new ContainerListener[0];
    synchronized (listeners) {
        list = (ContainerListener[]) listeners.toArray(list);
    }
    for (int i = 0; i < list.length; i++)
        ((ContainerListener) list[i]).containerEvent(event);

}
项目:lams    文件:ClusterListener.java   
/**
 * 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);
        }
    }

}
项目:jerrydog    文件:ContainerBase.java   
/**
 * Notify all container event listeners that a particular event has
 * occurred for this Container.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireContainerEvent(String type, Object data) {

    if (listeners.size() < 1)
        return;
    ContainerEvent event = new ContainerEvent(this, type, data);
    ContainerListener list[] = new ContainerListener[0];
    synchronized (listeners) {
        list = (ContainerListener[]) listeners.toArray(list);
    }
    for (int i = 0; i < list.length; i++)
        ((ContainerListener) list[i]).containerEvent(event);

}
项目:lazycat    文件:StandardEngine.java   
@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();
        }
    }
}
项目:lazycat    文件:ThreadLocalLeakPreventionListener.java   
@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);
    }

}
项目:lazycat    文件:ContainerBase.java   
/**
 * Notify all container event listeners that a particular event has occurred
 * for this Container. The default implementation performs this notification
 * synchronously using the calling thread.
 *
 * @param type
 *            Event type
 * @param data
 *            Event data
 */
@Override
public void fireContainerEvent(String type, Object data) {

    if (listeners.size() < 1)
        return;

    ContainerEvent event = new ContainerEvent(this, type, data);
    // Note for each uses an iterator internally so this is safe
    for (ContainerListener listener : listeners) {
        listener.containerEvent(event);
    }
}
项目:class-guard    文件:StandardEngine.java   
@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();
        }
    }
}
项目:class-guard    文件:ContainerBase.java   
/**
 * Notify all container event listeners that a particular event has
 * occurred for this Container.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
@Override
public void fireContainerEvent(String type, Object data) {

    if (listeners.size() < 1)
        return;

    ContainerEvent event = new ContainerEvent(this, type, data);
    // Note for each uses an iterator internally so this is safe
    for (ContainerListener listener : listeners) {
        listener.containerEvent(event);
    }
}
项目:apache-tomcat-7.0.57    文件:StandardEngine.java   
@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();
        }
    }
}
项目:apache-tomcat-7.0.57    文件:ContainerBase.java   
/**
 * Notify all container event listeners that a particular event has
 * occurred for this Container.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
@Override
public void fireContainerEvent(String type, Object data) {

    if (listeners.size() < 1)
        return;

    ContainerEvent event = new ContainerEvent(this, type, data);
    // Note for each uses an iterator internally so this is safe
    for (ContainerListener listener : listeners) {
        listener.containerEvent(event);
    }
}
项目:apache-tomcat-7.0.57    文件:StandardEngine.java   
@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();
        }
    }
}
项目:apache-tomcat-7.0.57    文件:ContainerBase.java   
/**
 * Notify all container event listeners that a particular event has
 * occurred for this Container.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
@Override
public void fireContainerEvent(String type, Object data) {

    if (listeners.size() < 1)
        return;

    ContainerEvent event = new ContainerEvent(this, type, data);
    // Note for each uses an iterator internally so this is safe
    for (ContainerListener listener : listeners) {
        listener.containerEvent(event);
    }
}
项目:marmotta    文件:ProgressListener.java   
/**
 * 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);
            }

        }
    }
}
项目:HowTomcatWorks    文件:ContainerBase.java   
/**
 * Notify all container event listeners that a particular event has
 * occurred for this Container.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireContainerEvent(String type, Object data) {

    if (listeners.size() < 1)
        return;
    ContainerEvent event = new ContainerEvent(this, type, data);
    ContainerListener list[] = new ContainerListener[0];
    synchronized (listeners) {
        list = (ContainerListener[]) listeners.toArray(list);
    }
    for (int i = 0; i < list.length; i++)
        ((ContainerListener) list[i]).containerEvent(event);

}
项目:WBSAirback    文件:StandardEngine.java   
@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();
        }
    }
}
项目:WBSAirback    文件:ContainerBase.java   
/**
 * Notify all container event listeners that a particular event has
 * occurred for this Container.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
@Override
public void fireContainerEvent(String type, Object data) {

    if (listeners.size() < 1)
        return;
    ContainerEvent event = new ContainerEvent(this, type, data);
    ContainerListener list[] = new ContainerListener[0];
    synchronized (listeners) {
        list = listeners.toArray(list);
    }
    for (int i = 0; i < list.length; i++)
        list[i].containerEvent(event);

}
项目:tomee    文件:TomEEContainerListener.java   
@Override
public void containerEvent(final ContainerEvent event) {
    if ("beforeContextInitialized".equals(event.getType())) {
        context.set((StandardContext) event.getContainer());
    } else if ("afterContextInitialized".equals(event.getType())) {
        context.remove();
    }
}
项目:tomcat7    文件:HeartbeatListener.java   
@Override
public void containerEvent(ContainerEvent event) {
}
项目:apache-tomcat-7.0.73-with-comment    文件:HeartbeatListener.java   
@Override
public void containerEvent(ContainerEvent event) {
}
项目:lazycat    文件:HeartbeatListener.java   
@Override
public void containerEvent(ContainerEvent event) {
}
项目:class-guard    文件:HeartbeatListener.java   
@Override
public void containerEvent(ContainerEvent event) {
}
项目:apache-tomcat-7.0.57    文件:HeartbeatListener.java   
@Override
public void containerEvent(ContainerEvent event) {
}
项目:apache-tomcat-7.0.57    文件:HeartbeatListener.java   
@Override
public void containerEvent(ContainerEvent event) {
}
项目:WBSAirback    文件:HeartbeatListener.java   
@Override
public void containerEvent(ContainerEvent event) {
}