pax-shiro-cdi/src/main/java/org/ops4j/pax/shiro/cdi/impl/BeanManagerProvider.java
public static BeanManager getBeanManager() {
        try {
            InitialContext initialContext = new InitialContext();
            return (BeanManager) initialContext.lookup("java:comp/BeanManager");
        }
        catch (NamingException e) {
            if (beanManager != null) {
                return beanManager;
            }
            throw new IllegalStateException(
                "BeanManager not found in JNDI and not set via setBeanManager()");
        }
    }
public static BeanManager getBeanManager() {
        try {
            InitialContext initialContext = new InitialContext();
            return (BeanManager) initialContext.lookup("java:comp/BeanManager");
        }
        catch (NamingException e) {
            if (beanManager != null) {
                return beanManager;
            }
            throw new IllegalStateException(
                "BeanManager not found in JNDI and not set via setBeanManager()");
        }
    }
Looks up the current bean manager in JNDI, or returns the value set by
{@link #setBeanManager(BeanManager)} as fallback.

@return