org.ow2.jonas.web.jetty6
Class Jetty6Service

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.ow2.jonas.lib.reconfig.ReconfigEmitter
          extended by org.ow2.jonas.lib.service.AbsServiceImpl
              extended by org.ow2.jonas.web.base.BaseWebContainerService
                  extended by org.ow2.jonas.web.jetty6.Jetty6Service
All Implemented Interfaces:
NotificationBroadcaster, NotificationEmitter, Service, BaseWebContainerServiceMBean, JWebContainerService

public class Jetty6Service
extends BaseWebContainerService
implements JWebContainerService

This class provides an implementation of the Jetty service (as web container service).

Author:
Florent Benoit

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ow2.jonas.web.base.BaseWebContainerService
BaseWebContainerService.WebLoaderHolder
 
Field Summary
 
Fields inherited from class org.ow2.jonas.web.base.BaseWebContainerService
INEAR_WORK_WEBAPPS_DIR_SUFFIX, jmxService, JONAS_BASE, SINGLE_WORK_WEBAPPS_DIR_SUFFIX, WORK_DIR, WORK_WEBAPPS_DIR
 
Fields inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
Jetty6Service()
          Default constructor.
 
Method Summary
protected  void doRegisterWar(Context ctx)
          Create the environment and delegate the operation to the implementation of the web container.
 void doStart()
          Start the Jetty service in a new thread.
protected  void doStop()
          Stop the Jetty service.
protected  void doUnRegisterWar(Context ctx)
          Delegate the unregistration to the implementation of the web container.
 String getDefaultHost()
          Return the Default host name of the web container.
 String getDefaultHttpPort()
          Return the Default HTTP port number of the web container (can be null if multiple HTTP connector has been set).
 String getDefaultHttpsPort()
          Return the Default HTTPS port number of the web container (can be null if multiple HTTPS connector has been set).
 String getJOnASClassPath(ClassLoader webClassLoader)
          Return the classpath which can be used for jsp compiling by Jasper.
 boolean isInternalContainerStarted()
          Checks if the internal web container has been started.
 void startInternalWebContainer()
          Starts the specific code for the web container implementation.
protected  void updateServerInfos()
          Update info of the serverName and serverVersion.
 
Methods inherited from class org.ow2.jonas.web.base.BaseWebContainerService
bindJaxwsService, checkWarDeployed, checkWarFile, deployWars, getAppsClassLoader, getClassLoader, getContextFactory, getContextLinkedClassLoader, getContextRoot, getCurrentNumberOfWars, getDeployedWars, getJAXRPCService, getJAXWSService, getLogger, getNaming, getOnDemandRedirectPort, getRandomPort, getServerName, getServerVersion, getUnpackedURL, getVersioningService, getWar, getWar, getWarBindings, getWarDeployed, getWarLoaders, initWorkingDirectory, isOnDemandFeatureEnabled, isVersioningEnabled, isWarDeployedByWorkName, isWarLoaded, registerWar, registerWar, registerWarMBean, registerWebServiceMBean, removeCache, setContextFactory, setDeployerManager, setEjb3Service, setJAXRPCService, setJmxService, setNaming, setOnDemandFeature, setOnDemandRedirectPort, setParsingwithvalidation, setServerName, setServerVersion, setVersioningService, setWarDeployableMetadataFactory, setWebEnvironment, setWorkCleanerService, unbindJaxwsService, unDeployWars, unRegisterWar, unRegisterWar, unregisterWarMBean, unregisterWebServiceMBean, unsetEjb3Service, unsetVersioningService
 
Methods inherited from class org.ow2.jonas.lib.service.AbsServiceImpl
convertToList, doInit, getDomainName, getJonasServerName, getName, getServerProperties, init, isStarted, setName, setServerProperties, start, stop, throwRequirementException, toString
 
