Package org.apache.webbeans.container

Examples of org.apache.webbeans.container.BeanManagerImpl.createCreationalContext()


            clazz = Thread.currentThread().getContextClassLoader().loadClass(delegate);
        } catch (final ClassNotFoundException e) {
            throw new OpenEJBRuntimeException(e.getMessage(), e);
        }

        cc = bm.createCreationalContext(null);
        final String cdiName = String.valueOf(options.get("cdiName"));
        if ("true".equals(String.valueOf(options.get("loginModuleAsCdiBean")))) {
            final Set<Bean<?>> beans;
            if ("null".equals(cdiName)) {
                beans = bm.getBeans(clazz);
View Full Code Here


            if (bm.isInUse()) { // try cdi bean
                if (JAXWS_AS_CDI_BEANS) {
                    try {
                        final Set<Bean<?>> beans = bm.getBeans(instance);
                        final Bean<?> bean = bm.resolve(beans);
                        final CreationalContextImpl creationalContext = bm.createCreationalContext(bean);
                        if (bean != null) {
                            final Bean<?> oldBean = creationalContext.putBean(bean);
                            try {
                                if (AbstractOwbBean.class.isInstance(bean)) {
                                    final AbstractOwbBean<?> aob = AbstractOwbBean.class.cast(bean);
View Full Code Here

                final InjectionProcessor<Object> injectionProcessor = new InjectionProcessor<Object>(instance, port.getInjections(), null, null, unwrap(context), bindings);
                injectionProcessor.createInstance();
                implementor = injectionProcessor.getInstance();
                injector = injectCxfResources(implementor);
                if (!JAXWS_AS_CDI_BEANS && bm.isInUse()) {
                    final CreationalContextImpl creationalContext = bm.createCreationalContext(null);
                    OWBInjector.inject(bm, implementor, null);
                    toClean = creationalContext;
                }
                injector.invokePostConstruct();
            }
View Full Code Here

                    try {
                        final Set<Bean<?>> beans = bm.getBeans(handler.getHandlerClass());
                        final Bean<?> bean = bm.resolve(beans);
                        if (bean != null) { // proxy so faster to do it
                            final boolean normalScoped = bm.isNormalScope(bean.getScope());
                            final CreationalContextImpl<?> creationalContext = bm.createCreationalContext(bean);
                            final Handler instance = Handler.class.cast(bm.getReference(bean, bean.getBeanClass(), creationalContext));

                            // hack for destroyHandlers()
                            handlers.add(instance);
                            handlerInstances.add(new InjectionProcessor<Handler>(instance, Collections.<Injection>emptySet(), null) {
View Full Code Here

            return clazz.newInstance();
        }

        final AnnotatedType<T> annotatedType = beanManager.createAnnotatedType(clazz);
        final InjectionTarget<T> it = beanManager.createInjectionTarget(annotatedType);
        final CreationalContext<T> context = beanManager.createCreationalContext(null);
        final T instance = it.produce(context);
        it.inject(instance, context);
        it.postConstruct(instance);

        config.releasables.add(new Releasable<T>(context, it, instance));
View Full Code Here

        boolean isDependentBean = WebBeansUtil.isDependent(bean);

        if (!isDependentBean)
        {
            // but for all NormalScoped beans we will need to create a fresh CreationalContext
            creationalContext = beanManager.createCreationalContext(bean);
        }
        if (!(creationalContext instanceof CreationalContextImpl))
        {
            creationalContext = webBeansContext.getCreationalContextFactory().wrappedCreationalContext(creationalContext, bean);
        }
View Full Code Here

        Object object = null;
       
        List<ObserverParams> methodArgsMap = getMethodArguments(event, metadata);

        BeanManagerImpl manager = bean.getWebBeansContext().getBeanManagerImpl();
        CreationalContextImpl<Object> creationalContext = manager.createCreationalContext(component);
        if (metadata != null)
        {
            creationalContext.putInjectionPoint(metadata.getInjectionPoint());
        }
View Full Code Here

                //Get observer parameter instance
                @SuppressWarnings("unchecked")
                Bean<Object> injectedBean = (Bean<Object>)getWebBeansContext().getBeanManagerImpl().getInjectionResolver().getInjectionPointBean(point);
               
                CreationalContextImpl<Object> creational = manager.createCreationalContext(injectedBean);
                creational.putInjectionPoint(metadata.getInjectionPoint());
                creational.putInjectionPoint(point);
                Object instance;
                try
                {
View Full Code Here

            if (interceptor == null)
            {
                BeanManagerImpl manager = webBeansContext.getBeanManagerImpl();

                WebBeansInterceptor<Object> actualInterceptor = (WebBeansInterceptor<Object>) webBeansInterceptor;
                CreationalContext<Object> creationalContext = manager.createCreationalContext(actualInterceptor);
                interceptor = manager.getReference(actualInterceptor, actualInterceptor.getBeanClass(), creationalContext);

                actualInterceptor.setInjections(interceptor, creationalContext);

                ownerCreationalContext.addDependent(ownerInstance, (WebBeansInterceptor<Object>) webBeansInterceptor, interceptor);
View Full Code Here

        try
        {
            javaEEInstance = javaEeComponentInstance;
            if(creationalContext == null)
            {
                ownerCreationalContext = (CreationalContextImpl<?>) beanManager.createCreationalContext(null);
            }

            Class<Object> injectableComponentClass = (Class<Object>)javaEeComponentInstance.getClass();

            //Look for custom InjectionTarget
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.