private static void boot(final String[] args, final ThreadGroup tg)
   {
      try
      {
         Properties properties = loadProperties();

         List<String> order = new ArrayList<String>(5);
         order.add(".xml");
         order.add(".rar");
         order.add("-ra.xml");
         order.add("-ds.xml");
         order.add(".war");

         KernelConfiguration kernelConfiguration = new KernelConfiguration();
         String configurationName = configurationString(properties, "name", DEFAULT_NAME);

         kernelConfiguration = kernelConfiguration.name(configurationName);
         kernelConfiguration = kernelConfiguration.classLoader(ClassLoaderFactory.TYPE_PARENT_FIRST);

         kernelConfiguration =
            kernelConfiguration.management(configurationBoolean(properties, "management", true));

         kernelConfiguration = 
            kernelConfiguration.parallelDeploy(configurationBoolean(properties, "parallel.deploy", true));

         kernelConfiguration =
            kernelConfiguration.remoteAccess(configurationBoolean(properties, "remote.access", true));

         kernelConfiguration =
            kernelConfiguration.remotePort(configurationInteger(properties, "remote.port", 1202));

         kernelConfiguration = kernelConfiguration.eventListener(new PreClassLoaderEventListener());
         kernelConfiguration = kernelConfiguration.eventListener(new PostClassLoaderEventListener());
         kernelConfiguration = kernelConfiguration.command(new Shutdown());
         kernelConfiguration = kernelConfiguration.deploymentOrder(new DeploymentOrder(order));

         kernelConfiguration = 
            kernelConfiguration.remoteJmxAccess(configurationBoolean(properties, "remote.jmx.access", true));

         kernelConfiguration = 
            kernelConfiguration.usePlatformMBeanServer(configurationBoolean(properties, "use.platform.mbeanserver",
                                                                            true));

         kernelConfiguration = 
            kernelConfiguration.beanManagement(configurationBoolean(properties, "bean.management", true));

         applySystemProperties(properties);

         String home = SecurityActions.getSystemProperty(configurationName + ".home");
         if (home != null)
         {
            kernelConfiguration.home(new File(home).toURI().toURL());
         }
         else
         {
            home = new File(".").toURI().toURL().toString();
            File root = new File(new URI(home.substring(0, home.lastIndexOf("bin"))));
            kernelConfiguration.home(root.toURI().toURL());
         }

         if (args != null && args.length > 0)
         {
            for (int i = 0; i < args.length; i++)
            {
               if ("-b".equals(args[i]))
               {
                  kernelConfiguration.bindAddress(args[++i]);
               }
            }
         }

         if (tg != null)
            kernelConfiguration.threadGroup(tg);

         kernel = KernelFactory.create(kernelConfiguration);
         kernel.startup();

         initLogging(SecurityActions.getThreadContextClassLoader());
      }
      catch (Throwable t)
      {
         error(t.getMessage(), t);
      }
   }
private static void boot ( final String [ ] args , final ThreadGroup tg ) { try { Properties properties = loadProperties ( ) ; List < String > order = new ArrayList < String > ( 5 ) ; order . add ( ".xml" ) ; order . add ( ".rar" ) ; order . add ( "-ra.xml" ) ; order . add ( "-ds.xml" ) ; order . add ( ".war" ) ; KernelConfiguration kernelConfiguration = new KernelConfiguration ( ) ; String configurationName = configurationString ( properties , "name" , DEFAULT_NAME ) ; kernelConfiguration = kernelConfiguration . name ( configurationName ) ; kernelConfiguration = kernelConfiguration . classLoader ( ClassLoaderFactory . TYPE_PARENT_FIRST ) ; kernelConfiguration = kernelConfiguration . management ( configurationBoolean ( properties , "management" , true ) ) ; kernelConfiguration = kernelConfiguration . parallelDeploy ( configurationBoolean ( properties , "parallel.deploy" , true ) ) ; kernelConfiguration = kernelConfiguration . remoteAccess ( configurationBoolean ( properties , "remote.access" , true ) ) ; kernelConfiguration = kernelConfiguration . remotePort ( configurationInteger ( properties , "remote.port" , 1202 ) ) ; kernelConfiguration = kernelConfiguration . eventListener ( new PreClassLoaderEventListener ( ) ) ; kernelConfiguration = kernelConfiguration . eventListener ( new PostClassLoaderEventListener ( ) ) ; kernelConfiguration = kernelConfiguration . command ( new Shutdown ( ) ) ; kernelConfiguration = kernelConfiguration . deploymentOrder ( new DeploymentOrder ( order ) ) ; kernelConfiguration = kernelConfiguration . remoteJmxAccess ( configurationBoolean ( properties , "remote.jmx.access" , true ) ) ; kernelConfiguration = kernelConfiguration . usePlatformMBeanServer ( configurationBoolean ( properties , "use.platform.mbeanserver" , true ) ) ; kernelConfiguration = kernelConfiguration . beanManagement ( configurationBoolean ( properties , "bean.management" , true ) ) ; applySystemProperties ( properties ) ; String home = SecurityActions . getSystemProperty ( configurationName + ".home" ) ; if ( home != null ) { kernelConfiguration . home ( new File ( home ) . toURI ( ) . toURL ( ) ) ; } else { home = new File ( "." ) . toURI ( ) . toURL ( ) . toString ( ) ; File root = new File ( new URI ( home . substring ( 0 , home . lastIndexOf ( "bin" ) ) ) ) ; kernelConfiguration . home ( root . toURI ( ) . toURL ( ) ) ; } if ( args != null && args . length > 0 ) { for ( int i = 0 ; i < args . length ; i ++ ) { if ( "-b" . equals ( args [ i ] ) ) { kernelConfiguration . bindAddress ( args [ ++ i ] ) ; } } } if ( tg != null ) kernelConfiguration . threadGroup ( tg ) ; kernel = KernelFactory . create ( kernelConfiguration ) ; kernel . startup ( ) ; initLogging ( SecurityActions . getThreadContextClassLoader ( ) ) ; } catch ( Throwable t ) { error ( t . getMessage ( ) , t ) ; } }
Boot
@param args The arguments
@param tg The thread group used