|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.management.NotificationBroadcasterSupport
org.objectweb.jonas.management.reconfig.emitter.ReconfigEmitter
org.objectweb.jonas.service.AbsServiceImpl
org.objectweb.jonas.web.AbsJWebContainerServiceImpl
org.ow2.jonas.web.tomcat6.Tomcat6Service
public class Tomcat6Service
Implementation of the web container service for Tomcat 6.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.objectweb.jonas.web.AbsJWebContainerServiceImpl |
---|
AbsJWebContainerServiceImpl.WebLoaderHolder |
Field Summary | |
---|---|
protected static String |
CONFIG_FILE
Relative path of the configuration file. |
Fields inherited from class org.objectweb.jonas.web.AbsJWebContainerServiceImpl |
---|
AUTOLOADDIR, CLASS, DESCRIPTORS, INEAR_WORK_WEBAPPS_DIR_SUFFIX, jmx, JONAS_BASE, PARSINGWITHVALIDATION, SINGLE_WORK_WEBAPPS_DIR_SUFFIX, WEBAPPS_DIR, WORK_DIR, WORK_WEBAPPS_DIR |
Fields inherited from class org.objectweb.jonas.management.reconfig.emitter.ReconfigEmitter |
---|
RECONFIG_TYPE, SAVE_RECONFIG_TYPE |
Constructor Summary | |
---|---|
Tomcat6Service()
|
Method Summary | |
---|---|
protected void |
checkStartedContext(org.apache.catalina.Context context,
PermissionManager permissionManager)
Check that the context that was started was right configured. |
protected org.apache.tomcat.util.digester.Digester |
createServerDigester()
Create and configure the Digester that will be used for the xml parsing of the configuration file. |
protected void |
doInit(Context ctx)
Initialize the Catalina service. |
protected void |
doRegisterWar(Context ctx)
Deploy a specific WAR file specified in the context. |
void |
doStart()
Start the Catalina service in a new thread. |
protected void |
doStop()
Stop the Catalina service. |
protected void |
doUnRegisterWar(Context ctx)
Undeploy a specific WAR file specified in the context. |
org.apache.catalina.Host |
findHost(String hostName)
Find the specified host. |
protected File |
getConfigFile()
Return a File object representing the server.xml configuration file. |
protected List<JOnASStandardContext> |
getConfiguredMatchingJonasContexts(String contextRoot,
File fpackedWar,
String destDir)
Check if there is a previous JOnASStandardContext which match the current context If true, deploy our context into the configured context. |
protected List<org.apache.catalina.Context> |
getContexts()
Gets all the contexts of the current Tomcat server. |
String |
getDefaultHost()
Return the Default host name of the web container. |
String |
getDefaultHttpPort()
Return the Default HTTP port number of the web container. |
String |
getDefaultHttpsPort()
Return the Default HTTPS port number of the web container (can be null if multiple HTTPS connector has been set). |
protected List<org.apache.catalina.core.StandardEngine> |
getEngines()
Gets all the engines of the current Tomcat server. |
protected void |
initCatalinaEnvironment()
Init the environment of catalina set catalina.home, catalina.base and unset the tomcat naming. |
boolean |
isTomcatStarted()
The server is started ? |
void |
registerWar(String fileName)
Register a WAR by delegating the operation to the registerWar() method. |
void |
removeContext(org.apache.catalina.Context context)
Remove the specified Context from the set of defined Contexts for its associated Host. |
void |
setServer(org.apache.catalina.Server server)
Set the server instance we are configuring. |
void |
unRegisterWar(String fileName)
Unregister a WAR by delegating the operation to the unRegisterWar() method. |
protected void |
updateServerInfos()
Update info of the serverName and serverVersion. |
Methods inherited from class org.objectweb.jonas.web.AbsJWebContainerServiceImpl |
---|
deployWars, getAutoloadDirectories, getClassLoader, getContextFactory, getContextLinkedClassLoader, getCurrentNumberOfWars, getDeployableWars, getDeployedWars, getInstalledWars, getLogger, getNaming, getServerName, getServerVersion, getUnpackDir, getWar, getWarNames, getWarsDirectory, isWarLoaded, removeCache, setServerName, setServerVersion, unDeployWars |
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.reconfig.emitter.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, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.jonas.web.JWebContainerService |
---|
deployWars, getClassLoader, getContextLinkedClassLoader, isWarLoaded, removeCache, unDeployWars |
Methods inherited from interface org.objectweb.jonas.service.Service |
---|
getName, init, isStarted, setName, start, stop |
Field Detail |
---|
protected static final String CONFIG_FILE
Constructor Detail |
---|
public Tomcat6Service()
Method Detail |
---|
protected void doInit(Context ctx) throws ServiceException
doInit
in class AbsJWebContainerServiceImpl
ctx
- the configuration context of the service.
ServiceException
- if the initialization failed.protected void initCatalinaEnvironment() throws ServiceException
ServiceException
- if catalina home is not setpublic void doStart() throws ServiceException
doStart
in class AbsJWebContainerServiceImpl
ServiceException
- if the startup failed.protected void doStop() throws ServiceException
doStop
in class AbsJWebContainerServiceImpl
ServiceException
- if the stop failed.protected void doRegisterWar(Context ctx) throws JWebContainerServiceException
doRegisterWar
in class AbsJWebContainerServiceImpl
ctx
- the context which contains the configuration in order to
deploy the WAR.
JWebContainerServiceException
- if the registration of the WAR
failed.protected List<JOnASStandardContext> getConfiguredMatchingJonasContexts(String contextRoot, File fpackedWar, String destDir)
contextRoot
- name of the context that we want to find preconfigured
contextsfpackedWar
- file of the original war filedestDir
- name of the unpacked directory of the war file
protected void checkStartedContext(org.apache.catalina.Context context, PermissionManager permissionManager) throws JWebContainerServiceException
context
- context to checkpermissionManager
- the permission manager used for JACC
JWebContainerServiceException
- if the context was not right
configuredprotected List<org.apache.catalina.core.StandardEngine> getEngines() throws JWebContainerServiceException
JWebContainerServiceException
- if engines can not be retrievedprotected List<org.apache.catalina.Context> getContexts() throws JWebContainerServiceException
JWebContainerServiceException
- if contexts can not be retrievedprotected void doUnRegisterWar(Context ctx) throws JWebContainerServiceException
doUnRegisterWar
in class AbsJWebContainerServiceImpl
ctx
- the context which contains the configuration in order to
undeploy a WAR.
JWebContainerServiceException
- if the unregistration failed.public void removeContext(org.apache.catalina.Context context) throws JWebContainerServiceException
context
- The Context to be removed
JWebContainerServiceException
- if the context can not be removedpublic boolean isTomcatStarted()
public void setServer(org.apache.catalina.Server server)
server
- The new serverprotected File getConfigFile() throws FileNotFoundException
FileNotFoundException
- if the configuration file is not found.public org.apache.catalina.Host findHost(String hostName) throws JWebContainerServiceException
hostName
- the name of the host to find.
JWebContainerServiceException
- if the specified host cannot be
found.protected org.apache.tomcat.util.digester.Digester createServerDigester()
protected void updateServerInfos()
updateServerInfos
in class AbsJWebContainerServiceImpl
public String getDefaultHost() throws JWebContainerServiceException
getDefaultHost
in interface JWebContainerService
getDefaultHost
in class AbsJWebContainerServiceImpl
JWebContainerServiceException
- when default host cannot be
resolved (multiple services).public String getDefaultHttpPort() throws JWebContainerServiceException
getDefaultHttpPort
in interface JWebContainerService
getDefaultHttpPort
in class AbsJWebContainerServiceImpl
JWebContainerServiceException
- when default HTTP port cannot be
resolved or none are defined.public String getDefaultHttpsPort() throws JWebContainerServiceException
getDefaultHttpsPort
in interface JWebContainerService
getDefaultHttpsPort
in class AbsJWebContainerServiceImpl
JWebContainerServiceException
- when default HTTPS port cannot be
resolved (0 occurences).public void registerWar(String fileName) throws RemoteException, JWebContainerServiceException
registerWar
in interface AbsJWebContainerServiceImplMBean
registerWar
in interface JWebContainerService
registerWar
in class AbsJWebContainerServiceImpl
fileName
- the name of the war to deploy.
RemoteException
- if rmi call failed.
JWebContainerServiceException
- if the registration failed.public void unRegisterWar(String fileName) throws RemoteException, JWebContainerServiceException
unRegisterWar
in interface AbsJWebContainerServiceImplMBean
unRegisterWar
in interface JWebContainerService
unRegisterWar
in class AbsJWebContainerServiceImpl
fileName
- the name of the war to undeploy.
RemoteException
- if rmi call failed.
JWebContainerServiceException
- if the unregistration failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |