java.lang.Object
com.sun.enterprise.module.bootstrap.Main
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.glassfish.hk2.api.ServiceLocatorcreateServiceLocator(ModulesRegistry mr, StartupContext context, List<org.glassfish.hk2.api.PopulatorPostProcessor> postProcessors, org.glassfish.hk2.api.DescriptorFileFinder descriptorFileFinder) protected voidfindStartupService(ModulesRegistry registry, org.glassfish.hk2.api.ServiceLocator serviceLocator, String mainModuleName, StartupContext context) Return the ModuleStartup service configured to be used to start the system.protected FileWe 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 ClassLoaderorg.glassfish.hk2.api.ServiceLocatorprotected voidlaunch(ModuleStartup startupCode, StartupContext context) launch(ModulesRegistry registry, String mainModuleName, StartupContext context) Launches the module system and hand over the execution to theModuleStartupimplementation of the main module.static voidvoidvoidStart the server from the command line
-
Field Details
-
DEFAULT_NAME
- See Also:
-
-
Constructor Details
-
Main
public Main()
-
-
Method Details
-
main
-
run
-
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.- 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
Start the server from the command line- Parameters:
args- the command line arguments- Throws:
BootException
-
defineParentClassLoader
- Throws:
BootException
-
getParentClassLoader
-
launch
public ModuleStartup launch(ModulesRegistry registry, String mainModuleName, StartupContext context) throws BootException Launches the module system and hand over the execution to theModuleStartupimplementation of the main module.- Parameters:
mainModuleName- The module that will provideModuleStartup. If null, one will be auto-discovered.context- startup context instance- Returns:
- The ModuleStartup service
- Throws:
BootException
-
findStartupService
public ModuleStartup findStartupService(ModulesRegistry registry, org.glassfish.hk2.api.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 org.glassfish.hk2.api.ServiceLocator createServiceLocator(ModulesRegistry mr, StartupContext context, List<org.glassfish.hk2.api.PopulatorPostProcessor> postProcessors, org.glassfish.hk2.api.DescriptorFileFinder descriptorFileFinder) throws BootException - Throws:
BootException
-
launch
- Throws:
BootException
-
getServiceLocator
public org.glassfish.hk2.api.ServiceLocator getServiceLocator()
-