private boolean isBundleActive()

in src/main/java/org/apache/sling/commons/classloader/impl/PackageAdminClassLoader.java [84:101]


    private boolean isBundleActive( final Bundle bundle ) {
        if ( bundle != null ) {
            if ( bundle.getState() == Bundle.ACTIVE ) {
                return true;
            }

            if ( bundle.getState() == Bundle.STARTING ) {
                // according to the spec the activationPolicy header is only
                // set to request a bundle to be lazily activated. So in this
                // simple check we just verify the header is set to assume
                // the bundle is considered a lazily activated bundle
                return bundle.getHeaders().get( Constants.BUNDLE_ACTIVATIONPOLICY ) != null;
            }
        }

        // fall back: bundle is not considered active
        return false;
    }