com.sun.enterprise.module.bootstrap
Class Main

java.lang.Object
  extended by com.sun.enterprise.module.bootstrap.Main
Direct Known Subclasses:
HK2Main

public class Main
extends Object

CLI entry point that will setup the module subsystem and delegate the main execution to the first archive in its import list... TODO: reusability of this class needs to be improved.

Author:
dochez

Field Summary
static String DEFAULT_NAME
           
 
Constructor Summary
Main()
           
 
Method Summary
 ServiceLocator createServiceLocator(ModulesRegistry mr, StartupContext context, List<? extends PopulatorPostProcessor> postProcessors, DescriptorFileFinder descriptorFileFinder)
           
protected  void defineParentClassLoader()
           
 ModuleStartup findStartupService(ModulesRegistry registry, ServiceLocator serviceLocator, String mainModuleName, StartupContext context)
          Return the ModuleStartup service configured to be used to start the system.
protected  File getBootstrapFile()
          We need to determine which jar file has been used to load this class Using the getResourceURL we can get this information, after that, it is just a bit of detective work to get the file path for the jar file.
protected  ClassLoader getParentClassLoader()
           
 ServiceLocator getServiceLocator()
           
 ModuleStartup launch(ModulesRegistry registry, String mainModuleName, StartupContext context)
          Launches the module system and hand over the execution to the ModuleStartup implementation of the main module.
protected  void launch(ModuleStartup startupCode, StartupContext context)
           
static void main(String[] args)
           
 void run(String[] args)
           
 void start(String[] args)
          Start the server from the command line
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NAME

public static final String DEFAULT_NAME
See Also:
Constant Field Values
Constructor Detail

Main

public Main()
Method Detail

main

public static void main(String[] args)

run

public void run(String[] args)

getBootstrapFile

protected File getBootstrapFile()
                         throws BootException
We need to determine which jar file has been used to load this class Using the getResourceURL we can get this information, after that, it is just a bit of detective work to get the file path for the jar file.

Returns:
the path to the jar file containing this class. always returns non-null.
Throws:
BootException - If failed to determine the bootstrap file name.

start

public void start(String[] args)
           throws BootException
Start the server from the command line

Parameters:
args - the command line arguments
Throws:
BootException

defineParentClassLoader

protected void defineParentClassLoader()
                                throws BootException
Throws:
BootException

getParentClassLoader

protected ClassLoader getParentClassLoader()

launch

public ModuleStartup launch(ModulesRegistry registry,
                            String mainModuleName,
                            StartupContext context)
                     throws BootException
Launches the module system and hand over the execution to the ModuleStartup implementation of the main module.

Parameters:
mainModuleName - The module that will provide ModuleStartup. If null, one will be auto-discovered.
context - startup context instance
Returns:
The ModuleStartup service
Throws:
BootException

findStartupService

public ModuleStartup findStartupService(ModulesRegistry registry,
                                        ServiceLocator serviceLocator,
                                        String mainModuleName,
                                        StartupContext context)
                                 throws BootException
Return the ModuleStartup service configured to be used to start the system.

Parameters:
registry -
serviceLocator -
mainModuleName -
context -
Returns:
Throws:
BootException

createServiceLocator

public ServiceLocator createServiceLocator(ModulesRegistry mr,
                                           StartupContext context,
                                           List<? extends PopulatorPostProcessor> postProcessors,
                                           DescriptorFileFinder descriptorFileFinder)
                                    throws BootException
Throws:
BootException

launch

protected void launch(ModuleStartup startupCode,
                      StartupContext context)
               throws BootException
Throws:
BootException

getServiceLocator

public ServiceLocator getServiceLocator()


Copyright © 2013 Oracle Corporation. All Rights Reserved.