All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.dynamicextensionsalfresco.osgi.BundleUtils Maven / Gradle / Ivy

Go to download

Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features

There is a newer version: 3.1.0
Show newest version
package com.github.dynamicextensionsalfresco.osgi;

import com.springsource.util.osgi.manifest.BundleManifest;
import com.springsource.util.osgi.manifest.BundleManifestFactory;
import org.osgi.framework.Bundle;

public class BundleUtils {

    private BundleUtils() {
    }

    public static String getBundleStateDescription(int bundleState) {
        switch (bundleState) {
            case Bundle.UNINSTALLED:
                return "uninstalled";
            case Bundle.INSTALLED:
                return "installed";
            case Bundle.RESOLVED:
                return "resolved";
            case Bundle.STARTING:
                return "starting";
            case Bundle.STOPPING:
                return "stopping";
            case Bundle.ACTIVE:
                return "active";
            default:
                return "unknown";
        }
    }

    public static Boolean isActive(Bundle bundle) { return bundle.getState() == Bundle.ACTIVE; }
    public static BundleManifest createManifest(Bundle bundle) {
        return BundleManifestFactory.createBundleManifest(bundle.getHeaders());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy