org.ow2.jonas.web.tomcat6.ws
Class WebservicesWebDeployer

java.lang.Object
  extended by org.ow2.jonas.web.tomcat6.ws.WebservicesWebDeployer
All Implemented Interfaces:
IWebDeployer

public class WebservicesWebDeployer
extends Object
implements IWebDeployer

The WebservicesWebDeployer is responsible of deploying/creating/removing web contexts for EJB based endpoints.

Author:
Guillaume Sauthier

Constructor Summary
WebservicesWebDeployer(Tomcat6Service tomcatService)
          Construct a new WebservicesWebDeployer manager based on Tomcat.
 
Method Summary
protected  JOnASStandardContext createWebservicesContext(String contextName)
          Creates an empty (no servlets registered) StandardContext setup for serving webservices endpoints.
 void deploy(IWebservicesModule<? extends IWebservicesContainer<? extends IEJBWebserviceEndpoint>> module)
          Deploy the given module, with all its endpoints in the web container, creating appropriate contexts when required.
protected  void deployEndpoints(org.ow2.jonas.web.tomcat6.ws.WebservicesWebDeployer.WebContext webContext, List<IEJBWebserviceEndpoint> endpoints)
          Deploy a context and the associated endpoints.
protected  List<String> getAssociatedWebContexts(IWebservicesModule<? extends IWebservicesContainer<? extends IEJBWebserviceEndpoint>> module)
          Get the web contexts list associated with the WS module's endpoints.
 void setWorkDirectory(String workDirectory)
           
 void undeploy(IWebservicesModule<? extends IWebservicesContainer<? extends IEJBWebserviceEndpoint>> module)
          Undeploy the given module, with all its endpoints from the web container.
protected  org.apache.catalina.core.StandardWrapper wrapWebserviceEndpoint(IEJBWebserviceEndpoint endpoint)
          Wrap the WS endpoint in a StandardWrapper instance that represents the Servlet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebservicesWebDeployer

public WebservicesWebDeployer(Tomcat6Service tomcatService)
Construct a new WebservicesWebDeployer manager based on Tomcat.

Parameters:
tomcatService - Tomcat instance
Method Detail

setWorkDirectory

public void setWorkDirectory(String workDirectory)
Parameters:
workDirectory - the workDirectory to set

deploy

public void deploy(IWebservicesModule<? extends IWebservicesContainer<? extends IEJBWebserviceEndpoint>> module)
            throws WSException
Deploy the given module, with all its endpoints in the web container, creating appropriate contexts when required.

Specified by:
deploy in interface IWebDeployer
Parameters:
module - the webservices module to deploy
Throws:
WSException - if deployment went wrong.

deployEndpoints

protected void deployEndpoints(org.ow2.jonas.web.tomcat6.ws.WebservicesWebDeployer.WebContext webContext,
                               List<IEJBWebserviceEndpoint> endpoints)
                        throws WSException
Deploy a context and the associated endpoints.

Parameters:
webContext - context to be created
endpoints - endpoints to be deployed
Throws:
WSException

undeploy

public void undeploy(IWebservicesModule<? extends IWebservicesContainer<? extends IEJBWebserviceEndpoint>> module)
Undeploy the given module, with all its endpoints from the web container. An implementation should catch most of the Exceptions and try to cleanupas much as possible.

Specified by:
undeploy in interface IWebDeployer
Parameters:
module - the webservices module to undeploy

getAssociatedWebContexts

protected List<String> getAssociatedWebContexts(IWebservicesModule<? extends IWebservicesContainer<? extends IEJBWebserviceEndpoint>> module)
Get the web contexts list associated with the WS module's endpoints. Theses contexts will be undeployed.

Parameters:
module - WS hosting module
Returns:
list of undeployable web contexts

createWebservicesContext

protected JOnASStandardContext createWebservicesContext(String contextName)
Creates an empty (no servlets registered) StandardContext setup for serving webservices endpoints.

Parameters:
contextName - name of the context
Returns:
a configured Context

wrapWebserviceEndpoint

protected org.apache.catalina.core.StandardWrapper wrapWebserviceEndpoint(IEJBWebserviceEndpoint endpoint)
Wrap the WS endpoint in a StandardWrapper instance that represents the Servlet.

Parameters:
endpoint - endpoint to be wrapped
Returns:
a Servlet representation


Copyright © 2010 OW2 Consortium. All Rights Reserved.