Examples of createCreationalContext()


Examples of javax.enterprise.inject.spi.BeanManager.createCreationalContext()

        BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager();
        Set<Bean<?>> beans = beanManager.getBeans(PreUpdateAuditListener.class);
        for (Bean<?> bean : beans)
        {
            PreUpdateAuditListener result = (PreUpdateAuditListener) beanManager.getReference(
                    bean, PreUpdateAuditListener.class, beanManager.createCreationalContext(bean));
            result.preUpdate(entity);
        }
    }

}
View Full Code Here

Examples of javax.enterprise.inject.spi.BeanManager.createCreationalContext()

            BeanProvider.injectFields(result); //fallback to simple injection
        }
        else
        {
            Bean<Object> bean = (Bean<Object>) beanManager.resolve(beans);
            CreationalContext<Object> creationalContext = beanManager.createCreationalContext(bean);
            result = beanManager.getReference(bean, type, creationalContext);
        }
        return result;
    }
View Full Code Here

Examples of javax.enterprise.inject.spi.BeanManager.createCreationalContext()

            }
            else
            {
                Bean<Object> bean = (Bean<Object>) beanManager.resolve(beans);

                CreationalContext<Object> creationalContext = beanManager.createCreationalContext(bean);

                Object target = beanManager.getReference(bean, type, creationalContext);

                try
                {
View Full Code Here

Examples of javax.enterprise.inject.spi.BeanManager.createCreationalContext()

            try {
                SecurityActions.setContextClassLoader(classLoader);
                //it does not matter if this happens twice
                final BeanManager beanManager = weldContainer.getValue().getBeanManager();
                final Bean<?> bean = beanManager.resolve(beanManager.getBeans(EjbRequestContext.class, EjbLiteral.INSTANCE));
                final CreationalContext<?> ctx = beanManager.createCreationalContext(bean);
                requestContext = (EjbRequestContext) beanManager.getReference(bean, EjbRequestContext.class, ctx);
            } finally {
                SecurityActions.setContextClassLoader(tccl);
            }
        }
View Full Code Here

Examples of javax.enterprise.inject.spi.BeanManager.createCreationalContext()

            if (manager != null && Container.available()) {

                final Bean<BoundSessionContext> sessionContextBean = (Bean<BoundSessionContext>) manager.resolve(manager
                        .getBeans(BoundSessionContext.class, BoundLiteral.INSTANCE));
                CreationalContext<?> ctx = manager.createCreationalContext(sessionContextBean);
                final BoundSessionContext sessionContext = (BoundSessionContext) manager.getReference(sessionContextBean,
                        BoundSessionContext.class, ctx);
                sessionContext.associate(sessionContexts.get());
                sessionContext.activate();
View Full Code Here

Examples of javax.enterprise.inject.spi.BeanManager.createCreationalContext()

                sessionContext.associate(sessionContexts.get());
                sessionContext.activate();

                final Bean<BoundRequestContext> requestContextBean = (Bean<BoundRequestContext>) manager.resolve(manager
                        .getBeans(BoundRequestContext.class, BoundLiteral.INSTANCE));
                ctx = manager.createCreationalContext(requestContextBean);
                final BoundRequestContext requestContext = (BoundRequestContext) manager.getReference(requestContextBean,
                        BoundRequestContext.class, ctx);
                requestContext.associate(requestContexts.get());
                requestContext.activate();
View Full Code Here

Examples of javax.enterprise.inject.spi.BeanManager.createCreationalContext()

                requestContext.associate(requestContexts.get());
                requestContext.activate();

                final Bean<BoundConversationContext> conversationContextBean = (Bean<BoundConversationContext>) manager
                        .resolve(manager.getBeans(BoundConversationContext.class, BoundLiteral.INSTANCE));
                ctx = manager.createCreationalContext(conversationContextBean);
                final BoundConversationContext conversationContext = (BoundConversationContext) manager.getReference(
                        conversationContextBean, BoundConversationContext.class, ctx);
                BoundRequest request = new MutableBoundRequest(requestContexts.get(), sessionContexts.get());
                boundRequests.set(request);
                conversationContext.associate(request);
View Full Code Here

Examples of javax.enterprise.inject.spi.BeanManager.createCreationalContext()

            final BeanManager manager = (BeanManager) new InitialContext().lookup("java:comp/BeanManager");

            if (manager != null && Container.available()) {
                final Bean<BoundSessionContext> sessionContextBean = (Bean<BoundSessionContext>) manager.resolve(manager.getBeans(
                        BoundSessionContext.class, BoundLiteral.INSTANCE));
                CreationalContext<?> ctx = manager.createCreationalContext(sessionContextBean);
                final BoundSessionContext sessionContext = (BoundSessionContext) manager.getReference(sessionContextBean,
                        BoundSessionContext.class, ctx);
                sessionContext.deactivate();
                sessionContext.dissociate(sessionContexts.get());
View Full Code Here

Examples of javax.enterprise.inject.spi.BeanManager.createCreationalContext()

                sessionContext.deactivate();
                sessionContext.dissociate(sessionContexts.get());

                final Bean<BoundRequestContext> requestContextBean = (Bean<BoundRequestContext>) manager.resolve(manager.getBeans(
                        BoundRequestContext.class, BoundLiteral.INSTANCE));
                ctx = manager.createCreationalContext(requestContextBean);
                final BoundRequestContext requestContext = (BoundRequestContext) manager.getReference(requestContextBean,
                        BoundRequestContext.class, ctx);
                requestContext.deactivate();
                requestContext.dissociate(requestContexts.get());
View Full Code Here

Examples of javax.enterprise.inject.spi.BeanManager.createCreationalContext()

                requestContext.deactivate();
                requestContext.dissociate(requestContexts.get());

                final Bean<BoundConversationContext> conversationContextBean = (Bean<BoundConversationContext>) manager
                        .resolve(manager.getBeans(BoundConversationContext.class, BoundLiteral.INSTANCE));
                ctx = manager.createCreationalContext(conversationContextBean);
                final BoundConversationContext conversationContext = (BoundConversationContext) manager.getReference(
                        conversationContextBean, BoundConversationContext.class, ctx);
                conversationContext.deactivate();
                conversationContext.dissociate(boundRequests.get());
            }
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.