org.ow2.jonas.web.base
Class BaseWebContainerService

java.lang.Object
  extended by org.ow2.jonas.lib.management.javaee.ManagedObject
      extended by org.ow2.jonas.lib.service.AbsServiceImpl
          extended by org.ow2.jonas.lib.service.AbsConfigServiceImpl
              extended by org.ow2.jonas.web.base.BaseWebContainerService
All Implemented Interfaces:
org.ow2.jonas.service.ConfigService, org.ow2.jonas.service.Service, BaseWebContainerServiceMBean, org.ow2.jonas.web.JWebContainerService

public abstract class BaseWebContainerService
extends org.ow2.jonas.lib.service.AbsConfigServiceImpl
implements org.ow2.jonas.web.JWebContainerService, BaseWebContainerServiceMBean

This abstract class provides an implementation for a dynamic JWebContainerService service.

Author:
Florent Benoit, Ludovic Bert (J2EE 1.3), Nicolas Van Caneghem (exploded ear), Michel-Ange Anton (contributor), S. Ali Tokmen (versioning), Mohammed Boukada (multitenant)

Nested Class Summary
 class BaseWebContainerService.WebLoaderHolder
          Holds the ClassLoader used to retrieve the WebApp JNDI Context and the JOnAS Webapp ClasLoader.
 
Field Summary
protected static String INEAR_WORK_WEBAPPS_DIR_SUFFIX
          The name of the property used in work directory for EAR webapps (in ear case).
protected  org.ow2.jonas.jmx.JmxService jmxService
          JMX Service.
protected static String JONAS_BASE
          The name of the JONAS_BASE directory.
protected  org.ow2.jonas.jsf.JSFService jsfService
          JSF Service.
protected static String SINGLE_WORK_WEBAPPS_DIR_SUFFIX
          The name of the property used in work directory for single webapps (not ear case).
 
Fields inherited from class org.ow2.jonas.lib.service.AbsConfigServiceImpl
addonConfig
 
Constructor Summary
BaseWebContainerService(org.osgi.framework.BundleContext bundleContext)
          Default constructor.
 
Method Summary
 void addTldResource(URL tldResource)
          Add the given TLD URL as a resource.
 void bindJaxwsService(org.ow2.jonas.ws.jaxws.IJAXWSService jaxwsService)
          Store the reference to the JAX-WS Service.
protected  URL checkWarDeployed(String fileName)
          Check if the specified file is already deployed in the JOnAS server and return the URL of this deployed war file.
protected  URL checkWarFile(String fileName)
          Check if the specified file name correspond to a file which is located relatively to where the JOnAS server is launched or in the $JONAS_BASE/web-apps.
protected abstract  HttpServiceFactory<?> createHttpServiceFactory()
          Creates an instance of the http service factory.
 void deployWars(Context ctx)
          Deploy the given wars of an ear file with the specified parent classloader (ejb classloader or ear classloader).
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.
protected  ClassLoader getAppsClassLoader()
           
 org.ow2.jonas.audit.AuditService getAuditService()
           
protected  org.osgi.framework.BundleContext getBundleContext()
           
 org.ow2.jonas.lib.loader.WebappClassLoader getClassLoader(URL warURL, org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable, ClassLoader parentLoader)
          Return the class loader of the given warURL.
protected  org.ow2.jonas.naming.JComponentContextFactory getContextFactory()
           
 ClassLoader getContextLinkedClassLoader(URL warURL)
           
protected  String getContextRoot(String contextRoot, URLClassLoader earClassLoader, URL warURL, org.ow2.jonas.deployment.web.WebContainerDeploymentDesc webDD)
          Gets the context root for a WAR.
 Integer getCurrentNumberOfWars()
           
 org.ow2.jonas.datasource.DataSourceService getDataSourceService()
           
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<String> getDeployedWars()
          Return the list of all loaded web applications.
protected  String getInstanceName()
          Gets application instance name
