You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Thomas Andraschko (JIRA)" <ji...@apache.org> on 2015/02/13 15:38:11 UTC
[jira] [Resolved] (DELTASPIKE-805) Provide utils method to check if
an context is active or not
[ https://issues.apache.org/jira/browse/DELTASPIKE-805?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Andraschko resolved DELTASPIKE-805.
------------------------------------------
Resolution: Fixed
> Provide utils method to check if an context is active or not
> ------------------------------------------------------------
>
> Key: DELTASPIKE-805
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-805
> Project: DeltaSpike
> Issue Type: Improvement
> Components: Core
> Reporter: Thomas Andraschko
> Assignee: Thomas Andraschko
> Fix For: 1.2.2
>
>
> 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?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)