Class Activator

  • All Implemented Interfaces:
    org.osgi.framework.BundleActivator

    public class Activator
    extends java.lang.Object
    implements org.osgi.framework.BundleActivator
    OSGi activator. It registers the NRE into the Restlet API and also introspect the bundles to find connector or authentication helpers.
    • Constructor Summary

      Constructors 
      Constructor Description
      Activator()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void registerHelper​(org.osgi.framework.Bundle bundle, java.util.List<?> helpers, java.lang.Class<?> constructorClass, java.lang.String descriptorPath)
      Registers the helpers for a given bundle.
      private void registerHelper​(org.osgi.framework.Bundle bundle, java.util.List<?> helpers, java.lang.Class<?> constructorClass, java.net.URL descriptorUrl)
      Registers the helpers for a given bundle.
      private void registerHelpers​(org.osgi.framework.Bundle bundle)
      Registers the helpers for a given bundle.
      void start​(org.osgi.framework.BundleContext context)
      Starts the OSGi bundle by registering the engine with the bundle of the Restlet API.
      void stop​(org.osgi.framework.BundleContext context)
      Stops the OSGi bundle by unregistering the engine with the bundle of the Restlet API.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Activator

        public Activator()
    • Method Detail

      • registerHelper

        private void registerHelper​(org.osgi.framework.Bundle bundle,
                                    java.util.List<?> helpers,
                                    java.lang.Class<?> constructorClass,
                                    java.lang.String descriptorPath)
        Registers the helpers for a given bundle.
        Parameters:
        bundle - The bundle to inspect.
        helpers - The helpers list to update.
        constructorClass - The class to use as constructor parameter.
        descriptorPath - The descriptor file path.
      • registerHelper

        private void registerHelper​(org.osgi.framework.Bundle bundle,
                                    java.util.List<?> helpers,
                                    java.lang.Class<?> constructorClass,
                                    java.net.URL descriptorUrl)
        Registers the helpers for a given bundle.
        Parameters:
        bundle - The bundle to inspect.
        helpers - The helpers list to update.
        constructorClass - The class to use as constructor parameter.
        descriptorUrl - The descriptor URL to inspect.
      • registerHelpers

        private void registerHelpers​(org.osgi.framework.Bundle bundle)
        Registers the helpers for a given bundle.
        Parameters:
        bundle - The bundle to inspect.
      • start

        public void start​(org.osgi.framework.BundleContext context)
                   throws java.lang.Exception
        Starts the OSGi bundle by registering the engine with the bundle of the Restlet API.
        Specified by:
        start in interface org.osgi.framework.BundleActivator
        Parameters:
        context - The bundle context.
        Throws:
        java.lang.Exception
      • stop

        public void stop​(org.osgi.framework.BundleContext context)
                  throws java.lang.Exception
        Stops the OSGi bundle by unregistering the engine with the bundle of the Restlet API.
        Specified by:
        stop in interface org.osgi.framework.BundleActivator
        Parameters:
        context - The bundle context.
        Throws:
        java.lang.Exception