protected  org.ow2.jonas.ws.jaxrpc.IJAXRPCService getJAXRPCService()
           
protected  org.ow2.jonas.ws.jaxws.IJAXWSService getJAXWSService()
           
 org.ow2.jonas.jmx.JmxService getJmxService()
           
protected static org.objectweb.util.monolog.api.Logger getLogger()
           
 org.ow2.jonas.multitenant.MultitenantService getMultitenantService()
           
protected  org.ow2.jonas.naming.JNamingManager getNaming()
           
 int getOnDemandRedirectPort()
           
 int getRandomPort()
           
 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  String getTenantId(org.ow2.util.ee.deploy.api.deployable.IDeployable deployable)
          Gets tenantId for an application
 List<URL> getTLDResources()
           
protected  URL getUnpackedURL(URL warURL, org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable)
          Return the URL where warURL has been unpacked.
 org.ow2.jonas.versioning.VersioningService getVersioningService()
           
protected  List<War> getWar(String pContext)
          Get a list of wars identified by their Context.
 War getWar(URL url)
          Get the war identified by its URL (.war).
protected  Hashtable getWarBindings()
           
protected  List<War> getWarDeployed()
           
protected  WARDeployer getWarDeployer()
           
protected  Hashtable getWarLoaders()
           
protected  String getWebappsWorkDirectory()
           
protected  void initWorkingDirectory()
          Create working directory for applications.
 boolean isEjbinwarEnabled()
           
abstract  boolean isInternalContainerStarted()
          Checks if the internal web container has been started.
 boolean isMultitenantEnabled()
           
 boolean isOnDemandFeatureEnabled()
           
 boolean isVersioningEnabled()
           
 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.
protected  void registerWar(Context ctx)
          Create the environment and delegate the operation to the implementation of the web container.
 void registerWar(String fileName)
          Register a WAR by delegating the operation to the registerWar() method.
 void registerWar(org.ow2.util.ee.deploy.api.deployable.WARDeployable deployable)
          Register a WAR by delegating the operation to the registerWar(Context) method.
protected  void registerWarMBean(War war, String domainName, String fileName)
          Register War MBean.
protected  void registerWebServiceMBean(Object service, String domainName)
          Register WEB Container Service MBean.
 void removeCache(ClassLoader earClassLoader)
          Make a cleanup of the cache of deployment descriptor.
 void removeTldResource(URL tldResource)
          Remove the given TLD URL as a resource.
 void setAuditService(org.ow2.jonas.audit.AuditService auditService)
           
 void setContextFactory(org.ow2.jonas.naming.JComponentContextFactory contextFactory)
           
 void setDataSourceService(org.ow2.jonas.datasource.DataSourceService dataSourceService)
           
protected  void setDefaultHttpPort(int portNumber)
          Callback when a http port is defined
protected  void setDefaultHttpsPort(int portNumber)
          Callback when a https port is defined
 void setDeployableHelper(org.ow2.util.ee.deploy.api.helper.IDeployableHelper deployableHelper)
           
 void setDeployerManager(org.ow2.util.ee.deploy.api.deployer.IDeployerManager deployerManager)
           
 void setEjb3Service(org.ow2.jonas.ejb3.IEasyBeansService service)
           
 void setEjbinwar(boolean ejbinwar)
          Defines EJB in WAR feature.
 void setJAXRPCService(org.ow2.jonas.ws.jaxrpc.IJAXRPCService jaxrpcService)
           
 void setJmxService(org.ow2.jonas.jmx.JmxService jmxService)
           
 void setJSFService(org.ow2.jonas.jsf.JSFService jsfService)
           
 void setMultitenantService(org.ow2.jonas.multitenant.MultitenantService multitenantService)
           
 void setNaming(org.ow2.jonas.naming.JNamingManager naming)
           
 void setOnDemandFeature(boolean onDemandFeatureEnabled)
          Enable or not the on demand feature.
 void setOnDemandRedirectPort(int onDemandRedirectPort)
          Sets the redirect port number.
 void setParsingwithvalidation(boolean validate)
           
protected  void setServerName(String serverName)
           
protected  void setServerVersion(String serverVersion)
           
 void setVersioningService(org.ow2.jonas.versioning.VersioningService versioningService)
           
 void setWarDeployableMetadataFactory(org.ow2.util.ee.metadata.war.api.IWarDeployableMetadataFactory warDeployableMetadataFactory)
           
protected  void setWebEnvironment(Context ctxParam, org.ow2.easybeans.deployment.api.EZBInjectionHolder ezbInjectionHolder, ClassLoader webAppClassLoader)
          Set the environment of the web container inside the given context.
 void setWorkCleanerService(org.ow2.jonas.workcleaner.WorkCleanerService workCleanerService)
          Method called when the workCleanerService is bound to the component.
abstract  void startInternalWebContainer()
          Starts the specific code for the web container implementation.
 void unbindJaxwsService(org.ow2.jonas.ws.jaxws.IJAXWSService jaxwsService)
          Release the reference to the JAWS Service.
 void unDeployWars(URL[] urls)
          Undeploy the given wars of an ear file with the specified parent classloader (ejb classloader or ear classloader).
protected  void unRegisterWar(Context ctx)
          Delegate the un-registration to the implementation of the web container and delete the environment associated to the WAR file.
 void unRegisterWar(String fileName)
          Unregister a WAR by delegating the operation to the unRegisterWar() method.
 void unRegisterWar(org.ow2.util.ee.deploy.api.deployable.WARDeployable deployable)
          Un-register a WAR by delegating the operation to the unRegisterWar(Context) method.
protected  void unregisterWarMBean(String domainName, String fileName)
          Unegister War MBean.
protected  void unregisterWebServiceMBean(String domainName)
          Unregister WEB Container Service MBean.
 void unsetAuditService()
          Sets the audit service to null.
 void unsetDeployableHelper()
          Unbind the IDeployableHelper.
 void unsetEjb3Service()
          Unbind the IEasyBeansService.
 void unsetMultitenantService()
          Sets the multitenant service to null.
 void unsetVersioningService()
          Sets the versioning service to null.
protected  String updateContextRoot(String contextRoot, org.ow2.util.ee.deploy.api.deployable.IDeployable deployable)
          Update context root by adding tenantId and application instance name
protected abstract  void updateServerInfos()
          Update info of the serverName and serverVersion.
 
Methods inherited from class org.ow2.jonas.lib.service.AbsConfigServiceImpl
registerAddonConfig, unregisterAddonConfig
 
Methods inherited from class org.ow2.jonas.lib.service.AbsServiceImpl
convertToList, doInit, getDomainName, getJonasServerName, getName, getSequenceNumber, getServerProperties, init, isStarted, setName, setServerProperties, start, stop, throwRequirementException, toString
 
Methods inherited from class org.ow2.jonas.lib.management.javaee.ManagedObject
getModelMBean, sendNotification, sendReconfigNotification, sendSaveNotification, setModelMBean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
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
 

Field Detail

JONAS_BASE

protected static final String JONAS_BASE
The name of the JONAS_BASE directory.


SINGLE_WORK_WEBAPPS_DIR_SUFFIX

protected static final String SINGLE_WORK_WEBAPPS_DIR_SUFFIX
The name of the property used in work directory for single webapps (not ear case).

See Also:
Constant Field Values

INEAR_WORK_WEBAPPS_DIR_SUFFIX

protected static final String INEAR_WORK_WEBAPPS_DIR_SUFFIX
The name of the property used in work directory for EAR webapps (in ear case).

See Also:
Constant Field Values

jmxService

protected org.ow2.jonas.jmx.JmxService jmxService
JMX Service.


jsfService

protected org.ow2.jonas.jsf.JSFService jsfService
JSF Service.

Constructor Detail

BaseWebContainerService

