org.objectweb.jonas.web.jetty50
Class JettyJWebContainerServiceImpl

java.lang.Object
  extended byjavax.management.NotificationBroadcasterSupport
      extended byorg.objectweb.jonas.management.ReconfigDispatcher
          extended byorg.objectweb.jonas.service.AbsServiceImpl
              extended byorg.objectweb.jonas.web.AbsJWebContainerServiceImpl
                  extended byorg.objectweb.jonas.web.jetty50.JettyJWebContainerServiceImpl
All Implemented Interfaces:
AbsJWebContainerServiceImplMBean, JWebContainerService, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, ReconfigDispatcherMBean, Service

public class JettyJWebContainerServiceImpl
extends AbsJWebContainerServiceImpl

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

Author:
Miroslav Halas (initial developer), Florent Benoit

Nested Class Summary
 
Nested classes inherited from class org.objectweb.jonas.web.AbsJWebContainerServiceImpl
AbsJWebContainerServiceImpl.WebLoaderHolder
 
Field Summary
 
Fields inherited from class org.objectweb.jonas.web.AbsJWebContainerServiceImpl
AUTOLOADDIR, CLASS, DESCRIPTORS, INEAR_WORK_WEBAPPS_DIR_SUFFIX, JONAS_BASE, PARSINGWITHVALIDATION, SINGLE_WORK_WEBAPPS_DIR_SUFFIX, WEBAPPS_DIR, WORK_DIR, WORK_WEBAPPS_DIR
 
Fields inherited from class org.objectweb.jonas.management.ReconfigDispatcher
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
JettyJWebContainerServiceImpl()
           
 
Method Summary
protected  void doInit(javax.naming.Context ctx)
          Initialize the Jetty service.
protected  void doRegisterWar(javax.naming.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(javax.naming.Context ctx)
          Delegate the unregistration to the implementation of the web container.
 java.lang.String getDefaultHost()
          Return the Default host name of the web container.
 java.lang.String getDefaultHttpPort()
          Return the Default HTTP port number of the web container (can be null if multiple HTTP connector has been set).
 java.lang.String getDefaultHttpsPort()
          Return the Default HTTPS port number of the web container (can be null if multiple HTTPS connector has been set).
 java.lang.String getJOnASClassPath(java.lang.ClassLoader webClassLoader)
          Return the classpath which can be used for jsp compiling by Jasper.
protected  void updateServerInfos()
          Update info of the serverName and serverVersion
 
Methods inherited from class org.objectweb.jonas.web.AbsJWebContainerServiceImpl
deployWars, getAutoloadDirectories, getClassLoader, getContextLinkedClassLoader, getCurrentNumberOfWars, getDeployableWars, getDeployedWars, getInstalledWars, getLogger, getMbeanServer, getNaming, getServerName, getServerVersion, getUnpackDir, getWar, getWarNames, getWebappsDirectory, isWarLoaded, registerWarMBean, removeCache, setServerName, setServerVersion, unDeployWars, unRegisterWarMBean
 
Methods inherited from class org.objectweb.jonas.service.AbsServiceImpl
getDomainName, getJonasServerName, getName, init, isStarted, setName, start, stop
 
Methods inherited from class org.objectweb.jonas.management.ReconfigDispatcher
addNotificationListener, getFilter, getHandback, getListener, getNotificationInfo, initLogger, removeNotificationListener, sendReconfigNotification, sendSaveNotification
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
handleNotification, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Constructor Detail

JettyJWebContainerServiceImpl

public JettyJWebContainerServiceImpl()
Method Detail

doInit

protected void doInit(javax.naming.Context ctx)
               throws ServiceException
Initialize the Jetty service.

Overrides:
doInit in class AbsJWebContainerServiceImpl
Parameters:
ctx - the configuration context of the service.
Throws:
ServiceException - if the initialization failed.

doStart

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

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

doStop

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

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

doRegisterWar

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

Specified by:
doRegisterWar in class AbsJWebContainerServiceImpl
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 java.lang.String getJOnASClassPath(java.lang.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(javax.naming.Context ctx)
                        throws JWebContainerServiceException
Delegate the unregistration to the implementation of the web container.

Specified by:
doUnRegisterWar in class AbsJWebContainerServiceImpl
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 AbsJWebContainerServiceImpl

getDefaultHost

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

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

getDefaultHttpPort

public java.lang.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 AbsJWebContainerServiceImpl
Returns:
the Default HTTP port number of the web container.
Throws:
JWebContainerServiceException - when default HTTP port cannot be resolved (multiple occurences).

getDefaultHttpsPort

public java.lang.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 AbsJWebContainerServiceImpl
Returns:
the Default HTTPS port number of the web container.
Throws:
JWebContainerServiceException - when default HTTPS port cannot be resolved (multiple occurences).