Class PropertiesClassLoader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class PropertiesClassLoader
    extends java.net.URLClassLoader
    A custom webAppOS class loader used by server-side web processors to find classes of webAppOS apps, services, and engines. Takes into a consideration classpaths configured in app.properties, service.properties, and engine.properties, if those classpaths have been added using addClasspathsForPropertiesId(java.lang.String).
    Author:
    Sergejs Kozlovics
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addClasspathsForPropertiesId​(java.lang.String id)
      Adds Java classpaths configured for the given web app, web service or web library.
      java.lang.Class<?> findClassByName​(java.lang.String fullName)
      Loads the given class taking into a consideration classpaths added using addClasspathsForPropertiesId(java.lang.String).
      java.lang.String getClasspathsForPropertiesId​(java.lang.String id)
      Returns a string of classpaths configured for the given app, service or engine.
      void loadLuaClasses​(java.lang.String path)  
      • Methods inherited from class java.net.URLClassLoader

        addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
      • Methods inherited from class java.security.SecureClassLoader

        defineClass, defineClass
      • Methods inherited from class java.lang.ClassLoader

        clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
      • Methods inherited from class java.lang.Object

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

      • PropertiesClassLoader

        public PropertiesClassLoader()
      • PropertiesClassLoader

        public PropertiesClassLoader​(java.net.URL[] arg0)
    • Method Detail

      • findClassByName

        public java.lang.Class<?> findClassByName​(java.lang.String fullName)
        Loads the given class taking into a consideration classpaths added using addClasspathsForPropertiesId(java.lang.String).
        Parameters:
        fullName - class full name, e.g., "org.example.MyClass"
        Returns:
        the loaded Java class, or null on error
      • addClasspathsForPropertiesId

        public void addClasspathsForPropertiesId​(java.lang.String id)
        Adds Java classpaths configured for the given web app, web service or web library.
        Parameters:
        id - [appName].webapp or [serviceName].webservice or [libName].weblibrary
      • getClasspathsForPropertiesId

        public java.lang.String getClasspathsForPropertiesId​(java.lang.String id)
        Returns a string of classpaths configured for the given app, service or engine. The string can be passed to JVM.
        Parameters:
        id - [appName].webapp or [serviceName].webservice or [libName].weblibrary
        Returns:
        a string of classpaths that can be directly passed to JVM
      • loadLuaClasses

        public void loadLuaClasses​(java.lang.String path)