org.ow2.jonas.web
Interface JWebContainerService

All Superinterfaces:
ConfigService, Service

public interface JWebContainerService
extends ConfigService

JOnAS WEB Container Service interface. This interface provides a description of a web container service.

Author:
Ludovic Bert, Florent Benoit

Method Summary
 void deployWars(Context ctx)
          Deploy the given wars of an ear file with the specified parent classloader (ejb classloader or ear classloader).
 URLClassLoader getClassLoader(URL warURL, org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable, ClassLoader ejbClassLoader)
          Return the class loader of the given warURL.
 ClassLoader getContextLinkedClassLoader(URL warURL)
           
 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).
 boolean isWarDeployedByWorkName(String unpackName)
          Test if the specified unpack name is already deployed or not.
 boolean isWarLoaded(String fileName)
          Test if the specified filename is already deployed or not.
 void registerWar(String fileName)
          Deprecated. 
 void registerWar(org.ow2.util.ee.deploy.api.deployable.WARDeployable deployable)
          Register a WAR by delegating the operation to the registerWar() method.
 void removeCache(ClassLoader earClassLoader)
          Make a cleanup of the cache of deployment descriptor.
 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)
          Deprecated. 
 void unRegisterWar(org.ow2.util.ee.deploy.api.deployable.WARDeployable deployable)
          Un-register a WAR by delegating the operation to the unRegisterWar(Context) method.
 
Methods inherited from interface org.ow2.jonas.service.ConfigService
registerAddonConfig, unregisterAddonConfig
 
Methods inherited from interface org.ow2.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Method Detail

deployWars

void deployWars(Context ctx)
                throws JWebContainerServiceException
Deploy the given wars of an ear file with the specified parent classloader (ejb classloader or ear classloader). (This method is only used for the ear applications, not for the web applications).

Parameters:
ctx - the context containing the configuration to deploy the wars.
This context contains the following parameters :
- urls the list of the urls of the wars to deploy.
- earURL the URL of the ear application file.
- parentClassLoader the parent classLoader of the wars.
- earClassLoader the ear classLoader of the j2ee app.
- altDDs the optional URI of deployment descriptor.
- contextRoots the optional context root of the wars.
Throws:
JWebContainerServiceException - if an error occurs during the deployment.

unDeployWars

void unDeployWars(URL[] urls)
Undeploy the given wars of an ear file with the specified parent classloader (ejb classloader or ear classloader). (This method is only used for the ear applications, not for the war applications).

Parameters:
urls - the list of the urls of the wars to undeploy.

removeCache

void removeCache(ClassLoader earClassLoader)
Make a cleanup of the cache of deployment descriptor. This method must be invoked after the ear deployment by the EAR service. the deployment of an ear by .

Parameters:
earClassLoader - the ClassLoader of the ear application to remove from the cache.

getDefaultHost

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

Returns:
the Default host name of the web container.
Throws:
JWebContainerServiceException - when it is impossible to get the Default Host.

getDefaultHttpPort

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

Returns:
the Default HTTP port number of the web container.
Throws:
JWebContainerServiceException - when it is impossible to get the Default Http port.

getDefaultHttpsPort

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

Returns:
the Default HTTPS port number of the web container.
Throws:
JWebContainerServiceException - when it is impossible to get the Default Https port.

getClassLoader

URLClassLoader getClassLoader(URL warURL,
                              org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable,
                              ClassLoader ejbClassLoader)
                              throws JWebContainerServiceException
Return the class loader of the given warURL. Unpack the associated war and build the loader if it's not in the cache.

Parameters:
warURL - the url of the war we want to get the loader
earDeployable - the EAR deployable (could be null) the war. May be null in non ear case.
ejbClassLoader - the ejb class loader of the ear. May be null in non ear case.
Returns:
the class loader of the given warURL.
Throws:
JWebContainerServiceException - if the process failed.

getContextLinkedClassLoader

ClassLoader getContextLinkedClassLoader(URL warURL)
Parameters:
warURL - the URL of the webapp
Returns:
Returns the ClassLoader used to link a JNDI environnment to a webapp

registerWar

@Deprecated
void registerWar(String fileName)
                 throws RemoteException,
                        JWebContainerServiceException
Deprecated. 

Register a WAR by delegating the operation to the registerWar() method. This is used for JMX management.

Parameters:
fileName - the name of the war to deploy.
Throws:
RemoteException - if rmi call failed.
JWebContainerServiceException - if the registration failed.

registerWar

void registerWar(org.ow2.util.ee.deploy.api.deployable.WARDeployable deployable)
                 throws JWebContainerServiceException
Register a WAR by delegating the operation to the registerWar() method.

Parameters:
deployable - the webapp to be deployed
Throws:
JWebContainerServiceException - if the registration failed.

isWarLoaded

boolean isWarLoaded(String fileName)
Test if the specified filename is already deployed or not.

Parameters:
fileName - the name of the war file.
Returns:
true if the war is deployed, else false.

unRegisterWar

@Deprecated
void unRegisterWar(String fileName)
                   throws RemoteException,
                          JWebContainerServiceException
Deprecated. 

Unregister a WAR by delegating the operation to the unRegisterWar() method. This is used for JMX management.

Parameters:
fileName - the name of the war to undeploy.
Throws:
RemoteException - if rmi call failed.
JWebContainerServiceException - if the unregistration failed.

unRegisterWar

void unRegisterWar(org.ow2.util.ee.deploy.api.deployable.WARDeployable deployable)
                   throws JWebContainerServiceException
Un-register a WAR by delegating the operation to the unRegisterWar(Context) method.

Parameters:
deployable - the webapp to be un-deployed.
Throws:
JWebContainerServiceException - if the un-registration failed.

isWarDeployedByWorkName

boolean isWarDeployedByWorkName(String unpackName)
Test if the specified unpack name is already deployed or not.

Parameters:
unpackName - the name of the ear file.
Returns:
true if the ear is deployed, else false.


Copyright © 2012 OW2 Consortium. All Rights Reserved.