Package org.apache.webbeans.proxy

Examples of org.apache.webbeans.proxy.ProxyFactory


            throws Exception
    {
        if (decoratorDelegateHandler == null)
        {
            final DelegateHandler newDelegateHandler = new DelegateHandler(bean);
            final ProxyFactory proxyFactory = webBeansContext.getProxyFactory();

            final Object delegate = proxyFactory.createDecoratorDelegate(bean, newDelegateHandler);

            // Gets component decorator stack
            List<Object> decorators = WebBeansDecoratorConfig.getDecoratorStack(injectionTarget, instance, delegate, ownerCreationalContext);
            //Sets decorator stack of delegate
            newDelegateHandler.setDecorators(decorators);
View Full Code Here


        //For dependent instance checks
        T dependentProxy = null;
        boolean isDependentProxy = false;
        if(getScope() == Dependent.class && !(this instanceof EnterpriseBeanMarker))
        {
            final ProxyFactory proxyFactory = getWebBeansContext().getProxyFactory();
            T result = (T) proxyFactory.createDependentScopedBeanProxy(this, instance, creationalContext);
            //Means that Dependent Bean has interceptor/decorator
            if(proxyFactory.isProxyInstance(result))
            {
                //This is a dependent scoped bean instance,
                //Therefore we inject dependencies of this instance
                //Otherwise we loose injection
                injectResources(instance, creationalContext);
View Full Code Here

        loaderService = getService(LoaderService.class);
        securityService = getService(SecurityService.class);

        proxyFactory = serviceMap.containsKey(ProxyFactory.class)
            ? (ProxyFactory) serviceMap.get(ProxyFactory.class)
            : new ProxyFactory();
        OpenWebBeansClassLoaderProvider.initProxyFactoryClassLoaderProvider();

        // Allow the WebBeansContext itself to be looked up
        managerMap.put(getClass(), this);
View Full Code Here

                //GE: Currently we have a proxy for DependentScoped beans
                //that has an interceptor or decroator. This means that
                //injection will be occured on Proxy instances that are
                //not correct. Injection must be on actual dependent
                //instance,so not necessary to inject on proxy
                final ProxyFactory proxyFactory = this.bean.getWebBeansContext().getProxyFactory();
                if(bean.getScope() == Dependent.class && proxyFactory.isProxyInstance(instance))
                {
                    return;
                }
               
                bean.injectResources(instance, ctx);
View Full Code Here

            throws Exception
    {
        if (decoratorDelegateHandler == null)
        {
            final DelegateHandler newDelegateHandler = new DelegateHandler(bean);
            final ProxyFactory proxyFactory = webBeansContext.getProxyFactory();

            final Object delegate = proxyFactory.createDecoratorDelegate(bean, newDelegateHandler);

            // Gets component decorator stack
            List<Object> decorators = WebBeansDecoratorConfig.getDecoratorStack(injectionTarget, instance, delegate, ownerCreationalContext);
            //Sets decorator stack of delegate
            newDelegateHandler.setDecorators(decorators);
View Full Code Here

            services.put(ELAdaptor.class,new CustomELAdapter(appContext, startupObject.getWebContext()));
        }
        services.put(ResourceInjectionService.class, new CdiResourceInjectionService());
        services.put(ScannerService.class, new CdiScanner());
        services.put(LoaderService.class, new OptimizedLoaderService());
        services.put(org.apache.webbeans.proxy.ProxyFactory.class, new ProxyFactory(owbProxyFactory()));

        optional(services, ConversationService.class, "org.apache.webbeans.jsf.DefaultConversationService");

        ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
        ClassLoader cl;
View Full Code Here

    public DynamicMBeanWrapper(final WebBeansContext wc, final Object givenInstance) {
        Class<?> annotatedMBean = givenInstance.getClass();

        // javaassist looses annotation so simply unwrap it
        if (wc != null) {
            final ProxyFactory pf = wc.getProxyFactory();
            if (pf.isProxyInstance(givenInstance)) {
                annotatedMBean = annotatedMBean.getSuperclass();
            }
        }

        classloader = annotatedMBean.getClassLoader();
View Full Code Here

        Object instance = ejbContext.getTarget();

        if (bean.getDecoratorStack().size() > 0) {
            final CreationalContext<?> context = getCreationalContext();

            final ProxyFactory proxyFactory = webBeansContext.getProxyFactory();

            Class<?> proxyClass = proxyFactory.getInterceptorProxyClasses().get((InjectionTargetBean<?>) bean);
            if (proxyClass == null) {
                proxyClass = proxyFactory.createProxyClass(bean);
                proxyFactory.getInterceptorProxyClasses().put((InjectionTargetBean<?>) bean, proxyClass);
            }

            final DelegateHandler delegateHandler = new DelegateHandler(bean, ejbContext);
            final Object delegate = proxyFactory.createDecoratorDelegate(bean, delegateHandler);

            // Gets component decorator stack
            List<Object> decorators = WebBeansDecoratorConfig.getDecoratorStack(bean, instance, delegate, (CreationalContextImpl<?>) context);
            //Sets decorator stack of delegate
            delegateHandler.setDecorators(decorators);
View Full Code Here

            services.put(ELAdaptor.class,new CustomELAdapter(appContext, startupObject.getWebContext()));
        }
        services.put(ResourceInjectionService.class, new CdiResourceInjectionService());
        services.put(ScannerService.class, new CdiScanner());
        services.put(LoaderService.class, new OptimizedLoaderService());
        services.put(org.apache.webbeans.proxy.ProxyFactory.class, new ProxyFactory(owbProxyFactory()));

        optional(services, ConversationService.class, "org.apache.webbeans.jsf.DefaultConversationService");

        ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
        ClassLoader cl;
View Full Code Here

                //GE: Currently we have a proxy for DependentScoped beans
                //that has an interceptor or decroator. This means that
                //injection will be occured on Proxy instances that are
                //not correct. Injection must be on actual dependent
                //instance,so not necessary to inject on proxy
                final ProxyFactory proxyFactory = this.bean.getWebBeansContext().getProxyFactory();
                if(bean.getScope() == Dependent.class && proxyFactory.isProxyInstance(instance))
                {
                    return;
                }
               
                bean.injectResources(instance, ctx);
View Full Code Here

TOP

Related Classes of org.apache.webbeans.proxy.ProxyFactory

Copyright © 2018 www.massapicom. 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.