Examples of IoCComponentProcessor


Examples of com.sun.jersey.core.spi.component.ioc.IoCComponentProcessor

            // Not initialized
            return;
        }

        final Object beanInstance = context.getTarget();
        final IoCComponentProcessor icp = get(beanInstance.getClass());
        if (icp != null)
            icp.postConstruct(beanInstance);
       
        // Invoke next interceptor in chain
        context.proceed();
    }
View Full Code Here

Examples of com.sun.jersey.core.spi.component.ioc.IoCComponentProcessor

        public void postConstruct(Object o) {
        }
    };
   
    private IoCComponentProcessor get(final Class c) {
        IoCComponentProcessor cp = componentProcessorMap.get(c);
        if (cp != null) {
            return (cp == NULL_COMPONENT_PROCESSOR) ? null : cp;
        }

        synchronized (componentProcessorMap) {
View Full Code Here

Examples of com.sun.jersey.core.spi.component.ioc.IoCComponentProcessor

        }

        public IoCComponentProvider getComponentProvider(final Class c) {
            if (PostConstructListener.class.isAssignableFrom(c)) {
                final ComponentScope cs = SingletonScope.class.isAssignableFrom(c) ? ComponentScope.Singleton : ComponentScope.PerRequest;
                final IoCComponentProcessor cp = cpf.get(c, cs);
                return new IoCFullyManagedComponentProvider() {

                    public Object getInstance() {
                        componentClass = c;
                        Object o = null;
                        try {
                            o = c.newInstance();
                        } catch (InstantiationException ex) {
                            throw new RuntimeException(ex);
                        } catch (IllegalAccessException ex) {
                            throw new RuntimeException(ex);
                        }
                        cp.postConstruct(o);
                        ((PostConstructListener)o).postConstruct();
                        return o;
                    }

                    public ComponentScope getScope() {
View Full Code Here

Examples of com.sun.jersey.core.spi.component.ioc.IoCComponentProcessor

            return rcpFactory.getScope(c);
        }

        @Override
        public IoCComponentProcessor get(final Class c, final ComponentScope scope) {
            IoCComponentProcessor cp = componentProcessorMap.get(c);
            if (cp != null) {
                return (cp == NULL_COMPONENT_PROCESSOR) ? null : cp;
            }

            synchronized (abstractResourceMap) {
View Full Code Here

Examples of com.sun.jersey.core.spi.component.ioc.IoCComponentProcessor

        }

        @Override
        public IoCComponentProcessor get(Class c, ComponentScope scope) {
            final ComponentInjector ci = new ComponentInjector(injectableFactory, c);
            return new IoCComponentProcessor() {

                @Override
                public void preConstruct() {
                }
View Full Code Here

Examples of com.sun.jersey.core.spi.component.ioc.IoCComponentProcessor

            return rcpFactory.getScope(c);
        }

        @Override
        public IoCComponentProcessor get(final Class c, final ComponentScope scope) {
            IoCComponentProcessor cp = componentProcessorMap.get(c);
            if (cp != null) {
                return (cp == NULL_COMPONENT_PROCESSOR) ? null : cp;
            }

            synchronized (abstractResourceMap) {
View Full Code Here

Examples of com.sun.jersey.core.spi.component.ioc.IoCComponentProcessor

            return rcpFactory.getScope(c);
        }

        @Override
        public IoCComponentProcessor get(final Class c, final ComponentScope scope) {
            IoCComponentProcessor cp = componentProcessorMap.get(c);
            if (cp != null) {
                return (cp == NULL_COMPONENT_PROCESSOR) ? null : cp;
            }

            synchronized (abstractResourceMap) {
View Full Code Here

Examples of com.sun.jersey.core.spi.component.ioc.IoCComponentProcessor

        public ComponentScope getScope(Class c) {
            return rcpFactory.getScope(c);
        }
       
        public IoCComponentProcessor get(final Class c, final ComponentScope scope) {
            IoCComponentProcessor cp = componentProcessorMap.get(c);
            if (cp != null) {
                return (cp == NULL_COMPONENT_PROCESSOR) ? null : cp;
            }

            synchronized (abstractResourceMap) {
View Full Code Here

Examples of com.sun.jersey.core.spi.component.ioc.IoCComponentProcessor

            return ComponentScope.Singleton;
        }

        public IoCComponentProcessor get(Class c, ComponentScope scope) {
            final ComponentInjector ci = new ComponentInjector(injectableFactory, c);
            return new IoCComponentProcessor() {

                public void preConstruct() {
                }

                public void postConstruct(Object o) {
View Full Code Here

Examples of com.sun.jersey.core.spi.component.ioc.IoCComponentProcessor

            final InjectionTarget it = pit.getInjectionTarget();
            final InjectionTarget nit = new InjectionTarget() {
                private volatile IoCComponentProcessor icp;

                private IoCComponentProcessor getProcessor() {
                    IoCComponentProcessor result = icp;
                    if (result == null) { // First check (no locking)
                        synchronized(this) {
                            result = icp;
                            if (result == null) // Second check (with locking)
                                icp = result = computeProcessor();
                        }
                    }
                    return result;
                }

                private IoCComponentProcessor computeProcessor() {
                    IoCComponentProcessor icp = cpf.get(c, cs);
                    if (icp == null) {
                        return NULL_COMPONENT_PROCESSOR;
                    }
                    return icp;
                }
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.