Examples of LifecycleListener


Examples of org.apache.catalina.LifecycleListener

                context = (Context) Class.forName(contextClass).newInstance();
            }

            if (context instanceof Lifecycle) {
                Class clazz = Class.forName(host.getConfigClass());
                LifecycleListener listener =
                    (LifecycleListener) clazz.newInstance();
                ((Lifecycle) context).addLifecycleListener(listener);
            }
            context.setPath(contextPath);
            context.setDocBase(file);
View Full Code Here

Examples of org.apache.catalina.LifecycleListener

            } catch (Exception e) {
                logger.error("REST failed to start", e);
            }
        }

        standardServer.addLifecycleListener(new LifecycleListener() {
            public void lifecycleEvent(LifecycleEvent event) {
                String type = event.getType();
                if (Lifecycle.AFTER_STOP_EVENT.equals(type)) {
                    TomcatLoader.this.destroy();
                }
View Full Code Here

Examples of org.apache.catalina.LifecycleListener

        context.setParentClassLoader(classLoader);
        context.setDelegate(true);

        // Tomcat has a stupid rule where a life cycle listener must set
        // configured true, or it will treat it as a failed deployment
        context.addLifecycleListener(new LifecycleListener() {
            public void lifecycleEvent(LifecycleEvent event) {
                Context context = (Context) event.getLifecycle();

                if (event.getType().equals(Lifecycle.BEFORE_START_EVENT)) {
                    context.getServletContext().setAttribute(IGNORE_CONTEXT, "true");
View Full Code Here

Examples of org.apache.catalina.LifecycleListener

        if (context == null) {
            throw new IllegalStateException("Invalid context '" + realRoot + "'.  Cannot find context in host " + host.getName());
        }

        context.addLifecycleListener(new LifecycleListener() {
            public void lifecycleEvent(LifecycleEvent event) {
                Context context = (Context) event.getLifecycle();
                if (event.getType().equals(Lifecycle.BEFORE_START_EVENT)) {
                    context.getServletContext().setAttribute(IGNORE_CONTEXT, "true");
                }
View Full Code Here

Examples of org.apache.catalina.LifecycleListener

        synchronized (wrapperLifecycles) {
            for (int i = 0; i < wrapperLifecycles.length; i++) {
                try {
                    Class clazz = Class.forName(wrapperLifecycles[i]);
                    LifecycleListener listener =
                      (LifecycleListener) clazz.newInstance();
                    if (wrapper instanceof Lifecycle)
                        ((Lifecycle) wrapper).addLifecycleListener(listener);
                } catch (Throwable t) {
                    log.error("createWrapper", t);
View Full Code Here

Examples of org.apache.cayenne.LifecycleListener

                Class listenerClass = ClickUtils.classForName(classname);

                LifecycleCallbackRegistry registry =
                    dataDomain.getEntityResolver().getCallbackRegistry();

                LifecycleListener lifecycleListener = (LifecycleListener)
                    listenerClass.newInstance();

                if (registry.isEmpty(LifecycleEvent.POST_LOAD)) {
                    registry.addDefaultListener(lifecycleListener);
                    buffer.append(", lifecycle-listener=" + classname);
View Full Code Here

Examples of org.apache.geronimo.kernel.lifecycle.LifecycleListener

     * Create a LifecycleListenr that will be informed of lifecycle events.
     * We only care about running (the configuration ClassLoader cannot be retrieved when the Configuration is stopping)
     * and stopped.
     */
    private LifecycleListener createLifecycleListener() {
        return new LifecycleListener() {
            public void loaded(AbstractName abstractName) {
            }
            public void starting(AbstractName abstractName) {
            }
            public void running(AbstractName abstractName) {
View Full Code Here

Examples of org.apache.geronimo.kernel.lifecycle.LifecycleListener

            Map.Entry entry = (Map.Entry) listenerIterator.next();
            Set patterns = (Set) entry.getValue();
            for (Iterator patternIterator = patterns.iterator(); patternIterator.hasNext();) {
                ObjectName pattern = (ObjectName) patternIterator.next();
                if (pattern.apply(source)) {
                    LifecycleListener listener = (LifecycleListener) entry.getKey();
                    listeners.add(listener);
                }
            }
        }
View Full Code Here

Examples of org.apache.geronimo.kernel.lifecycle.LifecycleListener

    }

    private void fireLoadedEvent(ObjectName objectName) {
        Set targets = getTargets(objectName);
        for (Iterator iterator = targets.iterator(); iterator.hasNext();) {
            LifecycleListener listener = (LifecycleListener) iterator.next();
            try {
                listener.loaded(objectName);
            } catch (Throwable e) {
                log.warn("Exception occured while notifying listener", e);
            }
        }
    }
View Full Code Here

Examples of org.apache.geronimo.kernel.lifecycle.LifecycleListener

    }

    private void fireStartingEvent(ObjectName source) {
        Set targets = getTargets(source);
        for (Iterator iterator = targets.iterator(); iterator.hasNext();) {
            LifecycleListener listener = (LifecycleListener) iterator.next();
            try {
                listener.starting(source);
            } catch (Throwable e) {
                log.warn("Exception occured while notifying listener", e);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.