Class Activator

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

    public class Activator
    extends java.lang.Object
    implements org.osgi.framework.BundleActivator
    An explicit bundle activator providing access to the resources of this bundle.
    Author:
    Holger Eichelberger
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.osgi.framework.Bundle bundle  
      static java.lang.String BUNDLE_ID  
      static java.lang.String PROTOCOL_FILE  
    • Constructor Summary

      Constructors 
      Constructor Description
      Activator()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.net.URL[] getJars()
      Returns all library jars.
      static boolean isFileProtocol​(java.net.URL url)
      Returns whether url is using a file protocol.
      static java.net.URL resolve​(java.net.URL url)
      Resolves an URL.
      void start​(org.osgi.framework.BundleContext context)  
      void stop​(org.osgi.framework.BundleContext context)  
      • Methods inherited from class java.lang.Object

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

      • bundle

        private static org.osgi.framework.Bundle bundle
    • Constructor Detail

      • Activator

        public Activator()
    • Method Detail

      • start

        public void start​(org.osgi.framework.BundleContext context)
                   throws java.lang.Exception
        Specified by:
        start in interface org.osgi.framework.BundleActivator
        Throws:
        java.lang.Exception
      • stop

        public void stop​(org.osgi.framework.BundleContext context)
                  throws java.lang.Exception
        Specified by:
        stop in interface org.osgi.framework.BundleActivator
        Throws:
        java.lang.Exception
      • getJars

        public static java.net.URL[] getJars()
        Returns all library jars.
        Returns:
        all library jars (may be null if not found or not running as OSGi bundle)
      • isFileProtocol

        public static boolean isFileProtocol​(java.net.URL url)
        Returns whether url is using a file protocol.
        Parameters:
        url - the URL
        Returns:
        true if protocol is file, false else
      • resolve

        public static java.net.URL resolve​(java.net.URL url)
        Resolves an URL.
        Parameters:
        url - the URL to be resolved
        Returns:
        the resolved URL