Package org.apache.openejb

Examples of org.apache.openejb.InjectionProcessor


            final WebBeansContext webBeansContext = getWebBeansContext();

            // 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 BeanContext context = containerSystem.getBeanContext(testClass.getName());

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

            processor.createInstance();
            AbstractInjectable.instanceUnderInjection.set(testInstance);
            try {
                OWBInjector.inject(appContext.getBeanManager(), testInstance, null);
            } catch (Throwable t) {
                // TODO handle this differently
View Full Code Here

            final CreationalContext<Object> creationalContext = webBeansContext.getBeanManagerImpl().createCreationalContext(beanDefinition);

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

            final Object beanInstance = injectionProcessor.createInstance();

            final Object oldInstanceUnderInjection = AbstractInjectable.instanceUnderInjection.get();

            try {
                AbstractInjectable.instanceUnderInjection.set(null);
View Full Code Here

            final CreationalContext<Object> creationalContext = webBeansContext.getBeanManagerImpl().createCreationalContext(beanDefinition);

            // 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();

            final Object oldInstanceUnderInjection = AbstractInjectable.instanceUnderInjection.get();

            try {
                AbstractInjectable.instanceUnderInjection.set(null);
View Full Code Here

        if (context != null) {
            ThreadContext callContext = new ThreadContext(context, null, Operation.INJECTION);
            ThreadContext oldContext = ThreadContext.enter(callContext);
            try {
                final InjectionProcessor processor = new InjectionProcessor<Object>(testInstance, context.getInjections(), context.getJndiContext());
                processor.createInstance();
            } catch (OpenEJBException e) {
                // ignored
            } finally {
                ThreadContext.exit(oldContext);
            }
View Full Code Here

        final BeanContext context = containerSystem.get().getBeanContext(testInstance.getClass().getName());
        if (context != null) {
            ThreadContext callContext = new ThreadContext(context, null, Operation.INJECTION);
            ThreadContext oldContext = ThreadContext.enter(callContext);
            try {
                final InjectionProcessor processor = new InjectionProcessor<Object>(testInstance, context.getInjections(), context.getJndiContext());
                processor.createInstance();
            } catch (OpenEJBException e) {
                // ignored
            } finally {
                ThreadContext.exit(oldContext);
            }
View Full Code Here

                    final BeanContext context = containerSystem.getBeanContext(javaClass.getName());

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

                        processor.createInstance();
//                        load("org.apache.webbeans.component.AbstractOwbBean");
//                        load("sun.security.pkcs11.SunPKCS11");
//                        load("sun.security.pkcs11.SunPKCS11$Descriptor");
//                        load("sun.security.pkcs11.wrapper.PKCS11Exception");
                        try {
View Full Code Here

            final CreationalContext<Object> creationalContext = webBeansContext.getBeanManagerImpl().createCreationalContext(beanDefinition);

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

            final Object beanInstance = injectionProcessor.createInstance();

            final Object oldInstanceUnderInjection = AbstractInjectable.instanceUnderInjection.get();

            try {
                AbstractInjectable.instanceUnderInjection.set(null);
View Full Code Here

            final CreationalContext<Object> creationalContext = webBeansContext.getBeanManagerImpl().createCreationalContext(beanDefinition);

            // 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();

            final Object oldInstanceUnderInjection = AbstractInjectable.instanceUnderInjection.get();

            try {
                AbstractInjectable.instanceUnderInjection.set(null);
View Full Code Here

                    final BeanContext context = containerSystem.getBeanContext(javaClass.getName());

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

                        processor.createInstance();
                        AbstractInjectable.instanceUnderInjection.set(testInstance);
                        try {
                            OWBInjector.inject(appContext.getBeanManager(), testInstance, null);
                        } catch (Throwable t) {
                            // TODO handle this differently
View Full Code Here

TOP

Related Classes of org.apache.openejb.InjectionProcessor

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.