Expresso 5-6

com.jcorporate.expresso.kernel
Class RootContainer

java.lang.Object
  extended bycom.jcorporate.expresso.kernel.ComponentBase
      extended bycom.jcorporate.expresso.kernel.ContainerComponentBase
          extended bycom.jcorporate.expresso.kernel.RootContainer
All Implemented Interfaces:
ComponentLifecycle, Containable, Describable, ExpressoComponent, RootContainerInterface, Serializable

public class RootContainer
extends ContainerComponentBase
implements RootContainerInterface

This is the default root container interface. It is essentially the root of the Expresso Runtime tree.

Author:
Michael Rimov
See Also:
Serialized Form

Constructor Summary
RootContainer()
          Default constructor
 
Method Summary
 void configure(Configuration newConfig)
          Configure the global container including type conversion for default values.
 void destroy()
          Destroys the container and unregisters itself from the ExpressoRuntimeMap
 ExpressoServicesConfig getExpressoServicesConfig()
          Retrieve the current ExpressoServicesConfiguration file bean.
 String getHttpPort()
          Retrieve the HTTP port of this server
 LogManager getLogManager()
          Retrieve the LogManager object for the system
 URL getServicesFileLocation()
          Retrieves the URL location of the services file location.
 String getServletAPI()
          Retrieve the servlet API of the system
 String getSetupValue(String key)
          Retrieve a specific setup value for the container.
 Map getSetupValues()
          Retrieve all the setup values for the root container.
 Boolean getShowStackTrace()
          Get the show stack trace.
 String getSslPort()
          Retrieve the location of the Expresso SSL port.
 void initialize()
          Default Initializer
 boolean isShowStackTrace()
          Retrieve whether stack traces should be shown or not.
 void reconfigure(Configuration newConfig)
          Reconfigure the global container
 void setExpressoServicesConfig(ExpressoServicesConfig theConfig)
          Set the ExpressoServicesConfig bean.
 void setHttpPort(String httpPort)
          Set the HTTP port of the server
 void setLogManager(LogManager newManager)
          Set the log manager for the entire expresso system
 void setServicesFileLocation(URL url)
          Sets the ULR location of the services file.
 void setServletAPI(String servletAPI)
          Set the servlet API of the system
 void setShowStackTrace(Boolean showStackTrace)
          Sets whether stack traces should be shown or not.
 void setSslPort(String sslPort)
          Set the SSL port property of this root container
 
Methods inherited from class com.jcorporate.expresso.kernel.ContainerComponentBase
getContainerImplementation, locateComponent, setContainerImplementation
 
Methods inherited from class com.jcorporate.expresso.kernel.ComponentBase
getMetaData, getMetadataLocation, getParent, setMetaData, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jcorporate.expresso.kernel.Containable
getContainerImplementation, locateComponent, setContainerImplementation
 
Methods inherited from interface com.jcorporate.expresso.kernel.ExpressoComponent
getMetaData, getParent, setParent
 

Constructor Detail

RootContainer

public RootContainer()
Default constructor

Method Detail

setExpressoServicesConfig

public void setExpressoServicesConfig(ExpressoServicesConfig theConfig)
Set the ExpressoServicesConfig bean. This is usually done by the System factory, or possibly the management tools.

Specified by:
setExpressoServicesConfig in interface RootContainerInterface
Parameters:
theConfig - the new Expresso services config file.

getExpressoServicesConfig

public ExpressoServicesConfig getExpressoServicesConfig()
Retrieve the current ExpressoServicesConfiguration file bean.

Note An important aspect of memory saving that RootContainer does is that it maintains the local copy of the ExpressoServicesConfig as a weak reference. It then reloads from scratch if absolutely necessary. Because of this, you cannot modify ExpressoServicesConfig, lose your reference, and call getExpressoServicesConfig() again to retrieve your changes. Maintain a reference yourself if you want to save changes later!

Specified by:
getExpressoServicesConfig in interface RootContainerInterface
Returns:
the Root ExpressoServicesconfig

setHttpPort

public void setHttpPort(String httpPort)
Set the HTTP port of the server

Parameters:
httpPort - the new value for this configuration setting

getHttpPort

public String getHttpPort()
Retrieve the HTTP port of this server

Returns:
java.lang.String

setLogManager

public void setLogManager(LogManager newManager)
Set the log manager for the entire expresso system

Specified by:
setLogManager in interface RootContainerInterface
Parameters:
newManager - the new LogManager for the system

getLogManager

public LogManager getLogManager()
Retrieve the LogManager object for the system

Specified by:
getLogManager in interface RootContainerInterface
Returns:
the LogManager for the system

setServicesFileLocation

public void setServicesFileLocation(URL url)
Sets the ULR location of the services file. This is usually called by the SystemFactory

Specified by:
setServicesFileLocation in interface RootContainerInterface
Parameters:
url - the location of the services file.

getServicesFileLocation

public URL getServicesFileLocation()
Retrieves the URL location of the services file location. May be inside a jar/war file

Specified by:
getServicesFileLocation in interface RootContainerInterface
Returns:
java.net.URL

setServletAPI

public void setServletAPI(String servletAPI)
Set the servlet API of the system

Parameters:
servletAPI - the new value for the system

getServletAPI

public String getServletAPI()
Retrieve the servlet API of the system

Returns:
the current servlet API string

getSetupValue

public String getSetupValue(String key)
Retrieve a specific setup value for the container.

Specified by:
getSetupValue in interface RootContainerInterface
Parameters:
key - the key for the global setup value
Returns:
java.lang.String

getSetupValues

public Map getSetupValues()
Retrieve all the setup values for the root container.

Specified by:
getSetupValues in interface RootContainerInterface
Returns:
Map of all setup values.

setShowStackTrace

public void setShowStackTrace(Boolean showStackTrace)
Sets whether stack traces should be shown or not.

Parameters:
showStackTrace - the new value.
Throws:
IllegalArgumentException - if showStackTrace is null

getShowStackTrace

public Boolean getShowStackTrace()
Get the show stack trace. This is backwards compatible with the old method of doing things in misc.ConfigManager.

Returns:
java.lang.Boolean

isShowStackTrace

public boolean isShowStackTrace()
Retrieve whether stack traces should be shown or not.

Returns:
boolean true if stacktrace should be shown

setSslPort

public void setSslPort(String sslPort)
Set the SSL port property of this root container

Parameters:
sslPort - the new location for the SSL port

getSslPort

public String getSslPort()
Retrieve the location of the Expresso SSL port. This method is to eventually be removed to another separate component

Returns:
java.lang.String

configure

public void configure(Configuration newConfig)
               throws ConfigurationException
Configure the global container including type conversion for default values.

Specified by:
configure in interface ComponentLifecycle
Parameters:
newConfig - The Configuration 'dynabean'
Throws:
ConfigurationException - upon error

destroy

public void destroy()
Destroys the container and unregisters itself from the ExpressoRuntimeMap

Specified by:
destroy in interface RootContainerInterface

initialize

public void initialize()
Default Initializer

Specified by:
initialize in interface ComponentLifecycle

reconfigure

public void reconfigure(Configuration newConfig)
                 throws ConfigurationException
Reconfigure the global container

Specified by:
reconfigure in interface ComponentLifecycle
Parameters:
newConfig - the new configuration.
Throws:
ConfigurationException - upon reconfiguration error

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.