Methods inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter
initLogger, sendReconfigNotification, sendSaveNotification
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ow2.jonas.web.JWebContainerService
deployWars, getClassLoader, getContextLinkedClassLoader, isWarDeployedByWorkName, isWarLoaded, registerWar, removeCache, unDeployWars, unRegisterWar
 
Methods inherited from interface org.ow2.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Constructor Detail

Jetty6Service

public Jetty6Service()
Default constructor.

Method Detail

doStart

public void doStart()
             throws ServiceException
Start the Jetty service in a new thread.

Overrides:
doStart in class BaseWebContainerService
Throws:
ServiceException - if the startup failed.

startInternalWebContainer

public void startInternalWebContainer()
                               throws JWebContainerServiceException
Starts the specific code for the web container implementation. This allows to start the internal container on demand (if there is an access on the http proxy port for example)

Specified by:
startInternalWebContainer in class BaseWebContainerService
Throws:
JWebContainerServiceException - if container is not started

isInternalContainerStarted

public boolean isInternalContainerStarted()
Checks if the internal web container has been started.

Specified by:
isInternalContainerStarted in class BaseWebContainerService
Returns:
true if it is already started

doStop

protected void doStop()
               throws ServiceException
Stop the Jetty service.

Overrides:
doStop in class BaseWebContainerService
Throws:
ServiceException - if the stop failed.

doRegisterWar

protected void doRegisterWar(Context ctx)
                      throws JWebContainerServiceException
Create the environment and delegate the operation to the implementation of the web container.

Specified by:
doRegisterWar in class BaseWebContainerService
Parameters:
ctx - the context which contains the configuration in order to deploy a WAR.
Throws:
JWebContainerServiceException - if the registration of the WAR failed.

getJOnASClassPath

public String getJOnASClassPath(ClassLoader webClassLoader)
Return the classpath which can be used for jsp compiling by Jasper. This classpath is extracted from the web classloader.

Parameters:
webClassLoader - the ClassLoader used for extract URLs.
Returns:
the jonas classpath which is useful for JSP compiling.

doUnRegisterWar

protected void doUnRegisterWar(Context ctx)
                        throws JWebContainerServiceException
Delegate the unregistration to the implementation of the web container.

Specified by:
doUnRegisterWar in class BaseWebContainerService
Parameters:
ctx - the context which contains the configuration in order to undeploy a WAR.
Throws:
JWebContainerServiceException - if the unregistration failed.

updateServerInfos

protected void updateServerInfos()
Update info of the serverName and serverVersion.

Specified by:
updateServerInfos in class BaseWebContainerService

getDefaultHost

public String getDefaultHost()
                      throws JWebContainerServiceException
Return the Default host name of the web container.

Specified by:
getDefaultHost in interface JWebContainerService
Specified by:
getDefaultHost in class BaseWebContainerService
Returns:
the Default host name of the web container.
Throws:
JWebContainerServiceException - when default host cannot be resolved (multiple services).

getDefaultHttpPort

public String getDefaultHttpPort()
                          throws JWebContainerServiceException
Return the Default HTTP port number of the web container (can be null if multiple HTTP connector has been set).

Specified by:
getDefaultHttpPort in interface JWebContainerService
Specified by:
getDefaultHttpPort in class BaseWebContainerService
Returns:
the Default HTTP port number of the web container.
Throws:
JWebContainerServiceException - when default HTTP port cannot be resolved (multiple occurences).

getDefaultHttpsPort

public String getDefaultHttpsPort()
                           throws JWebContainerServiceException
Return the Default HTTPS port number of the web container (can be null if multiple HTTPS connector has been set).

Specified by:
getDefaultHttpsPort in interface JWebContainerService
Specified by:
getDefaultHttpsPort in class BaseWebContainerService
Returns:
the Default HTTPS port number of the web container.
Throws:
JWebContainerServiceException - when default HTTPS port cannot be resolved (multiple occurences).


Copyright © 2010 OW2 Consortium. All Rights Reserved.