类 CabinContainer


  • public class CabinContainer
    extends Object
    The entrance of starting cabin container, core class; Deploy modules, export shared classes, scan spi implementations, etc. Biz main class will be executed after all bizModule and modules have been loaded.
    • 构造器详细资料

      • CabinContainer

        public CabinContainer​(String containerURLString,
                              String[] moduleURLStrings,
                              String[] bizURLStrings,
                              String[] javaAgentURLStrings,
                              String[] args)
        instanced by bootstrap, launcher, Test runner; start the container services pipeline to deploy modules, start services; Should not pass any Object except primitives and String, because any Object like URL/JarFile would bring SystemClassLoader with it; for example, 'URL' will bring a Handler loaded by SystemClassLoader which would load other classes with SystemClassLoader; so we should not pass these Object, and make sure SystemClassLoader is no longer used. An example for this is: URL to Handler to openConnection, in this method,JarURLConnection would be loaded by SystemClassloader and JarURLConnection::useFastExceptions would always be false Because Handler:: setUseFastConnectionExceptions would set another JarURLConnection Class loaded by CabinClassLoader.

        this constructor is used while launching the application in classpath

        参数:
        containerURLString - the cabin core fat jar file path
        moduleURLStrings - the lib module fat jar file paths
        bizURLStrings - the biz classpath paths
        javaAgentURLStrings - the setup java agent jar file paths
        args - set up main args
      • CabinContainer

        public CabinContainer​(String executableURLString,
                              String[] javaAgentURLStrings,
                              String[] args)
        Same as previous constructor, except this is used while launching the application in fat jar; Create the biz URLs in CabinContainer, so the handler of the URL would bound to a JarFile, this will make the biz class loading faster;
        参数:
        executableURLString - the application executable fat jar
        javaAgentURLStrings - the setup java agent jar file paths
        args - set up main args
    • 方法详细资料

      • start

        public void start()
      • stop

        public void stop()
      • isStarted

        public boolean isStarted()
      • installModule

        public void installModule​(String libJarUrl)
      • uninstallModule

        public void uninstallModule​(String libJarUrl)
      • getExportedClasses

        public Map<String,​Class<?>> getExportedClasses()
      • moduleLoaded

        public boolean moduleLoaded​(String moduleName)
      • getLoadedModules

        public List<String> getLoadedModules()
      • getLibModuleClassLoader

        public ClassLoader getLibModuleClassLoader​(String moduleName)
      • getBizModuleClassLoader

        public ClassLoader getBizModuleClassLoader()