public class ResinSystem
extends java.lang.Object
Constructor and Description |
---|
ResinSystem(java.lang.String id)
Creates a new servlet server.
|
ResinSystem(java.lang.String id,
java.lang.ClassLoader loader)
Creates a new servlet server.
|
ResinSystem(java.lang.String id,
Path rootDirectory)
Creates a new servlet server.
|
ResinSystem(java.lang.String id,
Path rootDirectory,
Path dataDirectory)
Creates a new servlet server.
|
Modifier and Type | Method and Description |
---|---|
void |
addLifecycleListener(LifecycleListener listener) |
void |
addListener(AfterResinStartListener listener)
Adds a new AfterStart listener for post-startup cleanup
|
void |
addService(java.lang.Class<?> serviceApi,
ResinSubSystem service)
Adds a new service.
|
void |
addService(ResinSubSystem service)
Adds a new service.
|
<T extends ResinSubSystem> |
addServiceIfAbsent(java.lang.Class<?> serviceApi,
T service)
Adds a new service.
|
<T extends ResinSubSystem> |
addServiceIfAbsent(T service)
Adds a new service.
|
void |
destroy()
Closes the server.
|
EnvironmentClassLoader |
getClassLoader()
Returns the classLoader
|
java.lang.Throwable |
getConfigException()
Returns the configuration exception
|
static ResinSystem |
getCurrent()
Returns the current server
|
static java.lang.String |
getCurrentId()
Returns the current system id.
|
static <T extends ResinSubSystem> |
getCurrentService(java.lang.Class<T> serviceClass)
Returns the current identified service.
|
java.lang.String |
getId()
Returns the server id
|
<T extends ResinSubSystem> |
getService(java.lang.Class<T> cl)
Returns the service for the given class.
|
long |
getStartTime()
Returns the time the server started in ms.
|
java.lang.String |
getState()
Returns the lifecycle state
|
boolean |
isActive()
Returns true if the server is currently active and accepting requests
|
boolean |
isAfterStarting()
Returns true if the server is starting or active
|
boolean |
isBeforeActive()
Returns true before the startup has completed.
|
boolean |
isDestroyed()
Returns true if the server is closed.
|
boolean |
isDestroying()
Returns true if the server is closed.
|
boolean |
isModified()
Returns true if the server has been modified and needs restarting.
|
boolean |
isModifiedNow()
Returns true if the server has been modified and needs restarting.
|
boolean |
isStopped()
Returns true if the server is stopped.
|
boolean |
isStopping()
Returns true if the server is stopped.
|
void |
setConfigException(java.lang.Throwable exn)
Returns the configuration instance.
|
void |
setId(java.lang.String id) |
void |
start()
Start the server.
|
void |
stop()
Closes the server.
|
java.lang.String |
toString() |
public ResinSystem(java.lang.String id)
public ResinSystem(java.lang.String id, java.lang.ClassLoader loader)
public ResinSystem(java.lang.String id, Path rootDirectory) throws java.io.IOException
java.io.IOException
public void setId(java.lang.String id)
public static ResinSystem getCurrent()
public static <T extends ResinSubSystem> T getCurrentService(java.lang.Class<T> serviceClass)
public static java.lang.String getCurrentId()
public java.lang.String getId()
public EnvironmentClassLoader getClassLoader()
public java.lang.Throwable getConfigException()
public void setConfigException(java.lang.Throwable exn)
public long getStartTime()
public java.lang.String getState()
public void addLifecycleListener(LifecycleListener listener)
public boolean isModified()
public boolean isModifiedNow()
public boolean isAfterStarting()
public boolean isBeforeActive()
public boolean isStopping()
public boolean isStopped()
public boolean isDestroyed()
public boolean isDestroying()
public boolean isActive()
public void addService(ResinSubSystem service)
public void addService(java.lang.Class<?> serviceApi, ResinSubSystem service)
public <T extends ResinSubSystem> T addServiceIfAbsent(T service)
public <T extends ResinSubSystem> T addServiceIfAbsent(java.lang.Class<?> serviceApi, T service)
public <T extends ResinSubSystem> T getService(java.lang.Class<T> cl)
public void addListener(AfterResinStartListener listener)
public void start()
public void stop()
public void destroy()
public java.lang.String toString()
toString
in class java.lang.Object