com.caucho.server.resin
Class Resin

java.lang.Object
  extended by com.caucho.server.resin.Resin
All Implemented Interfaces:
SchemaBean, EnvironmentBean
Direct Known Subclasses:
ProResin

public class Resin
extends java.lang.Object
implements EnvironmentBean, SchemaBean

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


Nested Class Summary
 class Resin.JavaVar
          Java variables
 class Resin.Var
          EL variables
 
Field Summary
protected  Management _management
           
 
Constructor Summary
protected Resin(java.lang.ClassLoader loader)
          Creates a new resin server.
protected Resin(java.lang.ClassLoader loader, java.lang.String licenseErrorMessage)
          Creates a new resin server.
 
Method Summary
 void addBoot(ContainerProgram program)
          Ignore the boot configuration
 void addCluster(Cluster cluster)
           
 void addClusterDefault(ContainerProgram program)
           
 void addDynamicServer(java.lang.String clusterId, java.lang.String address, int port)
          Sets the server id.
 void addSecurityProvider(java.lang.Class providerClass)
          Adds a new security provider
static Resin create()
          Creates a new Resin instance
static Resin create(java.lang.ClassLoader loader)
          Creates a new Resin instance
 Cluster createCluster()
           
 JspPropertyGroup createJsp()
          Configures JSP (backwards compatibility).
 Management createManagement()
           
 ModuleRepository createModuleRepository()
           
 com.caucho.server.resin.Resin.SecurityManagerConfig createSecurityManager()
           
 ServerCompatConfig createServer()
          Creates the compatibility server.
 ThreadPoolConfig createThreadPool()
          Configures the thread pool
 TransactionManager createTransactionManager()
          Deprecated. 
 void destroy()
          Closes the server.
 Cluster findCluster(java.lang.String id)
           
 ClusterServer findClusterServer(java.lang.String id)
           
 ResinMXBean getAdmin()
           
 BamBroker getAdminBroker()
          Returns the admin broker
 Path getAdminPath()
          Returns the admin directory
 java.lang.ClassLoader getClassLoader()
          Returns the classLoader
 java.util.ArrayList<Cluster> getClusterList()
           
 ClusterMXBean[] getClusters()
          Returns the cluster names.
static Resin getCurrent()
          Returns the resin server.
static java.lang.String getCurrentServerId()
           
 java.lang.String getDisplayServerId()
          Returns the server id.
 java.util.Date getInitialStartTime()
          Returns the initial start time.
protected  java.lang.String getLicenseErrorMessage()
           
protected  java.lang.String getLicenseMessage()
           
 LifecycleState getLifecycleState()
          Returns the current lifecycle state.
static Resin getLocal()
          Returns the resin server.
 Management getManagement()
          Returns the management api.
 Path getManagementPath()
          Deprecated. 
 long getMinFreeMemory()
          Gets the minimum free memory allowed.
 javax.management.ObjectName getObjectName()
           
 Path getResinConf()
          The configuration file used to start the server.
 Path getResinHome()
          Returns resin.home.
protected  java.lang.String getResinName()
           
 Path getRootDirectory()
          Gets the root directory.
 java.lang.String getSchema()
          Returns the relax schema.
 Server getServer()
          Returns the active server.
 java.lang.String getServerId()
          Returns the server id.
 long getShutdownWaitMax()
          Gets the minimum free memory allowed.
 java.util.Date getStartTime()
          Returns the start time.
 TempFileManager getTempFileManager()
           
 ThreadPoolMXBean getThreadPoolAdmin()
           
 void init()
          Initialize the server.
 void initMain()
          Initialize the server, binding to TCP and starting the threads.
protected  Cluster instantiateCluster()
           
 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 isDynamicServer()
           
 boolean isProfessional()
          Set true for Resin pro.
static void main(java.lang.String[] argv)
          The main start of the web server.
 void setConfigFile(java.lang.String configFile)
          Sets the config file.
 void setEnvironmentClassLoader(EnvironmentClassLoader loader)
          Sets the classLoader
 void setEnvironmentSystemProperties(boolean isEnable)
          Set true if the server should enable environment-based system properties.
 void setGlobalSystemProperties(boolean isGlobal)
          Set true if system properties are global.
 void setGroupName(java.lang.String groupName)
          Sets the group name for setuid.
 void setMinFreeMemory(Bytes minFreeMemory)
          Sets the minimum free memory allowed.
 void setResinHome(Path home)
          Sets resin.home
 void setRootDirectory(Path root)
          Sets the root directory.
 void setServerId(java.lang.String serverId)
          Sets the server id.
 void setShutdownWaitMax(Period shutdownWaitMax)
          Sets the shutdown time
 void setUserName(java.lang.String userName)
          Sets the user name for setuid.
 void setWatchdogManager(ConfigProgram program)
           
static void shutdown()
          Shuts the server down.
 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

_management

protected Management _management
Constructor Detail

Resin

protected Resin(java.lang.ClassLoader loader)
Creates a new resin server.


Resin

protected Resin(java.lang.ClassLoader loader,
                java.lang.String licenseErrorMessage)
Creates a new resin server.

Method Detail

create

public static Resin create()
Creates a new Resin instance


