Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-805

Provide utils method to check if an context is active or not

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0
    • Core
    • None

    Description

      public boolean isContextActive(Class<? extends Annotation> scopeAnnotationClass)
      {
      try
      {
      BeanManager beanManager = BeanManagerProvider.getInstance().getBeanManager();

      if (beanManager.getContext(scopeAnnotationClass) == null || !beanManager.getContext(scopeAnnotationClass).isActive())

      { return false; }

      }
      catch (ContextNotActiveException cnae)

      { return false; }

      return true;
      }

      Any idea where i could add this method?

      Attachments

        Activity

          People

            tandraschko Thomas Andraschko
            tandraschko Thomas Andraschko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: