org.springframework.osgi.web.extender.deployer.tomcat
Class TomcatWarDeployer

java.lang.Object
  extended by org.springframework.osgi.web.extender.deployer.support.AbstractWarDeployer
      extended by org.springframework.osgi.web.extender.deployer.tomcat.TomcatWarDeployer
All Implemented Interfaces:
InitializingBean, BundleContextAware, WarDeployer

public class TomcatWarDeployer
extends AbstractWarDeployer

Apache Tomcat 5.5.x/6.0.x specific war deployer. Unpacks the given bundle into a temporary folder which is then used for deploying the war into the web container.

The deployer expects the Catalina instance to be published as an OSGi service under Embedded class.

Author:
Costin Leau
See Also:
Context, Container, Loader

Field Summary
 
Fields inherited from class org.springframework.osgi.web.extender.deployer.support.AbstractWarDeployer
log
 
Constructor Summary
TomcatWarDeployer()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  Object createDeployment(Bundle bundle, String contextPath)
          Creates and configures (but does not start) the web deployment for the given bundle.
protected  String getServerInfo()
          Returns a nice String representation of the underlying server for logging messages.
protected  void startDeployment(Object deployment)
          Starts the deployment artifact.
protected  void stopDeployment(Bundle bundle, Object deployment)
          Stops the deployment artifact.
 
Methods inherited from class org.springframework.osgi.web.extender.deployer.support.AbstractWarDeployer
deploy, getBundleContext, setBundleContext, undeploy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TomcatWarDeployer

public TomcatWarDeployer()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class AbstractWarDeployer
Throws:
Exception

createDeployment

protected Object createDeployment(Bundle bundle,
                                  String contextPath)
                           throws Exception
Description copied from class: AbstractWarDeployer
Creates and configures (but does not start) the web deployment for the given bundle. The returned object is used during the deploy/undeploy stages; implementations are free to use whatever appeals to the target environment. The returned object will be given as argument to AbstractWarDeployer.startDeployment(Object) and AbstractWarDeployer.stopDeployment(Bundle, Object).

Specified by:
createDeployment in class AbstractWarDeployer
Parameters:
bundle - OSGi bundle deployed as war
contextPath - WAR context path
Returns:
web deployment artifact
Throws:
Exception - if something goes wrong

startDeployment

protected void startDeployment(Object deployment)
                        throws Exception
Description copied from class: AbstractWarDeployer
Starts the deployment artifact.

Specified by:
startDeployment in class AbstractWarDeployer
Parameters:
deployment - web deployment artifact
Throws:
Exception - if something goes wrong

stopDeployment

protected void stopDeployment(Bundle bundle,
                              Object deployment)
                       throws Exception
Description copied from class: AbstractWarDeployer
Stops the deployment artifact.

Specified by:
stopDeployment in class AbstractWarDeployer
Parameters:
bundle - OSGi bundle backing the OSGi deployment
deployment - web deployment artifact
Throws:
Exception - if something goes wrong

getServerInfo

protected String getServerInfo()
Description copied from class: AbstractWarDeployer
Returns a nice String representation of the underlying server for logging messages.

Specified by:
getServerInfo in class AbstractWarDeployer
Returns:
toString for the running environment


Copyright © 2006-2008 Spring Framework. All Rights Reserved.