Class Main
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
This filter matches against the name, including only matching a ModuleStartup with no name if name is null (unlike a normal "null" returned from name, which acts as a wildcard for the name) -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addDescriptorFileFinder
(ServiceLocator serviceLocator, DescriptorFileFinder descriptorFileFinder) createServiceLocator
(ModulesRegistry mr, StartupContext context, List<PopulatorPostProcessor> postProcessors, DescriptorFileFinder descriptorFileFinder) protected void
findStartupService
(ModulesRegistry registry, ServiceLocator serviceLocator, String mainModuleName, StartupContext context) Return the ModuleStartup service configured to be used to start the system.protected File
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
protected void
launch
(ModuleStartup startupCode, StartupContext context) launch
(ModulesRegistry registry, String mainModuleName, StartupContext context) Launches the module system and hand over the execution to theModuleStartup
implementation of the main module.static void
void
void
Start the server from the command line
-
Field Details
-
parentClassLoader
-
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 theModuleStartup
implementation 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, 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<PopulatorPostProcessor> postProcessors, DescriptorFileFinder descriptorFileFinder) throws BootException - Throws:
BootException
-
launch
- Throws:
BootException
-
getServiceLocator
-
addDescriptorFileFinder
private void addDescriptorFileFinder(ServiceLocator serviceLocator, DescriptorFileFinder descriptorFileFinder)
-