Package org.jboss.weld

Examples of org.jboss.weld.Container


      Reference reference = (Reference) o;
      StringRefAddr refAddr = (StringRefAddr) reference.get(JndiBinder.REFADDR_ID);
      String beanManagerId = (String)refAddr.getContent();
      if (Container.available())
      {
         Container container = Container.instance();

         for (Map.Entry<BeanDeploymentArchive, BeanManagerImpl> mapElement : container.beanDeploymentArchives().entrySet())
         {
            if (mapElement.getKey().getId().equals(beanManagerId))
            {
               return mapElement.getValue().getCurrent();
            }
View Full Code Here


        containers.remove(container);
    }

    @Override
    public CDI<Object> getCDI() {
        final Container container = Container.instance();
        checkContainerState(container);
        return containers.get(container);
    }
View Full Code Here

        this.instanceType = computeInstanceType(bean);
        BeanLogger.LOG.createdContextInstance(bean, id);
    }

    public T getInstance() {
        Container container = Container.instance(contextId);
        if (bean == null) {
            bean = container.services().get(ContextualStore.class).<Bean<T>, T>getContextual(id);
        }
        Context context = container.deploymentManager().getContext(bean.getScope());

        T existingInstance = context.get(bean);
        if (existingInstance != null) {
            return existingInstance;
        }

        WeldCreationalContext<T> creationalContext;
        WeldCreationalContext<?> previousCreationalContext = currentCreationalContext.get();
        if (previousCreationalContext == null) {
            creationalContext = new CreationalContextImpl<T>(bean);
        } else {
            creationalContext = previousCreationalContext.getCreationalContext(bean);
        }
        final CurrentInjectionPoint currentInjectionPoint = container.services().get(CurrentInjectionPoint.class);
        currentCreationalContext.set(creationalContext);
        try {
            // Ensure that there is no injection point associated
            currentInjectionPoint.push(EmptyInjectionPoint.INSTANCE);
            return context.get(bean, creationalContext);
View Full Code Here

     */
    private ConversationContext getConversationContext(String id) {
        if (conversationContext == null) {
            synchronized (this) {
                if (conversationContext == null) {
                    Container container = Container.instance(id);
                    conversationContext = container.deploymentManager().instance().select(HttpConversationContext.class).get();
                }
            }
        }
        return conversationContext;
    }
View Full Code Here

        } finally {
            try {
                // Finally, the container must fire an event of type BeforeShutdown.
                BeforeShutdownImpl.fire(deploymentManager);
            } finally {
                Container container = Container.instance(contextId);
                container.setState(ContainerState.SHUTDOWN);
                container.cleanup();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.weld.Container

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.