Examples of ContextNotActiveException


Examples of com.m4f.business.service.exception.ContextNotActiveException

  private <T extends Object> T getService(Class<T> clazz)
    throws ServiceNotFoundException, ContextNotActiveException {
    T bean = null;
    try {
      if(!this.servicesCtx.isRunning()) {
        throw new ContextNotActiveException("#### Context is not RUNNING....");
      }
      if(!this.servicesCtx.isActive()) {
        throw new ContextNotActiveException("#### Context is not ACTIVE....");
      }
      bean = this.servicesCtx.getBean(clazz);
    } catch(NoSuchBeanDefinitionException ex) {
      this.servicesCtx.setConfigLocation("services-config.xml");
      this.servicesCtx.stop();
View Full Code Here

Examples of javax.context.ContextNotActiveException

       

        // Still null
        if (contexts.isEmpty())
        {
            throw new ContextNotActiveException("WebBeans context with scope type annotation @" + scopType.getSimpleName() + " is not exist within current thread");
        }
       
        else if(contexts.size() > 1)
        {
            throw new IllegalStateException("More than one context exist with scope type annotation @" + scopType.getSimpleName());
View Full Code Here

Examples of javax.context.ContextNotActiveException

       

        // Still null
        if (contexts.isEmpty())
        {
            throw new ContextNotActiveException("WebBeans context with scope type annotation @" + scopeType.getSimpleName() + " does not exist within current thread");
        }
       
        else if(contexts.size() > 1)
        {
            throw new IllegalStateException("More than one active context exists with scope type annotation @" + scopeType.getSimpleName());
View Full Code Here

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

Examples of javax.enterprise.context.ContextNotActiveException

        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

Examples of javax.enterprise.context.ContextNotActiveException

        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

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

        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

Examples of javax.enterprise.context.ContextNotActiveException

    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

Examples of javax.enterprise.context.ContextNotActiveException

        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
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.