Package org.apache.webbeans.inject

Examples of org.apache.webbeans.inject.OWBInjector.inject()


                    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


        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 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

                        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

            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

    @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

        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());
       
View Full Code Here

                }

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

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

            {                   
                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

            {
                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

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.