Package javax.enterprise.context

Examples of javax.enterprise.context.ContextNotActiveException


                   CreationalContext<T> creationalContext)
  {
    TransactionImpl xa = _xaManager.getCurrent();

    if (xa == null || ! xa.isActive()) {
      throw new ContextNotActiveException(L.l("'{0}' cannot be created because @TransactionScoped requires an active transaction.",
                                              bean));
    }
   
    ScopeContext cxt = (ScopeContext) xa.getResource("caucho.xa.scope");
   
View Full Code Here


        this.hostNameThreadLocal.set(null);
    }

    public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
        if (!isActive()) {
            throw new ContextNotActiveException();
        }
        ContextualInstance<T> beanInstance = getBeanStore().get(contextual);
        if (beanInstance != null) {
            return beanInstance.getInstance();
        } else if (creationalContext != null) {
View Full Code Here

        return dialogueIdThreadLocal.get() != null;
    }

    public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
        if (!isActive()) {
            throw new ContextNotActiveException();
        }
        ContextualInstance<T> beanInstance = getBeanStore().get(contextual);
        if (beanInstance != null) {
            return beanInstance.getInstance();
        } else if (creationalContext != null) {
View Full Code Here

     */
    protected void checkActive()
    {
        if (!isActive())
        {
            throw new ContextNotActiveException("CDI context with scope annotation @"
                + getScope().getName() + " is not active with respect to the current thread");
        }
    }
View Full Code Here

        Map<Contextual, TransactionBeanEntry> transactionBeanEntryMap = getTransactionBeanEntryMap();

        if (transactionBeanEntryMap == null)
        {
            throw new ContextNotActiveException("Not accessed within a transactional method - use @" +
                    Transactional.class.getName());
        }

        TransactionBeanEntry transactionBeanEntry = transactionBeanEntryMap.get(component);
        if (transactionBeanEntry != null)
View Full Code Here

    protected ContextualStorage getContextualStorage(Contextual<?> contextual, boolean createIfNotExist)
    {
        String windowId = getCurrentWindowId();
        if (windowId == null)
        {
            throw new ContextNotActiveException("WindowContext: no windowId set for the current Thread yet!");
        }

        return windowBeanHolder.getContextualStorage(beanManager, windowId, createIfNotExist);
    }
View Full Code Here

        if (transactionBeanEntryMap == null)
        {
            TransactionBeanStorage.close();

            throw new ContextNotActiveException("Not accessed within a transactional method - use @" +
                    Transactional.class.getName());
        }

        TransactionBeanEntry transactionBeanEntry = transactionBeanEntryMap.get(component);
        if (transactionBeanEntry != null)
View Full Code Here

        if (transactionBeanEntryMap == null)
        {
            TransactionBeanStorage.close();

            throw new ContextNotActiveException("Not accessed within a transactional method - use @" +
                    Transactional.class.getName());
        }

        TransactionBeanEntry transactionBeanEntry = transactionBeanEntryMap.get(component);
        if (transactionBeanEntry != null)
View Full Code Here

                        return null;
                    }
                   
                    FlowBeanInfo fbi = flowIds.get(contextual);
                    if (!flowHandler.isActive(facesContext, fbi.definingDocumentId, fbi.id)) {
                        throw new ContextNotActiveException("Request to activate bean in flow '" + fbi + "', but that flow is not active.");
                    }

                   
                    result = contextual.create(creational);
                   
View Full Code Here

    {
        Map<Contextual, TransactionBeanEntry> transactionBeanEntryMap = beanStorage.getActiveTransactionContext();

        if (transactionBeanEntryMap == null)
        {
            throw new ContextNotActiveException("Not accessed within a transactional method - use @" +
                    Transactional.class.getName());
        }

        TransactionBeanEntry transactionBeanEntry = transactionBeanEntryMap.get(component);
        if (transactionBeanEntry != null)
View Full Code Here

TOP

Related Classes of javax.enterprise.context.ContextNotActiveException

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.