public BaseWebContainerService(org.osgi.framework.BundleContext bundleContext)
Default constructor.

Parameters:
bundleContext - the OSGi bundle context
Method Detail

setParsingwithvalidation

public void setParsingwithvalidation(boolean validate)
Parameters:
validate - must we parse web.xml files with validation ?

doStart

protected void doStart()
                throws org.ow2.jonas.service.ServiceException
Start the service.

Specified by:
doStart in class org.ow2.jonas.lib.service.AbsServiceImpl
Throws:
org.ow2.jonas.service.ServiceException - if the startup failed.

createHttpServiceFactory

protected abstract HttpServiceFactory<?> createHttpServiceFactory()
Creates an instance of the http service factory.

Returns:
an instance of the httpservice factory

doStop

protected void doStop()
               throws org.ow2.jonas.service.ServiceException
Stop the service.

Specified by:
doStop in class org.ow2.jonas.lib.service.AbsServiceImpl
Throws:
org.ow2.jonas.service.ServiceException - if the stop failed.

doRegisterWar

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

Parameters:
ctx - the context which contains the configuration in order to deploy a WAR.
Throws:
org.ow2.jonas.web.JWebContainerServiceException - if the registration of the WAR failed.

doUnRegisterWar

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

Parameters:
ctx - the context which contains the configuration in order to undeploy a WAR.
Throws:
org.ow2.jonas.web.JWebContainerServiceException - if the unregistration failed.

startInternalWebContainer

public abstract void startInternalWebContainer()
                                        throws org.ow2.jonas.web.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)

Throws:
org.ow2.jonas.web.JWebContainerServiceException - if container is not started

isInternalContainerStarted

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

Returns:
true if it is already started

getUnpackedURL

protected URL getUnpackedURL(URL warURL,
                             org.ow2.util.ee.deploy.api.deployable.EARDeployable earDeployable)
                      throws org.ow2.jonas.web.JWebContainerServiceException
Return the URL where warURL has been unpacked.

Parameters:
warURL - the URL of the war
earDeployable - the EAR deployable (could be null)
Returns:
the URL where warURL has been unpacked.
Throws:
org.ow2.jonas.web.JWebContainerServiceException - when it is impossible to retrieve the unpacked URL.

getClassLoader

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

Specified by:
getClassLoader in interface org.ow2.jonas.web.JWebContainerService
Parameters:
warURL - the url of the war we want to get the loader
earDeployable - If the WAR is in an EAR application
parentLoader - the ejb class loader of the ear. May be null in non ear case.
Returns:
the class loader of the given warURL.
Throws:
org.ow2.jonas.web.JWebContainerServiceException - if the process failed.

getContextLinkedClassLoader

public ClassLoader getContextLinkedClassLoader(URL warURL)
Specified by:
getContextLinkedClassLoader in interface org.ow2.jonas.web.JWebContainerService
Parameters:
warURL - the URL of the webapp
Returns:
Returns the ClassLoader used to link a JNDI environnment to a webapp

registerWar

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

Parameters:
ctx - the context which contains the configuration in order to deploy a WAR.
Throws:
org.ow2.jonas.web.JWebContainerServiceException - if the registration of the WAR failed.

getContextRoot

protected String getContextRoot(String contextRoot,
                                URLClassLoader earClassLoader,
                                URL warURL,
                                org.ow2.jonas.deployment.web.WebContainerDeploymentDesc webDD)
Gets the context root for a WAR.

Parameters:
contextRoot - Current context root, null if none.
earClassLoader - EAR classloader for the WAR, null if none.
warURL - War file's URL.
webDD - Deployment descriptor of the WAR file.
Returns:
Context root, checked (always begin with one slash).

getTenantId

protected String getTenantId(org.ow2.util.ee.deploy.api.deployable.IDeployable deployable)
Gets tenantId for an application

Parameters:
deployable -
Returns:
tenantId

getInstanceName

protected String getInstanceName()
Gets application instance name

