org.apache.catalina.ContainerListener - java examples

Here are the examples of the java api org.apache.catalina.ContainerListener taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

16 Examples 7

19 View Complete Implementation : ContainerBase.java
Copyright Apache License 2.0
Author : apache
/**
 * Add a container event listener to this component.
 *
 * @param listener The listener to add
 */
@Override
public void addContainerListener(ContainerListener listener) {
    listeners.add(listener);
}

19 View Complete Implementation : ContainerBase.java
Copyright Apache License 2.0
Author : apache
/**
 * Remove a container event listener from this component.
 *
 * @param listener The listener to remove
 */
@Override
public void removeContainerListener(ContainerListener listener) {
    listeners.remove(listener);
}

19 View Complete Implementation : ContainerBase.java
Copyright Apache License 2.0
Author : apache
// ------------------------------------------------------ Protected Methods
/**
 * 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);
    }
}

19 View Complete Implementation : ContainerBase.java
Copyright Apache License 2.0
Author : how2j
// ------------------------------------------------------ Protected Methods
/**
 * 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);
    }
}

19 View Complete Implementation : ContainerBase.java
Copyright Apache License 2.0
Author : how2j
/**
 * Add a container event listener to this component.
 *
 * @param listener
 *            The listener to add
 */
@Override
public void addContainerListener(ContainerListener listener) {
    listeners.add(listener);
}

19 View Complete Implementation : ContainerBase.java
Copyright Apache License 2.0
Author : how2j
/**
 * Remove a container event listener from this component.
 *
 * @param listener
 *            The listener to remove
 */
@Override
public void removeContainerListener(ContainerListener listener) {
    listeners.remove(listener);
}

18 View Complete Implementation : ContainerBase.java
Copyright Apache License 2.0
Author : apache
/**
 * Return the set of container listeners replacedociated with this Container.
 * If this Container has no registered container listeners, a zero-length
 * array is returned.
 */
@Override
public ContainerListener[] findContainerListeners() {
    ContainerListener[] results = new ContainerListener[0];
    return listeners.toArray(results);
}

18 View Complete Implementation : FailedContext.java
Copyright Apache License 2.0
Author : apache
@Override
public void addContainerListener(ContainerListener listener) {
/* NO-OP */
}

18 View Complete Implementation : FailedContext.java
Copyright Apache License 2.0
Author : apache
@Override
public void removeContainerListener(ContainerListener listener) {
/* NO-OP */
}

18 View Complete Implementation : TesterContext.java
Copyright Apache License 2.0
Author : apache
@Override
public void addContainerListener(ContainerListener listener) {
// NO-OP
}

18 View Complete Implementation : TesterContext.java
Copyright Apache License 2.0
Author : apache
@Override
public void removeContainerListener(ContainerListener listener) {
// NO-OP
}

18 View Complete Implementation : ContainerBase.java
Copyright Apache License 2.0
Author : how2j
/**
 * Return the set of container listeners replacedociated with this Container. If
 * this Container has no registered container listeners, a zero-length array
 * is returned.
 */
@Override
public ContainerListener[] findContainerListeners() {
    ContainerListener[] results = new ContainerListener[0];
    return listeners.toArray(results);
}

16 View Complete Implementation : ContainerMBean.java
Copyright Apache License 2.0
Author : apache
/**
 * List the clreplaced name of each of the container listeners added to this
 * container.
 * @return the container listeners clreplaced names
 * @throws MBeanException propagated from the managed resource access
 */
public String[] findContainerListenerNames() throws MBeanException {
    Container container = doGetManagedResource();
    List<String> result = new ArrayList<>();
    ContainerListener[] listeners = container.findContainerListeners();
    for (ContainerListener listener : listeners) {
        result.add(listener.getClreplaced().getName());
    }
    return result.toArray(new String[result.size()]);
}

16 View Complete Implementation : ContainerMBean.java
Copyright Apache License 2.0
Author : apache
/**
 * List the clreplaced name of each of the container listeners added to this
 * container.
 * @return the container listeners clreplaced names
 * @throws MBeanException propagated from the managed resource access
 */
public String[] findContainerListenerNames() throws MBeanException {
    Container container = null;
    List<String> result = new ArrayList<>();
    try {
        container = (Container) getManagedResource();
    } catch (InstanceNotFoundException e) {
        throw new MBeanException(e);
    } catch (RuntimeOperationsException e) {
        throw new MBeanException(e);
    } catch (InvalidTargetObjectTypeException e) {
        throw new MBeanException(e);
    }
    ContainerListener[] listeners = container.findContainerListeners();
    for (ContainerListener listener : listeners) {
        result.add(listener.getClreplaced().getName());
    }
    return result.toArray(new String[result.size()]);
}

16 View Complete Implementation : ContainerMBean.java
Copyright Apache License 2.0
Author : codefollower
/**
 * List the clreplaced name of each of the container listeners added to this
 * container.
 */
public String[] findContainerListenerNames() throws MBeanException {
    Container container = null;
    List<String> result = new ArrayList<>();
    try {
        container = (Container) getManagedResource();
    } catch (InstanceNotFoundException e) {
        throw new MBeanException(e);
    } catch (RuntimeOperationsException e) {
        throw new MBeanException(e);
    } catch (InvalidTargetObjectTypeException e) {
        throw new MBeanException(e);
    }
    ContainerListener[] listeners = container.findContainerListeners();
    for (ContainerListener listener : listeners) {
        result.add(listener.getClreplaced().getName());
    }
    return result.toArray(new String[result.size()]);
}

16 View Complete Implementation : ContainerMBean.java
Copyright Apache License 2.0
Author : how2j
/**
 * List the clreplaced name of each of the container listeners added to this
 * container.
 */
public String[] findContainerListenerNames() throws MBeanException {
    ContainerBase container = null;
    List<String> result = new ArrayList<String>();
    try {
        container = (ContainerBase) getManagedResource();
    } catch (InstanceNotFoundException e) {
        throw new MBeanException(e);
    } catch (RuntimeOperationsException e) {
        throw new MBeanException(e);
    } catch (InvalidTargetObjectTypeException e) {
        throw new MBeanException(e);
    }
    ContainerListener[] listeners = container.findContainerListeners();
    for (ContainerListener listener : listeners) {
        result.add(listener.getClreplaced().getName());
    }
    return result.toArray(new String[result.size()]);
}