Package org.apache.webbeans.inject

Examples of org.apache.webbeans.inject.OWBInjector


                try {
                    final Object interceptorInstance = interceptorInjector.createInstance();

                    // TODO we likely don't want to create a new one each time -- investigate the destroy() method
                    try {
                        OWBInjector interceptorCdiInjector = new OWBInjector(webBeansContext);
                        interceptorCdiInjector.inject(interceptorInstance, creationalContext);
                    } catch (Throwable t) {
                        // TODO handle this differently
                        // this is temporary till the injector can be rewritten
                    }
View Full Code Here


        Object o = super.createInstance(m);
        try {
            final InjectionProcessor<?> injector = new InjectionProcessor<Object>(o, new ArrayList<Injection>(injections), InjectionProcessor.unwrap(context));
            injector.createInstance();
            try {
                final OWBInjector beanInjector = new OWBInjector(webbeansContext);
                beanInjector.inject(injector.getInstance());
            } catch (Throwable t) {
                // ignored
            }
            injector.postConstruct();
            return injector.getInstance();
View Full Code Here

        final InjectionProcessor processor = new InjectionProcessor(object, context.getInjections(), context.getJndiContext());

        final ThreadContext callContext = new ThreadContext(context, null, Operation.INJECTION);
        final ThreadContext oldContext = ThreadContext.enter(callContext);
        try {
            final OWBInjector beanInjector = new OWBInjector(webBeanContext);
            beanInjector.inject(object);
        } catch (Throwable t) {
            logger.warning("an error occured while injecting the class '" + clazz.getName() + "': " + t.getMessage());
            // TODO handle this differently
            // this is temporary till the injector can be rewritten
        } finally {
View Full Code Here

                        final InjectionProcessor processor = new InjectionProcessor(testInstance, context.getInjections(), context.getJndiContext());

                        processor.createInstance();

                        try {
                            OWBInjector beanInjector = new OWBInjector(appContext.getWebBeansContext());
                            beanInjector.inject(testInstance);
                        } catch (Throwable t) {
                            // TODO handle this differently
                            // this is temporary till the injector can be rewritten
                        }
                    } finally {
View Full Code Here

            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

        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

        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

                    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

        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

            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

TOP

Related Classes of org.apache.webbeans.inject.OWBInjector

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.