public class Main
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
Main.MainFilter
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)
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_NAME |
private java.lang.ClassLoader |
parentClassLoader |
Constructor and Description |
---|
Main() |
Modifier and Type | Method and Description |
---|---|
private void |
addDescriptorFileFinder(ServiceLocator serviceLocator,
DescriptorFileFinder descriptorFileFinder) |
ServiceLocator |
createServiceLocator(ModulesRegistry mr,
StartupContext context,
java.util.List<PopulatorPostProcessor> postProcessors,
DescriptorFileFinder descriptorFileFinder) |
protected void |
defineParentClassLoader() |
ModuleStartup |
findStartupService(ModulesRegistry registry,
ServiceLocator serviceLocator,
java.lang.String mainModuleName,
StartupContext context)
Return the ModuleStartup service configured to be used to start the
system.
|
protected java.io.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 java.lang.ClassLoader |
getParentClassLoader() |
ServiceLocator |
getServiceLocator() |
ModuleStartup |
launch(ModulesRegistry registry,
java.lang.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(java.lang.String[] args) |
void |
run(java.lang.String[] args) |
void |
start(java.lang.String[] args)
Start the server from the command line
|
private java.lang.ClassLoader parentClassLoader
public static final java.lang.String DEFAULT_NAME
public static void main(java.lang.String[] args)
public void run(java.lang.String[] args)
protected java.io.File getBootstrapFile() throws BootException
BootException
- If failed to determine the bootstrap file name.public void start(java.lang.String[] args) throws BootException
args
- the command line argumentsBootException
protected void defineParentClassLoader() throws BootException
BootException
protected java.lang.ClassLoader getParentClassLoader()
public ModuleStartup launch(ModulesRegistry registry, java.lang.String mainModuleName, StartupContext context) throws BootException
ModuleStartup
implementation of the main module.mainModuleName
- The module that will provide ModuleStartup
. If null,
one will be auto-discovered.context
- startup context instanceBootException
public ModuleStartup findStartupService(ModulesRegistry registry, ServiceLocator serviceLocator, java.lang.String mainModuleName, StartupContext context) throws BootException
registry
- serviceLocator
- mainModuleName
- context
- BootException
public ServiceLocator createServiceLocator(ModulesRegistry mr, StartupContext context, java.util.List<PopulatorPostProcessor> postProcessors, DescriptorFileFinder descriptorFileFinder) throws BootException
BootException
protected void launch(ModuleStartup startupCode, StartupContext context) throws BootException
BootException
public ServiceLocator getServiceLocator()
private void addDescriptorFileFinder(ServiceLocator serviceLocator, DescriptorFileFinder descriptorFileFinder)