Returns:
instance name

updateContextRoot

protected String updateContextRoot(String contextRoot,
                                   org.ow2.util.ee.deploy.api.deployable.IDeployable deployable)
Update context root by adding tenantId and application instance name

Parameters:
contextRoot - Current context root
deployable -
Returns:
updated context root

registerWar

public void registerWar(String fileName)
                 throws RemoteException,
                        org.ow2.jonas.web.JWebContainerServiceException
Register a WAR by delegating the operation to the registerWar() method. This is used for JMX management.

Specified by:
registerWar in interface org.ow2.jonas.web.JWebContainerService
Parameters:
fileName - the name of the war to deploy.
Throws:
RemoteException - if rmi call failed.
org.ow2.jonas.web.JWebContainerServiceException - if the registration failed.

registerWar

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

Specified by:
registerWar in interface org.ow2.jonas.web.JWebContainerService
Parameters:
deployable - the webapp to be deployed
Throws:
org.ow2.jonas.web.JWebContainerServiceException - if the registration failed.

setWebEnvironment

protected void setWebEnvironment(Context ctxParam,
                                 org.ow2.easybeans.deployment.api.EZBInjectionHolder ezbInjectionHolder,
                                 ClassLoader webAppClassLoader)
                          throws org.ow2.jonas.web.JWebContainerServiceException
Set the environment of the web container inside the given context.

Parameters:
ctxParam - the java:comp/env/ environment where is stored the values of the web container environment.
ezbInjectionHolder - the easybeans injection handler.
webAppClassLoader - the classloader of the web application.
Throws:
org.ow2.jonas.web.JWebContainerServiceException - if the populating of the environment failed.

unRegisterWar

protected void unRegisterWar(Context ctx)
                      throws org.ow2.jonas.web.JWebContainerServiceException
Delegate the un-registration to the implementation of the web container and delete the environment associated to the WAR file.

Parameters:
ctx - the context which contains the configuration in order to un-deploy a WAR.
Throws:
org.ow2.jonas.web.JWebContainerServiceException - if the un-registration failed.

unRegisterWar

public void unRegisterWar(String fileName)
                   throws RemoteException,
                          org.ow2.jonas.web.JWebContainerServiceException
Unregister a WAR by delegating the operation to the unRegisterWar() method. This is used for JMX management.

Specified by:
unRegisterWar in interface org.ow2.jonas.web.JWebContainerService
Parameters:
fileName - the name of the war to undeploy.
Throws:
RemoteException - if rmi call failed.
org.ow2.jonas.web.JWebContainerServiceException - if the unregistration failed.

unRegisterWar

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

Specified by:
unRegisterWar in interface org.ow2.jonas.web.JWebContainerService
Parameters:
deployable - the webapp to be un-deployed.
Throws:
org.ow2.jonas.web.JWebContainerServiceException - if the un-registration failed.

deployWars

public void deployWars(Context ctx)
                throws org.ow2.jonas.web.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).

Specified by:
deployWars in interface org.ow2.jonas.web.JWebContainerService
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:
org.ow2.jonas.web.JWebContainerServiceException - if an error occurs during the deployment.

unDeployWars

public 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).

Specified by:
unDeployWars in interface org.ow2.jonas.web.JWebContainerService
Parameters:
urls - the list of the urls of the wars to undeploy.

getWar

public War getWar(URL url)
Get the war identified by its URL (.war).

Parameters:
url - the URL of the war to get.
Returns:
the war indentified by its URL, or null if the war is not found.

getWar

protected List<War> getWar(String pContext)
Get a list of wars identified by their Context.

Parameters:
pContext - the context of the war to get.
Returns:
the list of wars indentified by their Context, or an empty list if no wars are found.

removeCache

public 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.

Specified by:
removeCache in interface org.ow2.jonas.web.JWebContainerService
Parameters:
earClassLoader - the ClassLoader of the ear application to remove from the cache.

checkWarFile

protected URL checkWarFile(String fileName)
                    throws org.ow2.jonas.web.JWebContainerServiceException
Check if the specified file name correspond to a file which is located relatively to where the JOnAS server is launched or in the $JONAS_BASE/web-apps.

Parameters:
fileName - the file to check if it exists.
Returns:
the URL of the file found (either relatively to the JOnAS server or to the $JONAS_BASE/web-apps).
Throws:
org.ow2.jonas.web.JWebContainerServiceException - if the specified file does't exists.

checkWarDeployed

protected URL checkWarDeployed(String fileName)
                        throws org.ow2.jonas.web.JWebContainerServiceException
Check if the specified file is already deployed in the JOnAS server and return the URL of this deployed war file.

Parameters:
fileName - the name of the WAR file to check.
Returns:
the URL of the deployed war file.
Throws:
org.ow2.jonas.web.JWebContainerServiceException - if the file name doesn't correspond to a deployed war.

getCurrentNumberOfWars

public Integer getCurrentNumberOfWars()
Specified by:
getCurrentNumberOfWars in interface BaseWebContainerServiceMBean
Returns:
current number of wars deployed in the JOnAS server

isWarLoaded

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

Specified by:
isWarLoaded in interface BaseWebContainerServiceMBean
Specified by:
isWarLoaded in interface org.ow2.jonas.web.JWebContainerService
Parameters:
fileName - the name of the war file.
Returns:
true if the war is deployed, else false.

getDeployedWars

public List<String> getDeployedWars()
Return the list of all loaded web applications.

Specified by:
getDeployedWars in interface BaseWebContainerServiceMBean
Returns:
The list of deployed web applications

getServerName

public String getServerName()
Gets the name of the server which is the web container.

Specified by:
getServerName in interface BaseWebContainerServiceMBean
Returns:
the name of the server which is the web container

getServerVersion

public String getServerVersion()
Gets the version of the server which is the web container.

Specified by:
getServerVersion in interface BaseWebContainerServiceMBean
Returns:
the version of the server which is the web container

isWarDeployedByWorkName

public boolean isWarDeployedByWorkName(String unpackName)
Test if the specified unpack name is already deployed or not. This method is defined in the JWebContainerService interface.

Specified by:
isWarDeployedByWorkName in interface org.ow2.jonas.web.JWebContainerService
Parameters:
unpackName - the name of the ear file.
Returns:
true if the ear is deployed, else false.

updateServerInfos

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


getDefaultHost

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

Specified by:
getDefaultHost in interface org.ow2.jonas.web.JWebContainerService
Returns:
the Default host name of the web container.
Throws:
org.ow2.jonas.web.JWebContainerServiceException - when it is impossible to get the Default Host.

getDefaultHttpPort

public abstract String getDefaultHttpPort()
                                   throws org.ow2.jonas.web.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 org.ow2.jonas.web.JWebContainerService
Returns:
the Default HTTP port number of the web container.
Throws:
org.ow2.jonas.web.JWebContainerServiceException - when it is impossible to get the Default Http port.

getDefaultHttpsPort

public abstract String getDefaultHttpsPort()
                                    throws org.ow2.jonas.web.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 org.ow2.jonas.web.JWebContainerService
Returns:
the Default HTTPS port number of the web container.
Throws:
org.ow2.jonas.web.JWebContainerServiceException - when it is impossible to get the Default Https port.

getLogger

protected static org.objectweb.util.monolog.api.Logger getLogger()
Returns:
Returns the logger.

getNaming

protected org.ow2.jonas.naming.JNamingManager getNaming()
Returns:
Returns the naming.

setServerName

protected void setServerName(String serverName)
Parameters:
serverName - The serverName to set.

setServerVersion

protected void setServerVersion(String serverVersion)
Parameters:
serverVersion - The serverVersion to set.

getContextFactory

protected org.ow2.jonas.naming.JComponentContextFactory getContextFactory()
Returns:
the JComponentContextFactory.

registerWebServiceMBean

protected void registerWebServiceMBean(Object service,
                                       String domainName)
Register WEB Container Service MBean.

Parameters:
service - web container service to manage
domainName - domain name

unregisterWebServiceMBean

protected void unregisterWebServiceMBean(String domainName)
Unregister WEB Container Service MBean.

Parameters:
domainName - domain name

registerWarMBean

protected void registerWarMBean(War war,
                                String domainName,
                                String fileName)
Register War MBean.

Parameters:
war - War instance to manage
domainName - domain name
fileName - the war file name

unregisterWarMBean

protected void unregisterWarMBean(String domainName,
                                  String fileName)
Unegister War MBean.

Parameters:
domainName - domain name
fileName - the war file name

setJmxService

public void setJmxService(org.ow2.jonas.jmx.JmxService jmxService)
Parameters:
jmxService - the jmxService to set

setJSFService

public void setJSFService(org.ow2.jonas.jsf.JSFService jsfService)
Parameters:
jsfService - the JSFService to set

getJmxService

public org.ow2.jonas.jmx.JmxService getJmxService()
Returns:
the jmxService

setJAXRPCService

public void setJAXRPCService(org.ow2.jonas.ws.jaxrpc.IJAXRPCService jaxrpcService)
Parameters:
jaxrpcService - the jaxrpcService to set

setNaming

public void setNaming(org.ow2.jonas.naming.JNamingManager naming)
Parameters:
naming - the naming to set

setContextFactory

public void setContextFactory(org.ow2.jonas.naming.JComponentContextFactory contextFactory)
Parameters:
contextFactory - the contextFactory to set

setDeployerManager

public void setDeployerManager(org.ow2.util.ee.deploy.api.deployer.IDeployerManager deployerManager)
Parameters:
deployerManager - the IDeployerManager to use.

initWorkingDirectory

protected void initWorkingDirectory()
Create working directory for applications.


setWorkCleanerService

public void setWorkCleanerService(org.ow2.jonas.workcleaner.WorkCleanerService workCleanerService)
Method called when the workCleanerService is bound to the component.

Parameters:
workCleanerService - the workCleanerService reference

getWarLoaders

protected Hashtable getWarLoaders()
Returns:
Associates an URL of an unpacked WAR file to its classloader.

getWarBindings

protected Hashtable getWarBindings()
Returns:
Associates an URL of a deployed WAR file to its classloader.

getWarDeployed

protected List<War> getWarDeployed()
Returns:
List of the war deployed by the Web container Service.

getJAXRPCService

protected org.ow2.jonas.ws.jaxrpc.IJAXRPCService getJAXRPCService()
Returns:
Reference to the JAX-RPC service.

getAppsClassLoader

protected ClassLoader getAppsClassLoader()
Returns:
Application Classloader.

setVersioningService

public void setVersioningService(org.ow2.jonas.versioning.VersioningService versioningService)
Parameters:
versioningService - The versioning service to set.

unsetVersioningService

public void unsetVersioningService()
Sets the versioning service to null.


getVersioningService

public org.ow2.jonas.versioning.VersioningService getVersioningService()
Returns:
The versioning service.

isVersioningEnabled

public boolean isVersioningEnabled()
Returns:
Whether versioning is enabled.

setMultitenantService

public void setMultitenantService(org.ow2.jonas.multitenant.MultitenantService multitenantService)
Parameters:
multitenantService - The multitenant service to set.

unsetMultitenantService

public void unsetMultitenantService()
Sets the multitenant service to null.


getMultitenantService

public org.ow2.jonas.multitenant.MultitenantService getMultitenantService()
Returns:
The multitenant service.

isMultitenantEnabled

public boolean isMultitenantEnabled()
Returns:
Whether multitenant is enabled.

setAuditService

public void setAuditService(org.ow2.jonas.audit.AuditService auditService)
Parameters:
auditService - The audit service to set.

