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

org.ops4j.pax.runner.osgi.RunnerStartLevel Maven / Gradle / Ivy

Go to download

OPS4J Pax Runner - Core engine. See details at http://wiki.ops4j.org/confluence/x/A4A6.

There is a newer version: 1.9.0
Show newest version
package org.ops4j.pax.runner.osgi;

import org.apache.felix.framework.ServiceRegistry;
import org.osgi.framework.Bundle;
import org.osgi.service.startlevel.StartLevel;

public class RunnerStartLevel
    extends UnsupportedStartLevel
{

    /**
     * Installs itself as a service in felix service registry.
     *
     * @param serviceRegistry a felix service registry
     */
    public static void install( final ServiceRegistry serviceRegistry )
    {
        serviceRegistry.registerService(
            new UnsupportedBundle(),
            new String[]{ StartLevel.class.getName() },
            new RunnerStartLevel(),
            null
        );
    }

    /**
     * Sets the bundle start level if the bundle is a runner bundle.
     *
     * @see org.osgi.service.startlevel.StartLevel#setBundleStartLevel(org.osgi.framework.Bundle,int)
     */
    public void setBundleStartLevel( final Bundle bundle, final int startLevel )
    {
        if( !( bundle instanceof RunnerBundle ) )
        {
            super.setBundleStartLevel( bundle, startLevel );
        }
        ( (RunnerBundle) bundle ).setStartLevel( startLevel );
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy