|
||||||||||
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
public abstract class AbsJWebContainerServiceImpl
This abstract class provides an implementation for a dynamic JWebContainerService service.
Nested Class Summary | |
---|---|
class |
AbsJWebContainerServiceImpl.WebLoaderHolder
Holds the ClassLoader used to retrieve the WebApp JNDI Context and the JOnAS Webapp ClasLoader |
Field Summary | |
---|---|
static String |
AUTOLOADDIR
Web service configuration properties : Autdeployed the files in these directories |
static String |
CLASS
Web service configuration properties : Implementation of the web container |
static String |
DESCRIPTORS
Web service configuration properties : Files deployed |
protected static String |
INEAR_WORK_WEBAPPS_DIR_SUFFIX
The name of the property used in work directory for EAR webapps (in ear case). |
protected JmxService |
jmx
JMX Service |
protected static String |
JONAS_BASE
The name of the JONAS_BASE directory. |
static String |
PARSINGWITHVALIDATION
Web service configuration properties : Xml parsing with validation |
protected static String |
SINGLE_WORK_WEBAPPS_DIR_SUFFIX
The name of the property used in work directory for single webapps (not ear case). |
protected static String |
WEBAPPS_DIR
The name of the webapps directory. |
protected static String |
WORK_DIR
The name of the working directory. |
protected static String |
WORK_WEBAPPS_DIR
The name of the working apps directory. |
Fields inherited from class org.objectweb.jonas.management.reconfig.emitter.ReconfigEmitter |
---|
RECONFIG_TYPE, SAVE_RECONFIG_TYPE |
Constructor Summary | |
---|---|
AbsJWebContainerServiceImpl()
|
Method Summary | |
---|---|
void |
deployWars(Context ctx)
Deploy the given wars of an ear file with the specified parent classloader (ejb classloader or ear classloader). |
protected void |
doInit(Context ctx)
Initialize the service. |
protected abstract void |
doRegisterWar(Context ctx)
Create the environment and delegate the operation to the implementation of the web container. |
protected void |
doStart()
Start the service. |
protected void |
doStop()
Stop the service. |
protected abstract void |
doUnRegisterWar(Context ctx)
Delegate the unregistration to the implementation of the web container. |
List |
getAutoloadDirectories()
Return the list of "autoload" directories for web applications. |
URLClassLoader |
getClassLoader(URL warURL,
String earAppName,
ClassLoader parentLoader)
Return the class loader of the given warURL. |
protected JComponentContextFactory |
getContextFactory()
|
ClassLoader |
getContextLinkedClassLoader(URL warURL)
|
Integer |
getCurrentNumberOfWars()
|
abstract String |
getDefaultHost()
Return the Default host name of the web container. |
abstract String |
getDefaultHttpPort()
Return the Default HTTP port number of the web container (can be null if multiple HTTP connector has been set). |
abstract String |
getDefaultHttpsPort()
Return the Default HTTPS port number of the web container (can be null if multiple HTTPS connector has been set). |
List |
getDeployableWars()
Return the list of installed web applications ready to deploy. |
List |
getDeployedWars()
Return the list of all loaded web applications. |
List |
getInstalledWars()
Return the list of installed web applications. |
protected static org.objectweb.util.monolog.api.Logger |
getLogger()
|
protected JNamingManager |
getNaming()
|
String |
getServerName()
Gets the name of the server which is the web container |
String |
getServerVersion()
Gets the version of the server which is the web container |
protected URL |
getUnpackDir(URL warURL,
String earAppName)
Return the URL where warURL has been unpacked. |
War |
getWar(URL url)
Get the war identified by its URL (.war). |
Set |
getWarNames()
This method is added temporarily. |
String |
getWarsDirectory()
Return the webapps directory. |
boolean |
isWarLoaded(String fileName)
Test if the specified filename is already deployed or not |
void |
registerWar(String fileName)
Register a WAR by delegating the operation to the registerWar() method. |
void |
removeCache(ClassLoader earClassLoader)
Make a cleanup of the cache of deployment descriptor. |
protected void |
setServerName(String serverName)
|
protected void |
setServerVersion(String serverVersion)
|
void |
unDeployWars(URL[] urls)
Undeploy the given wars of an ear file with the specified parent classloader (ejb classloader or ear classloader). |
void |
unRegisterWar(String fileName)
Unregister a WAR by delegating the operation to the unRegisterWar() method. |
protected abstract void |
updateServerInfos()
Update info of the serverName and serverVersion |
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.service.Service |
---|
getName, init, isStarted, setName, start, stop |
Field Detail |
---|
protected static final String JONAS_BASE
protected static final String WEBAPPS_DIR
protected static final String WORK_DIR
protected static final String WORK_WEBAPPS_DIR
protected static final String SINGLE_WORK_WEBAPPS_DIR_SUFFIX
protected static final String INEAR_WORK_WEBAPPS_DIR_SUFFIX
public static final String DESCRIPTORS
public static final String AUTOLOADDIR
public static final String PARSINGWITHVALIDATION
public static final String CLASS
protected JmxService jmx
Constructor Detail |
---|
public AbsJWebContainerServiceImpl()
Method Detail |
---|
protected void doInit(Context ctx) throws ServiceException
doInit
in class AbsServiceImpl
ctx
- the configuration context of the service.
ServiceException
- if the initialization failed.protected void doStart() throws ServiceException
doStart
in class AbsServiceImpl
ServiceException
- if the startup failed.protected void doStop() throws ServiceException
doStop
in class AbsServiceImpl
ServiceException
- if the stop failed.protected abstract void doRegisterWar(Context ctx) throws JWebContainerServiceException
ctx
- the context which contains the configuration in order to
deploy a WAR.
JWebContainerServiceException
- if the registration of the WAR
failed.protected abstract void doUnRegisterWar(Context ctx) throws JWebContainerServiceException
ctx
- the context which contains the configuration in order to
undeploy a WAR.
JWebContainerServiceException
- if the unregistration failed.protected URL getUnpackDir(URL warURL, String earAppName) throws JWebContainerServiceException
warURL
- the URL of the warearAppName
- EAR Application name (can be null if not in EAR case)
JWebContainerServiceException
- when it is impossible to retrieve
the unpacked URL.public URLClassLoader getClassLoader(URL warURL, String earAppName, ClassLoader parentLoader) throws JWebContainerServiceException
getClassLoader
in interface JWebContainerService
warURL
- the url of the war we want to get the loaderearAppName
- the name of the ear application containing the war. May
be null in non ear case.parentLoader
- the ejb class loader of the ear. May be null in non
ear case.
JWebContainerServiceException
- if the process failed.public ClassLoader getContextLinkedClassLoader(URL warURL)
getContextLinkedClassLoader
in interface JWebContainerService
warURL
- the URL of the webapp
public void registerWar(String fileName) throws RemoteException, JWebContainerServiceException
registerWar
in interface AbsJWebContainerServiceImplMBean
registerWar
in interface JWebContainerService
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
fileName
- the name of the war to undeploy.
RemoteException
- if rmi call failed.
JWebContainerServiceException
- if the unregistration failed.public void deployWars(Context ctx) throws JWebContainerServiceException
deployWars
in interface JWebContainerService
ctx
- the context containing the configuration to deploy the wars.
JWebContainerServiceException
- if an error occurs during the
deployment.public void unDeployWars(URL[] urls)
unDeployWars
in interface JWebContainerService
urls
- the list of the urls of the wars to undeploy.public War getWar(URL url)
url
- the URL of the war to get.
public void removeCache(ClassLoader earClassLoader)
removeCache
in interface JWebContainerService
earClassLoader
- the ClassLoader of the ear application to remove
from the cache.public Integer getCurrentNumberOfWars()
getCurrentNumberOfWars
in interface AbsJWebContainerServiceImplMBean
public List getInstalledWars() throws Exception
getInstalledWars
in interface AbsJWebContainerServiceImplMBean
Exception
- if the list can't be retrievedpublic Set getWarNames()
getWarNames
in interface AbsJWebContainerServiceImplMBean
public boolean isWarLoaded(String fileName)
isWarLoaded
in interface AbsJWebContainerServiceImplMBean
isWarLoaded
in interface JWebContainerService
fileName
- the name of the war file.
public List getDeployedWars()
getDeployedWars
in interface AbsJWebContainerServiceImplMBean
public List getDeployableWars() throws Exception
getDeployableWars
in interface AbsJWebContainerServiceImplMBean
Exception
- if the list can't be retrievedpublic List getAutoloadDirectories()
getAutoloadDirectories
in interface AbsJWebContainerServiceImplMBean
public String getWarsDirectory()
getWarsDirectory
in interface AbsJWebContainerServiceImplMBean
public String getServerName()
getServerName
in interface AbsJWebContainerServiceImplMBean
public String getServerVersion()
getServerVersion
in interface AbsJWebContainerServiceImplMBean
protected abstract void updateServerInfos()
public abstract String getDefaultHost() throws JWebContainerServiceException
getDefaultHost
in interface JWebContainerService
JWebContainerServiceException
- when it is impossible to get the
Default Host.public abstract String getDefaultHttpPort() throws JWebContainerServiceException
getDefaultHttpPort
in interface JWebContainerService
JWebContainerServiceException
- when it is impossible to get the
Default Http port.public abstract String getDefaultHttpsPort() throws JWebContainerServiceException
getDefaultHttpsPort
in interface JWebContainerService
JWebContainerServiceException
- when it is impossible to get the
Default Https port.protected static org.objectweb.util.monolog.api.Logger getLogger()
protected JNamingManager getNaming()
protected void setServerName(String serverName)
serverName
- The serverName to set.protected void setServerVersion(String serverVersion)
serverVersion
- The serverVersion to set.protected JComponentContextFactory getContextFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |