Examples of OWBInjector


Examples of org.apache.webbeans.inject.OWBInjector

            result = objectRecipe.create(classLoader);
        } catch (ConstructionException e) {
            throw (InstantiationException)new InstantiationException("Could not construct object").initCause(e);
        }
        // TODO we likely don't want to create a new one each time -- investigate the destroy() method
        OWBInjector beanInjector = new OWBInjector();
        try {
            beanInjector.inject(result);
        } catch (Exception e) {
            throw (InstantiationException)new InstantiationException("web beans injection problem").initCause(e);
        }

        if (getPostConstruct() != null) {
View Full Code Here

Examples of org.apache.webbeans.inject.OWBInjector

        this.webBeansContext = webBeansContext;
    }

    @Override
    public void instancerCreated(InvocationContext context) throws InterceptorException {
        OWBInjector beanInjector = new OWBInjector(webBeansContext);
        try {
            beanInjector.inject(context.getInstance());
        } catch (Exception e) {
            throw new InterceptorException("web beans injection problem", e);
        }
    }
View Full Code Here

Examples of org.apache.webbeans.inject.OWBInjector

        Collection<Class<?>> classes = new ArrayList<Class<?>>();
        classes.add(SampleBean.class);
        startContainer(classes);
       
        MockInstance instance = new MockInstance();
        OWBInjector injector = new OWBInjector();
        injector.inject(instance);
       
        Assert.assertNotNull(instance.getBeanManager());
        Assert.assertNotNull(instance.getSample());
        Assert.assertNotNull(instance.getViaMethod());
       
        injector.destroy();
       
        shutDownContainer();
       
    }
View Full Code Here

Examples of org.apache.webbeans.inject.OWBInjector

                    logger.debug("EjbInterceptor newInstanceForced  " + interceptor);
                }

                try
                {
                    OWBInjector injector = new OWBInjector();
                    injector.inject(interceptor);

                    ctx = new EjbInterceptorContext();
                    ctx.setInjectorInstance(injector);
                    ctx.setInterceptorInstance(interceptor);
                    ctx.setInterceptorClass(interceptorClass);
View Full Code Here

Examples of org.apache.webbeans.inject.OWBInjector

        lifecycleCommon(context, InterceptorType.POST_CONSTRUCT);
       
        if (OpenWebBeansConfiguration.getInstance().isUseEJBInterceptorInjection())
        {
            Object instance = context.getTarget();
            this.injector = new OWBInjector();
            try
            {
                this.injector.inject(instance, this.cc);
            }
            catch (Exception e)
View Full Code Here

Examples of org.apache.webbeans.inject.OWBInjector

            if(ctx == null)
            {                   
                interceptor = WebBeansUtil.newInstanceForced(this.interceptorClass);
                try
                {
                    OWBInjector injector = new OWBInjector();
                    injector.inject(interceptor);
                   
                    ctx = new EjbInterceptorContext();
                    ctx.setInjectorInstance(injector);
                    ctx.setInterceptorInstance(interceptor);
                }
View Full Code Here

Examples of org.apache.webbeans.inject.OWBInjector

        }
       
        if (OpenWebBeansConfiguration.getInstance().isUseEJBInterceptorInjection())
        {
            Object instance = context.getTarget();
            this.injector = new OWBInjector();
            try
            {
                this.injector.inject(instance, threadLocalCreationalContext.get());
            }
            catch (Exception e)
View Full Code Here

Examples of org.apache.webbeans.inject.OWBInjector

            if (ctx == null)
            {
                interceptor = webBeansContext.getWebBeansUtil().newInstanceForced(interceptorClass);
                try
                {
                    OWBInjector injector = new OWBInjector(webBeansContext);
                    injector.inject(interceptor);

                    ctx = new EjbInterceptorContext();
                    ctx.setInjectorInstance(injector);
                    ctx.setInterceptorInstance(interceptor);
                    ctx.setInterceptorClass(interceptorClass);
View Full Code Here

Examples of org.apache.webbeans.inject.OWBInjector

        lifecycleCommon(context, InterceptorType.POST_CONSTRUCT);

        if (webBeansContext.getOpenWebBeansConfiguration().isUseEJBInterceptorInjection())
        {
            Object instance = context.getTarget();
            this.injector = new OWBInjector(webBeansContext);
            try
            {
                this.injector.inject(instance, this.cc);
            }
            catch (Exception e)
View Full Code Here

Examples of org.apache.webbeans.inject.OWBInjector

     * @param interceptorInstance interceptor instance
     * @throws Exception if any exception occurs
     */
    public void injectDependenciesOfEjbInterceptor(Object ejbInstance, Object interceptorInstance, Object mapKey) throws Exception
    {
        OWBInjector owbInjector = new OWBInjector(webBeansContext);
        CreationalContextImpl<Object> cc = null;
        //Look for contextual ejb or not
        if(this.injectedContextuals.containsKey(mapKey))
        {
            cc = this.injectedContextuals.get(mapKey);
           
            //Add all dependencies of interceptor to ejb bean
            owbInjector.inject(interceptorInstance,cc);
        }               
        else
        {
            cc = (CreationalContextImpl<Object>)this.beanManager.createCreationalContext(null);
            owbInjector.inject(interceptorInstance,cc);
            this.injectedNonContextuals.get(mapKey).add(cc);
        }                   
    }
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.