com.caucho.env.service
Class ResinSystem

java.lang.Object
  extended by com.caucho.env.service.ResinSystem

public class ResinSystem
extends java.lang.Object


Constructor Summary
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.
 
Method Summary
 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>
T
addServiceIfAbsent(java.lang.Class<?> serviceApi, T service)
          Adds a new service.
<T extends ResinSubSystem>
T
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>
T
getCurrentService(java.lang.Class<T> serviceClass)
          Returns the current identified service.
 java.lang.String getId()
          Returns the server id
<T extends ResinSubSystem>
T
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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResinSystem

public ResinSystem(java.lang.String id)
Creates a new servlet server.


ResinSystem

public ResinSystem(java.lang.String id,
                   java.lang.ClassLoader loader)
Creates a new servlet server.


ResinSystem

public ResinSystem(java.lang.String id,
                   Path rootDirectory)
            throws java.io.IOException
Creates a new servlet server.

Throws:
java.io.IOException

ResinSystem

public ResinSystem(java.lang.String id,
                   Path rootDirectory,
                   Path dataDirectory)
            throws java.io.IOException
Creates a new servlet server.

Throws:
java.io.IOException
Method Detail

setId

public void setId(java.lang.String id)

getCurrent

public static ResinSystem getCurrent()
Returns the current server


getCurrentService

public static <T extends ResinSubSystem> T getCurrentService(java.lang.Class<T> serviceClass)
Returns the current identified service.


getCurrentId

public static java.lang.String getCurrentId()
Returns the current system id.


getId

public java.lang.String getId()
Returns the server id


getClassLoader

public EnvironmentClassLoader getClassLoader()
Returns the classLoader


getConfigException

public java.lang.Throwable getConfigException()
Returns the configuration exception


setConfigException

public void setConfigException(java.lang.Throwable exn)
Returns the configuration instance.


getStartTime

public long getStartTime()
Returns the time the server started in ms.


getState

public java.lang.String getState()
Returns the lifecycle state


addLifecycleListener

public void addLifecycleListener(LifecycleListener listener)

isModified

public boolean isModified()
Returns true if the server has been modified and needs restarting.


isModifiedNow

public boolean isModifiedNow()
Returns true if the server has been modified and needs restarting.


isAfterStarting

public boolean isAfterStarting()
Returns true if the server is starting or active


isBeforeActive

public boolean isBeforeActive()
Returns true before the startup has completed.


isStopping

public boolean isStopping()
Returns true if the server is stopped.


isStopped

public boolean isStopped()
Returns true if the server is stopped.


isDestroyed

public boolean isDestroyed()
Returns true if the server is closed.


isDestroying

public boolean isDestroying()
Returns true if the server is closed.


isActive

public boolean isActive()
Returns true if the server is currently active and accepting requests


addService

public void addService(ResinSubSystem service)
Adds a new service.


addService

public void addService(java.lang.Class<?> serviceApi,
                       ResinSubSystem service)
Adds a new service.


addServiceIfAbsent

public <T extends ResinSubSystem> T addServiceIfAbsent(T service)
Adds a new service.


addServiceIfAbsent

public <T extends ResinSubSystem> T addServiceIfAbsent(java.lang.Class<?> serviceApi,
                                                       T service)
Adds a new service.


getService

public <T extends ResinSubSystem> T getService(java.lang.Class<T> cl)
Returns the service for the given class.


addListener

public void addListener(AfterResinStartListener listener)
Adds a new AfterStart listener for post-startup cleanup


start

public void start()
Start the server.


stop

public void stop()
Closes the server.


destroy

public void destroy()
Closes the server.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object