Class OSGIListener.ClassCodeBaseHandlerImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String PREFIX  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void classNotFoundInBundle​(java.lang.String name)  
      private void classNotFoundInBundleVersion​(java.lang.String cname, java.lang.String bname, java.lang.String version)  
      private void couldNotLoadClassInBundle​(java.lang.ClassNotFoundException exc, java.lang.String className, java.lang.String bname)  
      private void foundClassInBundleVersion​(java.lang.Class<?> cls, java.lang.String name, java.lang.String version)  
      private void foundClassInBundleVersion​(java.lang.String cname, java.lang.String bname, java.lang.String version)  
      java.lang.String getCodeBase​(java.lang.Class<?> cls)
      Returns some sort of codebase for the given class, or null.
      java.lang.Class<?> loadClass​(java.lang.String codebase, java.lang.String className)
      load a class given the classname and a codebase.
      • Methods inherited from class java.lang.Object

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

      • ClassCodeBaseHandlerImpl

        private ClassCodeBaseHandlerImpl()
    • Method Detail

      • classNotFoundInBundle

        @InfoMethod
        private void classNotFoundInBundle​(java.lang.String name)
      • foundClassInBundleVersion

        @InfoMethod
        private void foundClassInBundleVersion​(java.lang.Class<?> cls,
                                               java.lang.String name,
                                               java.lang.String version)
      • getCodeBase

        public java.lang.String getCodeBase​(java.lang.Class<?> cls)
        Description copied from interface: ClassCodeBaseHandler
        Returns some sort of codebase for the given class, or null. It is expected that, if str is the result of getCodeBase( cls ), then loadClass( str, cls.getClassName() ) will return cls.
        Specified by:
        getCodeBase in interface ClassCodeBaseHandler
        Parameters:
        cls - Class for which we need a codebase
        Returns:
        A codebase to use with this handler, or null if this handler does not apply to this class.
      • couldNotLoadClassInBundle

        @InfoMethod
        private void couldNotLoadClassInBundle​(java.lang.ClassNotFoundException exc,
                                               java.lang.String className,
                                               java.lang.String bname)
      • foundClassInBundleVersion

        @InfoMethod
        private void foundClassInBundleVersion​(java.lang.String cname,
                                               java.lang.String bname,
                                               java.lang.String version)
      • classNotFoundInBundleVersion

        @InfoMethod
        private void classNotFoundInBundleVersion​(java.lang.String cname,
                                                  java.lang.String bname,
                                                  java.lang.String version)
      • loadClass

        public java.lang.Class<?> loadClass​(java.lang.String codebase,
                                            java.lang.String className)
        Description copied from interface: ClassCodeBaseHandler
        load a class given the classname and a codebase. The className will always satisfy cls.getClassName().equals( className ) if the call succeeds and returns a Class.
        Specified by:
        loadClass in interface ClassCodeBaseHandler
        Parameters:
        codebase - A string that somehow describes which ClassLoader to use. For example, the string could be an ordinary URL that a URL ClassLoader can use, or something more specialized, such as a description of an OSGi bundles and version.
        className - The name of the class to load
        Returns:
        The loaded class, or null if the class could not be loaded.