Package org.apache.openejb

Examples of org.apache.openejb.InjectionProcessor.createInstance()


                }

                Class clazz = interceptorData.getInterceptorClass();
                InjectionProcessor interceptorInjector = new InjectionProcessor(clazz, deploymentInfo.getInjections(), unwrap(ctx));
                try {
                    Object interceptorInstance = interceptorInjector.createInstance();
                    interceptorInstances.put(clazz.getName(), interceptorInstance);
                } catch (ConstructionException e) {
                    throw new Exception("Failed to create interceptor: " + clazz.getName(), e);
                }
            }
View Full Code Here


            callContext.setCurrentOperation(Operation.INJECTION);
            callContext.setCurrentAllowedStates(MdbContext.getStates());
            if(MessageDrivenBean.class.isAssignableFrom(beanClass)) {
                injectionProcessor.setProperty("messageDrivenContext", mdbContext);
            }
            Object bean = injectionProcessor.createInstance();

            HashMap<String, Object> interceptorInstances = new HashMap<String, Object>();

            // Add the stats interceptor instance and other already created interceptor instances
            for (InterceptorInstance interceptorInstance : deploymentInfo.getSystemInterceptors()) {
View Full Code Here

                Class clazz = interceptorData.getInterceptorClass();
                InjectionProcessor interceptorInjector = new InjectionProcessor(clazz, deploymentInfo.getInjections(), unwrap(ctx));

                try {
                    Object interceptorInstance = interceptorInjector.createInstance();
                    interceptorInstances.put(clazz.getName(), interceptorInstance);
                } catch (ConstructionException e) {
                    throw new Exception("Failed to create interceptor: " + clazz.getName(), e);
                }
            }
View Full Code Here

        // Create bean instance
        final Context unwrap = InjectionProcessor.unwrap(getInitialContext());
        final InjectionProcessor injectionProcessor = new InjectionProcessor(o, injections, unwrap);

        final Object beanInstance = injectionProcessor.createInstance();

        if (webBeansContext != null) {
            final InjectionTargetBean<Object> bean = InjectionTargetBean.class.cast(beanDefinition);
            bean.getInjectionTarget().inject(beanInstance, creationalContext);
View Full Code Here

            // Create bean instance
            final Context initialContext = (Context) new InitialContext().lookup("java:");
            final Context unwrap = InjectionProcessor.unwrap(initialContext);
            final InjectionProcessor injectionProcessor = new InjectionProcessor(o, injections, unwrap);

            final Object beanInstance = injectionProcessor.createInstance();

            if (webBeansContext != null) {
                final ConstructorInjectionBean<Object> beanDefinition = getConstructorInjectionBean(o.getClass(), webBeansContext);
                final CreationalContext<Object> creationalContext = webBeansContext.getBeanManagerImpl().createCreationalContext(beanDefinition);
View Full Code Here

        final ThreadContext callContext = new ThreadContext(context, null, Operation.INJECTION);
        final ThreadContext oldContext = ThreadContext.enter(callContext);
        try {
            final InjectionProcessor processor = new InjectionProcessor(inputTestInstance, context.getInjections(), context.getJndiContext());

            processor.createInstance();
            try {
                OWBInjector.inject(appContext.getBeanManager(), inputTestInstance, null);
            } catch (final Throwable t) {
                // TODO handle this differently
                // this is temporary till the injector can be rewritten
View Full Code Here

        final ThreadContext callContext = new ThreadContext(context, null, Operation.INJECTION);
        final ThreadContext oldContext = ThreadContext.enter(callContext);
        try {
            final InjectionProcessor processor = new InjectionProcessor(inputTestInstance, context.getInjections(), context.getJndiContext());

            processor.createInstance();
            try {
                OWBInjector.inject(appContext.getBeanManager(), inputTestInstance, null);
            } catch (final Throwable t) {
                // TODO handle this differently
                // this is temporary till the injector can be rewritten
View Full Code Here


        try {
            InjectionProcessor processor = new InjectionProcessor(obj, injections, context);

            processor.createInstance();
        } catch (OpenEJBException e) {
            throw (NamingException) new NamingException("Injection failed").initCause(e);
        }
    }
}
View Full Code Here

                    injectionProcessor.setProperty("sessionContext", sessionContext);
                }
            } catch (NoSuchMethodException ignored) {
                // bean doesn't have a setSessionContext method, so we don't need to inject one
            }
            Object bean = injectionProcessor.createInstance();

            // Create interceptors
            HashMap<String, Object> interceptorInstances = new HashMap<String, Object>();
            for (InterceptorData interceptorData : deploymentInfo.getAllInterceptors()) {
                if (interceptorData.getInterceptorClass().equals(beanClass)) {
View Full Code Here

                }

                Class clazz = interceptorData.getInterceptorClass();
                InjectionProcessor interceptorInjector = new InjectionProcessor(clazz, deploymentInfo.getInjections(), unwrap(ctx));
                try {
                    Object interceptorInstance = interceptorInjector.createInstance();
                    interceptorInstances.put(clazz.getName(), interceptorInstance);
                } catch (ConstructionException e) {
                    throw new Exception("Failed to create interceptor: " + clazz.getName(), e);
                }
            }
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.