com.caucho.server.resin
Class Resin

java.lang.Object
  extended by com.caucho.server.resin.Resin
Direct Known Subclasses:
ResinEmbedded, ResinWatchdog

public class Resin
extends java.lang.Object

The Resin class represents the top-level container for Resin. It exactly matches the <resin> tag in the resin.xml


Field Summary
protected  Management _management
           
static int EXIT_OK
           
 
Constructor Summary
Resin(ResinArgs args)
          Creates a new resin server.
Resin(java.lang.String[] args)
          Creates a new resin server.
 
Method Summary
 void addStartInfoListener(StartInfoListener listener)
           
 void close()
          Called from the embedded server
 void configureFile(Path path)
           
 void configureProgram(ConfigProgram program)
           
 LogSystem createLogSystem()
           
 Management createResinManagement()
           
 Server createServer()
           
 StatSystem createStatSystem()
           
 void destroy()
           
 ResinAdmin getAdmin()
           
 Broker getAdminBroker()
          Returns the admin broker
 EnvironmentClassLoader getClassLoader()
          Returns the classLoader
 double getCpuLoad()
           
static Resin getCurrent()
          Returns the resin server.
static java.lang.String getCurrentServerId()
           
 java.lang.String getDisplayServerId()
          Returns the server id.
 java.lang.String getHomeCluster()
          Returns the cluster to join for a dynamic cluster join.
 java.util.Date getInitialStartTime()
          Returns the initial start time.
 LicenseCheck getLicenseCheck()
           
 Path getLicenseDirectory()
           
protected  java.lang.String getLicenseErrorMessage()
           
protected  java.lang.String getLicenseMessage()
           
 LifecycleState getLifecycleState()
          Returns the current lifecycle state.
 Path getLogDirectory()
           
 Management getManagement()
          Returns the management api.
 Path getResinConf()
          The configuration file used to start the server.
 Path getResinDataDirectory()
          Returns the resin-data directory
 Path getResinHome()
          Returns resin.home.
protected  java.lang.String getResinName()
           
 ResinSystem getResinSystem()
           
 java.lang.String getResinSystemAuthKey()
           
 java.lang.String getRestartMessage()
           
 Path getRootDirectory()
          Gets the root directory.
 CloudServer getSelfServer()
           
 Server getServer()
          Returns the active server.
 java.lang.String getServerAddress()
           
protected  Path getServerDataDirectory()
           
 java.lang.String getServerId()
          Returns the server id.
 int getServerPort()
           
 ServletContainerConfig getServletContainerConfig()
           
 long getShutdownWaitMax()
           
 java.lang.String getStage()
          Returns the server stage.
 java.util.Date getStartTime()
          Returns the start time.
 java.lang.String getUniqueServerName()
           
 void initMain()
          Initialize the server, binding to TCP and starting the threads.
 boolean isActive()
          Returns true if active.
 boolean isClosed()
          Returns true if the server is closed.
 boolean isClosing()
          Returns true if the server is closing.
 boolean isEmbedded()
           
 boolean isProfessional()
          Set true for Resin pro.
 boolean isResinServer()
          Returns true for a Resin server, false for a watchdog.
 boolean isRestart()
           
 boolean isWatchdog()
           
protected  boolean loadCloudLicenses()
           
static void main(java.lang.String[] argv)
          The main start of the web server.
 void setLicenseDirectory(Path licenseDirectory)
           
 void setRootDirectory(Path path)
           
 void setShutdownWaitTime(long shutdownTime)
           
 void start()
          Starts the server.
 void stop()
          Starts the server.
 java.lang.String toString()
           
 void waitForExit()
          Thread to wait until Resin should be stopped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXIT_OK

public static final int EXIT_OK
See Also:
Constant Field Values

_management

protected Management _management
Constructor Detail

Resin

public Resin(java.lang.String[] args)
Creates a new resin server.


Resin

public Resin(ResinArgs args)
Creates a new resin server.

Method Detail

getCurrent

