private BeanManagerImpl obtainBeanManager(InvocationContext invocation) { Object value = invocation.getContextData().get(Container.CONTEXT_ID_KEY); String contextId = RegistrySingletonProvider.STATIC_INSTANCE; if (value instanceof String) { contextId = (String) value; } return Container.instance(contextId).deploymentManager(); }
private BeanManagerImpl obtainBeanManager(InvocationContext invocation) { Object value = invocation.getContextData().get(Container.CONTEXT_ID_KEY); String contextId = RegistrySingletonProvider.STATIC_INSTANCE; if (value instanceof String) { contextId = (String) value; } return Container.instance(contextId).deploymentManager(); }
public AbstractConversationContext(String contextId, ServiceRegistry services) { super(contextId, true); this.parameterName = new AtomicReference<String>(PARAMETER_NAME); WeldConfiguration configuration = services.get(WeldConfiguration.class); this.defaultTimeout = new AtomicLong(configuration.getLongProperty(ConfigurationKey.CONVERSATION_TIMEOUT)); this.concurrentAccessTimeout = new AtomicLong(configuration.getLongProperty(ConfigurationKey.CONVERSATION_CONCURRENT_ACCESS_TIMEOUT)); this.associated = new ThreadLocal<R>(); this.manager = Container.instance(contextId).deploymentManager(); this.beanIdentifierIndex = services.get(BeanIdentifierIndex.class); }
public AbstractConversationContext(String contextId, ServiceRegistry services) { super(contextId, true); this.parameterName = new AtomicReference<String>(PARAMETER_NAME); WeldConfiguration configuration = services.get(WeldConfiguration.class); this.defaultTimeout = new AtomicLong(configuration.getLongProperty(ConfigurationKey.CONVERSATION_TIMEOUT)); this.concurrentAccessTimeout = new AtomicLong(configuration.getLongProperty(ConfigurationKey.CONVERSATION_CONCURRENT_ACCESS_TIMEOUT)); this.associated = new ThreadLocal<R>(); this.manager = Container.instance(contextId).deploymentManager(); this.beanIdentifierIndex = services.get(BeanIdentifierIndex.class); }
public AbstractConversationContext(String contextId, ServiceRegistry services) { super(contextId, true); this.parameterName = new AtomicReference<String>(PARAMETER_NAME); WeldConfiguration configuration = services.get(WeldConfiguration.class); this.defaultTimeout = new AtomicLong(configuration.getLongProperty(ConfigurationKey.CONVERSATION_TIMEOUT)); this.concurrentAccessTimeout = new AtomicLong(configuration.getLongProperty(ConfigurationKey.CONVERSATION_CONCURRENT_ACCESS_TIMEOUT)); this.associated = new ThreadLocal<R>(); this.manager = Container.instance(contextId).deploymentManager(); this.beanIdentifierIndex = services.get(BeanIdentifierIndex.class); }
public AbstractConversationContext(String contextId, ServiceRegistry services) { super(contextId, true); this.parameterName = new AtomicReference<String>(PARAMETER_NAME); WeldConfiguration configuration = services.get(WeldConfiguration.class); this.defaultTimeout = new AtomicLong(configuration.getLongProperty(ConfigurationKey.CONVERSATION_TIMEOUT)); this.concurrentAccessTimeout = new AtomicLong(configuration.getLongProperty(ConfigurationKey.CONVERSATION_CONCURRENT_ACCESS_TIMEOUT)); this.associated = new ThreadLocal<R>(); this.manager = Container.instance(contextId).deploymentManager(); this.beanIdentifierIndex = services.get(BeanIdentifierIndex.class); }
public AbstractConversationContext(String contextId, ServiceRegistry services) { super(contextId, true); this.parameterName = new AtomicReference<String>(PARAMETER_NAME); WeldConfiguration configuration = services.get(WeldConfiguration.class); this.defaultTimeout = new AtomicLong(configuration.getLongProperty(ConfigurationKey.CONVERSATION_TIMEOUT)); this.concurrentAccessTimeout = new AtomicLong(configuration.getLongProperty(ConfigurationKey.CONVERSATION_CONCURRENT_ACCESS_TIMEOUT)); this.associated = new ThreadLocal<R>(); this.manager = Container.instance(contextId).deploymentManager(); this.beanIdentifierIndex = services.get(BeanIdentifierIndex.class); }
public RequestContext getRequestContext() { if (AbstractTest.isInContainer()) { return Container.instance().deploymentManager().instance().select(HttpRequestContext.class).get(); } else { return Container.instance().deploymentManager().instance().select(RequestContext.class, UnboundLiteral.INSTANCE).get(); } }
public RequestContext getRequestContext() { if (AbstractTest.isInContainer()) { return Container.instance().deploymentManager().instance().select(HttpRequestContext.class).get(); } else { return Container.instance().deploymentManager().instance().select(RequestContext.class, UnboundLiteral.INSTANCE).get(); } }
public Instance<Context> instance() { // This is safe -- context beans are *always* available return Container.instance().deploymentManager().instance().select(Context.class); }
public Instance<Context> instance() { // This is safe -- context beans are *always* available return Container.instance().deploymentManager().instance().select(Context.class); }
private static Instance<Context> instance(String id) { return Container.instance(id).deploymentManager().instance().select(Context.class); } }
private static Instance<Context> instance(String id) { return Container.instance(id).deploymentManager().instance().select(Context.class); } }
protected AnnotatedTypeLoader createAnnotatedTypeLoader() { if (classFileServices != null) { // Since FastProcessAnnotatedTypeResolver is installed after BeanDeployers are created, we need to query deploymentManager's services instead of the manager of this deployer final FastProcessAnnotatedTypeResolver resolver = Container.instance(getManager()).deploymentManager().getServices() .get(FastProcessAnnotatedTypeResolver.class); if (resolver != null) { return new FastAnnotatedTypeLoader(getManager(), classTransformer, classFileServices, containerLifecycleEvents, resolver); } } // if FastProcessAnnotatedTypeResolver is not available, fall back to AnnotatedTypeLoader return new AnnotatedTypeLoader(getManager(), classTransformer, containerLifecycleEvents); }
protected AnnotatedTypeLoader createAnnotatedTypeLoader() { if (classFileServices != null) { // Since FastProcessAnnotatedTypeResolver is installed after BeanDeployers are created, we need to query deploymentManager's services instead of the manager of this deployer final FastProcessAnnotatedTypeResolver resolver = Container.instance(getManager()).deploymentManager().getServices() .get(FastProcessAnnotatedTypeResolver.class); if (resolver != null) { return new FastAnnotatedTypeLoader(getManager(), classTransformer, classFileServices, containerLifecycleEvents, resolver); } } // if FastProcessAnnotatedTypeResolver is not available, fall back to AnnotatedTypeLoader return new AnnotatedTypeLoader(getManager(), classTransformer, containerLifecycleEvents); }
protected AnnotatedTypeLoader createAnnotatedTypeLoader() { if (classFileServices != null) { // Since FastProcessAnnotatedTypeResolver is installed after BeanDeployers are created, we need to query deploymentManager's services instead of the manager of this deployer final FastProcessAnnotatedTypeResolver resolver = Container.instance(getManager()).deploymentManager().getServices() .get(FastProcessAnnotatedTypeResolver.class); if (resolver != null) { return new FastAnnotatedTypeLoader(getManager(), classTransformer, classFileServices, containerLifecycleEvents, resolver); } } // if FastProcessAnnotatedTypeResolver is not available, fall back to AnnotatedTypeLoader return new AnnotatedTypeLoader(getManager(), classTransformer, containerLifecycleEvents); }
/** * Always returns the original proxy object that was serialized. * * @return the proxy object * @throws java.io.ObjectStreamException */ Object readResolve() throws ObjectStreamException { Bean<?> bean = Container.instance(contextId).services().get(ContextualStore.class).<Bean<Object>, Object>getContextual(beanId); if (bean == null) { throw BeanLogger.LOG.proxyDeserializationFailure(beanId); } return Container.instance(contextId).deploymentManager().getClientProxyProvider().getClientProxy(bean); }
protected AnnotatedTypeLoader createAnnotatedTypeLoader() { if (classFileServices != null) { // Since FastProcessAnnotatedTypeResolver is installed after BeanDeployers are created, we need to query deploymentManager's services instead of the manager of this deployer final FastProcessAnnotatedTypeResolver resolver = Container.instance(getManager()).deploymentManager().getServices() .get(FastProcessAnnotatedTypeResolver.class); if (resolver != null) { return new FastAnnotatedTypeLoader(getManager(), classTransformer, classFileServices, containerLifecycleEvents, resolver); } } // if FastProcessAnnotatedTypeResolver is not available, fall back to AnnotatedTypeLoader return new AnnotatedTypeLoader(getManager(), classTransformer, containerLifecycleEvents); }
protected AnnotatedTypeLoader createAnnotatedTypeLoader() { if (classFileServices != null) { // Since FastProcessAnnotatedTypeResolver is installed after BeanDeployers are created, we need to query deploymentManager's services instead of the manager of this deployer final FastProcessAnnotatedTypeResolver resolver = Container.instance(getManager()).deploymentManager().getServices() .get(FastProcessAnnotatedTypeResolver.class); if (resolver != null) { return new FastAnnotatedTypeLoader(getManager(), classTransformer, classFileServices, containerLifecycleEvents, resolver); } } // if FastProcessAnnotatedTypeResolver is not available, fall back to AnnotatedTypeLoader return new AnnotatedTypeLoader(getManager(), classTransformer, containerLifecycleEvents); }
/** * Always returns the original proxy object that was serialized. * * @return the proxy object * @throws java.io.ObjectStreamException */ Object readResolve() throws ObjectStreamException { Bean<?> bean = Container.instance(contextId).services().get(ContextualStore.class).<Bean<Object>, Object>getContextual(beanId); if (bean == null) { throw BeanLogger.LOG.proxyDeserializationFailure(beanId); } return Container.instance(contextId).deploymentManager().getClientProxyProvider().getClientProxy(bean); }