unsetAuditService

public void unsetAuditService()
Sets the audit service to null.


getAuditService

public org.ow2.jonas.audit.AuditService getAuditService()
Returns:
The audit service.

setWarDeployableMetadataFactory

public void setWarDeployableMetadataFactory(org.ow2.util.ee.metadata.war.api.IWarDeployableMetadataFactory warDeployableMetadataFactory)
Parameters:
warDeployableMetadataFactory - the deployable metadata factory service

bindJaxwsService

public void bindJaxwsService(org.ow2.jonas.ws.jaxws.IJAXWSService jaxwsService)
Store the reference to the JAX-WS Service.

Parameters:
jaxwsService - jaxws Service

getJAXWSService

protected org.ow2.jonas.ws.jaxws.IJAXWSService getJAXWSService()
Returns:
the jaxws service

unbindJaxwsService

public void unbindJaxwsService(org.ow2.jonas.ws.jaxws.IJAXWSService jaxwsService)
Release the reference to the JAWS Service.

Parameters:
jaxwsService - jaxws Service

setEjb3Service

public void setEjb3Service(org.ow2.jonas.ejb3.IEasyBeansService service)
Parameters:
service - the EJB3 Service to be injected.

unsetEjb3Service

public void unsetEjb3Service()
Unbind the IEasyBeansService.


setDeployableHelper

public void setDeployableHelper(org.ow2.util.ee.deploy.api.helper.IDeployableHelper deployableHelper)
Parameters:
deployableHelper - the deployable helper

unsetDeployableHelper

public void unsetDeployableHelper()
Unbind the IDeployableHelper.


setOnDemandFeature

public void setOnDemandFeature(boolean onDemandFeatureEnabled)
Enable or not the on demand feature.

Parameters:
onDemandFeatureEnabled - boolean true/false

setOnDemandRedirectPort

public void setOnDemandRedirectPort(int onDemandRedirectPort)
Sets the redirect port number.

Parameters:
onDemandRedirectPort - the given port used for OnDemand proxy

isOnDemandFeatureEnabled

public boolean isOnDemandFeatureEnabled()
Returns:
true if the on demand feature is enabled and in development mode.

getOnDemandRedirectPort

public int getOnDemandRedirectPort()
Returns:
the on demande Http port.

getRandomPort

public int getRandomPort()
Returns:
a random and available port for the ondemand.

setDefaultHttpPort

protected void setDefaultHttpPort(int portNumber)
Callback when a http port is defined

Parameters:
portNumber - the given port number

setDefaultHttpsPort

protected void setDefaultHttpsPort(int portNumber)
Callback when a https port is defined

Parameters:
portNumber - the given port number

getBundleContext

protected org.osgi.framework.BundleContext getBundleContext()
Returns:
the bundle context of this service.

getWebappsWorkDirectory

protected String getWebappsWorkDirectory()
Returns:
work directory for webapps.

addTldResource

public void addTldResource(URL tldResource)
Add the given TLD URL as a resource.

Parameters:
tldResource - the given TLD resource

removeTldResource

public void removeTldResource(URL tldResource)
Remove the given TLD URL as a resource.

Parameters:
tldResource - the given TLD resource

getTLDResources

public List<URL> getTLDResources()
Returns:
the TLD resources.

getWarDeployer

protected WARDeployer getWarDeployer()
Returns:
WAR deployer

isEjbinwarEnabled

public boolean isEjbinwarEnabled()
Returns:
true if EJB in War feature is enabled.

setEjbinwar

public void setEjbinwar(boolean ejbinwar)
Defines EJB in WAR feature.

Parameters:
ejbinwar - true if enabled, false to disable

getDataSourceService

public org.ow2.jonas.datasource.DataSourceService getDataSourceService()

setDataSourceService

public void setDataSourceService(org.ow2.jonas.datasource.DataSourceService dataSourceService)


Copyright © 2013 OW2 Consortium. All Rights Reserved.