public static Resin getCurrent()
Returns the resin server.


getResinSystem

public ResinSystem getResinSystem()

getClassLoader

public EnvironmentClassLoader getClassLoader()
Returns the classLoader


getServerId

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


getUniqueServerName

public java.lang.String getUniqueServerName()

getDisplayServerId

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


getCurrentServerId

public static java.lang.String getCurrentServerId()

isResinServer

public boolean isResinServer()
Returns true for a Resin server, false for a watchdog.


isWatchdog

public boolean isWatchdog()

getResinConf

public Path getResinConf()
The configuration file used to start the server.


getResinName

protected java.lang.String getResinName()

getResinHome

public Path getResinHome()
Returns resin.home.


isProfessional

public boolean isProfessional()
Set true for Resin pro.


isEmbedded

public boolean isEmbedded()

getRootDirectory

public Path getRootDirectory()
Gets the root directory.


setRootDirectory

public void setRootDirectory(Path path)

getLicenseDirectory

public Path getLicenseDirectory()

setLicenseDirectory

public void setLicenseDirectory(Path licenseDirectory)

getHomeCluster

public java.lang.String getHomeCluster()
Returns the cluster to join for a dynamic cluster join.


getResinSystemAuthKey

public java.lang.String getResinSystemAuthKey()

getStage

public java.lang.String getStage()
Returns the server stage.


getServerAddress

public java.lang.String getServerAddress()

getServerPort

public int getServerPort()

getLogDirectory

public Path getLogDirectory()

getResinDataDirectory

public Path getResinDataDirectory()
Returns the resin-data directory


getServerDataDirectory

protected Path getServerDataDirectory()

getShutdownWaitMax

public long getShutdownWaitMax()

setShutdownWaitTime

public void setShutdownWaitTime(long shutdownTime)

createResinManagement

public Management createResinManagement()

createStatSystem

public StatSystem createStatSystem()

createLogSystem

public LogSystem createLogSystem()

getInitialStartTime

public java.util.Date getInitialStartTime()
Returns the initial start time.


getStartTime

public java.util.Date getStartTime()
Returns the start time.


getLifecycleState

public LifecycleState getLifecycleState()
Returns the current lifecycle state.


getServer

public Server getServer()
Returns the active server.


getManagement

public Management getManagement()
Returns the management api.


getSelfServer

public CloudServer getSelfServer()

createServer

public Server createServer()

isActive

public boolean isActive()
Returns true if active.


isClosing

public boolean isClosing()
Returns true if the server is closing.


isClosed

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


addStartInfoListener

public void addStartInfoListener(StartInfoListener listener)

isRestart

public boolean isRestart()

getRestartMessage

public java.lang.String getRestartMessage()

start

public void start()
           throws java.lang.Exception
Starts the server.

Throws:
java.lang.Exception

stop

public void stop()
Starts the server.


destroy

public void destroy()

getAdmin

public ResinAdmin getAdmin()

initMain

public void initMain()
              throws java.lang.Throwable
Initialize the server, binding to TCP and starting the threads.

Throws:
java.lang.Throwable

configureFile

public void configureFile(Path path)

configureProgram

public void configureProgram(ConfigProgram program)

getLicenseCheck

public LicenseCheck getLicenseCheck()

loadCloudLicenses

protected boolean loadCloudLicenses()

getAdminBroker

public Broker getAdminBroker()
Returns the admin broker


getLicenseMessage

protected java.lang.String getLicenseMessage()

getLicenseErrorMessage

protected java.lang.String getLicenseErrorMessage()

getServletContainerConfig

public ServletContainerConfig getServletContainerConfig()

getCpuLoad

public double getCpuLoad()

waitForExit

public void waitForExit()
                 throws java.io.IOException
Thread to wait until Resin should be stopped.

Throws:
java.io.IOException

close

public void close()
Called from the embedded server


toString

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

main

public static void main(java.lang.String[] argv)
The main start of the web server.
 -conf resin.xml   : alternate configuration file
 -port port        : set the server's portt