Examples of PreDestroyCallback


Examples of org.eclipse.jetty.plus.annotation.PreDestroyCallback

                //as the first declarer.
                context.getMetaData().setOrigin("pre-destroy", descriptor);
                try
                {
                    Class<?> clazz = context.loadClass(className);
                    LifeCycleCallback callback = new PreDestroyCallback();
                    callback.setTarget(clazz, methodName);
                    ((LifeCycleCallbackCollection)context.getAttribute(LifeCycleCallbackCollection.LIFECYCLE_CALLBACK_COLLECTION)).add(callback);
                }
                catch (ClassNotFoundException e)
                {
                    LOG.warn("Couldn't load pre-destory target class "+className);
                }
                break;
            }
            case WebXml:
            case WebDefaults:
            case WebOverride:
            {
                //A web xml file previously declared a pre-destroy. Only allow other web xml files
                //(not web-fragments) to add to them.
                if (!(descriptor instanceof FragmentDescriptor))
                {
                    try
                    {
                        Class<?> clazz = context.loadClass(className);
                        LifeCycleCallback callback = new PreDestroyCallback();
                        callback.setTarget(clazz, methodName);
                        ((LifeCycleCallbackCollection)context.getAttribute(LifeCycleCallbackCollection.LIFECYCLE_CALLBACK_COLLECTION)).add(callback);
                    }
                    catch (ClassNotFoundException e)
                    {
                        LOG.warn("Couldn't load pre-destory target class "+className);
                    }
                }
                break;
            }
            case WebFragment:
            {
                //No pre-destroys in web xml, so allow all fragments to merge their pre-destroys.
                try
                {
                    Class<?> clazz = context.loadClass(className);
                    LifeCycleCallback callback = new PreDestroyCallback();
                    callback.setTarget(clazz, methodName);
                    ((LifeCycleCallbackCollection)context.getAttribute(LifeCycleCallbackCollection.LIFECYCLE_CALLBACK_COLLECTION)).add(callback);
                }
                catch (ClassNotFoundException e)
                {
                    LOG.warn("Couldn't load pre-destory target class "+className);
View Full Code Here

Examples of org.eclipse.jetty.plus.annotation.PreDestroyCallback

                            (origin == Origin.WebXml ||
                             origin == Origin.WebDefaults ||
                             origin == Origin.WebOverride))
                            return;

                    PreDestroyCallback callback = new PreDestroyCallback();
                    callback.setTarget(clazz.getName(), m.getName());

                    LifeCycleCallbackCollection lifecycles = (LifeCycleCallbackCollection)_context.getAttribute(LifeCycleCallbackCollection.LIFECYCLE_CALLBACK_COLLECTION);
                    if (lifecycles == null)
                    {
                        lifecycles = new LifeCycleCallbackCollection();
View Full Code Here

Examples of org.eclipse.jetty.plus.annotation.PreDestroyCallback

                //as the first declarer.
                context.getMetaData().setOrigin("pre-destroy", descriptor);
                try
                {
                    Class<?> clazz = context.loadClass(className);
                    LifeCycleCallback callback = new PreDestroyCallback();
                    callback.setTarget(clazz, methodName);
                    ((LifeCycleCallbackCollection)context.getAttribute(LifeCycleCallbackCollection.LIFECYCLE_CALLBACK_COLLECTION)).add(callback);
                }
                catch (ClassNotFoundException e)
                {
                    LOG.warn("Couldn't load pre-destory target class "+className);
                }
                break;
            }
            case WebXml:
            case WebDefaults:
            case WebOverride:
            {
                //A web xml file previously declared a pre-destroy. Only allow other web xml files
                //(not web-fragments) to add to them.
                if (!(descriptor instanceof FragmentDescriptor))
                {
                    try
                    {
                        Class<?> clazz = context.loadClass(className);
                        LifeCycleCallback callback = new PreDestroyCallback();
                        callback.setTarget(clazz, methodName);
                        ((LifeCycleCallbackCollection)context.getAttribute(LifeCycleCallbackCollection.LIFECYCLE_CALLBACK_COLLECTION)).add(callback);
                    }
                    catch (ClassNotFoundException e)
                    {
                        LOG.warn("Couldn't load pre-destory target class "+className);
                    }
                }
                break;
            }
            case WebFragment:
            {
                //No pre-destroys in web xml, so allow all fragments to merge their pre-destroys.
                try
                {
                    Class<?> clazz = context.loadClass(className);
                    LifeCycleCallback callback = new PreDestroyCallback();
                    callback.setTarget(clazz, methodName);
                    ((LifeCycleCallbackCollection)context.getAttribute(LifeCycleCallbackCollection.LIFECYCLE_CALLBACK_COLLECTION)).add(callback);
                }
                catch (ClassNotFoundException e)
                {
                    LOG.warn("Couldn't load pre-destory target class "+className);
View Full Code Here

Examples of org.mortbay.jetty.plus.annotation.PreDestroyCallback

        }
       
        try
        {
            Class clazz = getWebAppContext().loadClass(className);
            LifeCycleCallback callback = new PreDestroyCallback();
            callback.setTarget(clazz, methodName);
            _callbacks.add(callback);
        }
        catch (ClassNotFoundException e)
        {
            Log.warn("Couldn't load pre-destory target class "+className);
View Full Code Here

Examples of org.mortbay.jetty.plus.annotation.PreDestroyCallback

                if (m.getExceptionTypes().length != 0)
                    throw new IllegalStateException(m+" throws checked exceptions");
                if (Modifier.isStatic(m.getModifiers()))
                    throw new IllegalStateException(m+" is static");
               
                PreDestroyCallback callback = new PreDestroyCallback();
                callback.setTargetClass(getTargetClass());
                callback.setTarget(m);
                callbacks.add(callback);
            }
        }
    }
View Full Code Here

Examples of org.mortbay.jetty.plus.annotation.PreDestroyCallback

        }
       
        try
        {
            Class clazz = getWebAppContext().loadClass(className);
            LifeCycleCallback callback = new PreDestroyCallback();
            callback.setTarget(clazz, methodName);
            _callbacks.add(callback);
        }
        catch (ClassNotFoundException e)
        {
            Log.warn("Couldn't load pre-destory target class "+className);
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.