create

public static Resin create(java.lang.ClassLoader loader)
Creates a new Resin instance


getLocal

public static Resin getLocal()
Returns the resin server.


getCurrent

public static Resin getCurrent()
Returns the resin server.


getClassLoader

public java.lang.ClassLoader getClassLoader()
Returns the classLoader

Specified by:
getClassLoader in interface EnvironmentBean

getObjectName

public javax.management.ObjectName getObjectName()

getAdmin

public ResinMXBean getAdmin()

getAdminBroker

public BamBroker getAdminBroker()
Returns the admin broker


getThreadPoolAdmin

public ThreadPoolMXBean getThreadPoolAdmin()

getLicenseMessage

protected java.lang.String getLicenseMessage()

getLicenseErrorMessage

protected java.lang.String getLicenseErrorMessage()

setEnvironmentClassLoader

public void setEnvironmentClassLoader(EnvironmentClassLoader loader)
Sets the classLoader


getSchema

public java.lang.String getSchema()
Returns the relax schema.

Specified by:
getSchema in interface SchemaBean

setServerId

public void setServerId(java.lang.String serverId)
Sets the server id.


getServerId

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


getCurrentServerId

public static java.lang.String getCurrentServerId()

addDynamicServer

public void addDynamicServer(java.lang.String clusterId,
                             java.lang.String address,
                             int port)
Sets the server id.


getDisplayServerId

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


setConfigFile

public void setConfigFile(java.lang.String configFile)
Sets the config file.


setResinHome

public void setResinHome(Path home)
Sets resin.home


getResinHome

public Path getResinHome()
Returns resin.home.


setRootDirectory

public void setRootDirectory(Path root)
Sets the root directory.


getRootDirectory

public Path getRootDirectory()
Gets the root directory.


getAdminPath

public Path getAdminPath()
Returns the admin directory


getResinConf

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


getResinName

protected java.lang.String getResinName()

isProfessional

public boolean isProfessional()
Set true for Resin pro.


getClusters

public ClusterMXBean[] getClusters()
Returns the cluster names.


addClusterDefault

public void addClusterDefault(ContainerProgram program)

createCluster

public Cluster createCluster()
                      throws ConfigException
Throws:
ConfigException

instantiateCluster

protected Cluster instantiateCluster()

addCluster

public void addCluster(Cluster cluster)

getClusterList

public java.util.ArrayList<Cluster> getClusterList()

setEnvironmentSystemProperties

public void setEnvironmentSystemProperties(boolean isEnable)
Set true if the server should enable environment-based system properties.


createServer

public ServerCompatConfig createServer()
Creates the compatibility server.


createThreadPool

public ThreadPoolConfig createThreadPool()
                                  throws java.lang.Exception
Configures the thread pool

Throws:
java.lang.Exception

setUserName

public void setUserName(java.lang.String userName)
Sets the user name for setuid.


setGroupName

public void setGroupName(java.lang.String groupName)
Sets the group name for setuid.


setMinFreeMemory

public void setMinFreeMemory(Bytes minFreeMemory)
Sets the minimum free memory allowed.


getMinFreeMemory

public long getMinFreeMemory()
Gets the minimum free memory allowed.


setShutdownWaitMax

public void setShutdownWaitMax(Period shutdownWaitMax)
Sets the shutdown time


getShutdownWaitMax

public long getShutdownWaitMax()
Gets the minimum free memory allowed.


setGlobalSystemProperties

public void setGlobalSystemProperties(boolean isGlobal)
Set true if system properties are global.


createSecurityManager

public com.caucho.server.resin.Resin.SecurityManagerConfig createSecurityManager()

setWatchdogManager

public void setWatchdogManager(ConfigProgram program)

createTransactionManager

@Deprecated
public TransactionManager createTransactionManager()
                                            throws ConfigException
Deprecated. 

Configures the TM.

Throws:
ConfigException

createManagement

public Management createManagement()

createModuleRepository

public ModuleRepository createModuleRepository()

getTempFileManager

public TempFileManager getTempFileManager()

getManagementPath

@Deprecated
public Path getManagementPath()
Deprecated. 


addSecurityProvider

public void addSecurityProvider(java.lang.Class providerClass)
                         throws java.lang.Exception
Adds a new security provider

Throws:
java.lang.Exception

createJsp

public JspPropertyGroup createJsp()
Configures JSP (backwards compatibility).


addBoot

public void addBoot(ContainerProgram program)
             throws java.lang.Exception
Ignore the boot configuration

Throws:
java.lang.Exception

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.


init

public void init()
Initialize the server.


getServer

public Server getServer()
Returns the active server.


getManagement

public Management getManagement()
Returns the management api.


start

public void start()
Starts the server.


stop

public void stop()
Starts the server.


isDynamicServer

public boolean isDynamicServer()

findCluster

public Cluster findCluster(java.lang.String id)

findClusterServer

public ClusterServer findClusterServer(java.lang.String id)

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.


destroy

public void destroy()
Closes the server.


initMain

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

Throws:
java.lang.Throwable

waitForExit

public void waitForExit()
Thread to wait until Resin should be stopped.


toString

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

shutdown

public static void shutdown()
Shuts the server down.


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