Examples of ContextNotActiveException


Examples of javax.enterprise.context.ContextNotActiveException

    {
        Map<Contextual, TransactionBeanEntry> transactionBeanEntryMap = getBeanStorage().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

Examples of javax.enterprise.context.ContextNotActiveException

    {
        Map<Contextual, TransactionBeanEntry> transactionBeanEntryMap = getBeanStorage().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

Examples of javax.enterprise.context.ContextNotActiveException

        try {
            InitialContext initialContext = new InitialContext();
            transactionSynchronizationRegistry =
                    (TransactionSynchronizationRegistry) initialContext.lookup(TRANSACTION_SYNCHRONIZATION_REGISTRY_JNDI_NAME);
        } catch (NamingException ne) {
            throw new ContextNotActiveException("Could not get TransactionSynchronizationRegistry", ne);
        }

        int status = transactionSynchronizationRegistry.getTransactionStatus();
        if (status == Status.STATUS_ACTIVE ||
                status == Status.STATUS_MARKED_ROLLBACK ||
                status == Status.STATUS_PREPARED ||
                status == Status.STATUS_UNKNOWN ||
                status == Status.STATUS_PREPARING ||
                status == Status.STATUS_COMMITTING ||
                status == Status.STATUS_ROLLING_BACK) {
            return transactionSynchronizationRegistry;
        }

        throw new ContextNotActiveException("TransactionSynchronizationRegistry status is not active.");
    }
View Full Code Here

Examples of javax.enterprise.context.ContextNotActiveException

        try {
            InitialContext initialContext = new InitialContext();
            transactionSynchronizationRegistry =
                (TransactionSynchronizationRegistry) initialContext.lookup(TRANSACTION_SYNCHRONIZATION_REGISTRY_JNDI_NAME);
        } catch (NamingException ne) {
            throw new ContextNotActiveException("Could not get TransactionSynchronizationRegistry", ne);
        }

        int status = transactionSynchronizationRegistry.getTransactionStatus();
        if ( status == Status.STATUS_ACTIVE ||
             status == Status.STATUS_MARKED_ROLLBACK ||
             status == Status.STATUS_PREPARED ||
             status == Status.STATUS_UNKNOWN ||
             status == Status.STATUS_PREPARING ||
             status == Status.STATUS_COMMITTING ||
             status == Status.STATUS_ROLLING_BACK ) {
            return transactionSynchronizationRegistry;
        }

        throw new ContextNotActiveException("TransactionSynchronizationRegistry status is not active.");
    }
View Full Code Here

Examples of javax.enterprise.context.ContextNotActiveException

    }

    @Override
    protected void checkActive() {
        if (!isActive()) {
            throw new ContextNotActiveException("Context with scope annotation @" + getScope().getName() + " is not active");
        }
    }
View Full Code Here

Examples of javax.enterprise.context.ContextNotActiveException

   private void assertActive()
   {
      if (!isActive())
      {
         throw new ContextNotActiveException(
                  "Context with scope annotation @ProjectScoped is not active with respect to the current directory.");
      }
   }
View Full Code Here

Examples of javax.enterprise.context.ContextNotActiveException

   private void assertActive()
   {
      if (!isActive())
      {
         throw new ContextNotActiveException(
                  "Context with scope annotation @ProjectScoped is not active with respect to the current directory.");
      }
   }
View Full Code Here

Examples of javax.enterprise.context.ContextNotActiveException

    protected ViewScopeContextualStorage getContextualStorage(boolean createIfNotExist)
    {
        String viewScopeId = getCurrentViewScopeId(createIfNotExist);
        if (createIfNotExist && viewScopeId == null)
        {
            throw new ContextNotActiveException(
                "ViewScopeContextImpl: no viewScopeId set for the current view yet!");
        }
        if (viewScopeId != null)
        {
            return getViewScopeBeanHolder().getContextualStorage(beanManager, viewScopeId);
View Full Code Here

Examples of javax.enterprise.context.ContextNotActiveException

     */
    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

Examples of javax.enterprise.context.ContextNotActiveException

    {
        //FacesContext facesContext = FacesContext.getCurrentInstance();
        //String clientWindowFlowId = getCurrentClientWindowFlowId(facesContext);
        if (clientWindowFlowId == null)
        {
            throw new ContextNotActiveException("FlowScopedContextImpl: no current active flow");
        }

        if (createIfNotExist)
        {
            return getFlowScopeBeanHolder().getContextualStorage(beanManager, clientWindowFlowId);
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.