public class RatpackMain extends Object
This class is designed to be subclassable.
| Constructor and Description |
|---|
RatpackMain() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addImpliedDefaults(Properties properties)
Subclass hook for adding default property values.
|
static void |
main(String[] args)
Starts a Ratpack application, by creating a new instance of this class and calling
startOrExit(). |
RatpackServer |
server(Properties overrideProperties,
Properties defaultProperties)
Builds a server by calling
LaunchConfigs.createFromGlobalProperties(ClassLoader, java.util.Properties, java.util.Properties). |
void |
start()
Starts the server returned by calling
server(java.util.Properties, java.util.Properties). |
void |
startOrExit()
Starts the server via
start(), exiting via System.exit(1) if that method throws an exception. |
public static void main(String[] args)
startOrExit().
If the application fails to start, the JVM will exit via System.exit(1).
args - ignoredpublic RatpackServer server(Properties overrideProperties, Properties defaultProperties)
LaunchConfigs.createFromGlobalProperties(ClassLoader, java.util.Properties, java.util.Properties).
Uses this class's classloader as the classloader.
overrideProperties - The override propertiesdefaultProperties - The default propertiespublic void start()
throws Exception
server(java.util.Properties, java.util.Properties).
The system properties are given as the override properties, and an empty property set as the defaults.
Exception - if the server cannot be startedpublic void startOrExit()
start(), exiting via System.exit(1) if that method throws an exception.protected void addImpliedDefaults(Properties properties)
This implementation does not add any.
properties - The properties to add the defaults to