org.springframework.osgi.web.deployer.jetty
Class JettyWarDeployer

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

public class JettyWarDeployer
extends AbstractWarDeployer

Jetty 6.1.x+ specific war deployer. Unpacks the given bundle into a temporary folder which is then used for deploying the war into the web container. While the bundle could be used in packed formed by Jetty, for performance reasons and JSP support (through Jasper) an unpack, file-system based format is required (thus the unpacking).

The deployer works with a Server instance which can be either configured by the user (setServer(Object) or detected automatically by the deployer.

Author:
Costin Leau
See Also:
WebAppContext

Field Summary
 
Fields inherited from class org.springframework.osgi.web.deployer.support.AbstractWarDeployer
log
 
Constructor Summary
JettyWarDeployer()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  WarDeployment 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.
 void setServer(Object server)
          Sets the Jetty Server used by this deployer.
protected  void startDeployment(WarDeployment deployment)
          Starts the deployment artifact using the object returned by AbstractWarDeployer.createDeployment(Bundle, String).
 
Methods inherited from class org.springframework.osgi.web.deployer.support.AbstractWarDeployer
deploy, getBundleContext, setBundleContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JettyWarDeployer

public JettyWarDeployer()
Method Detail

setServer

public void setServer(Object server)
Sets the Jetty Server used by this deployer. If none is set (the default), the deployer will look for an OSGi service, matching the Server interface (using a timeout of 5 seconds).

To avoid the dependencies on Jetty classes in its signature, this setter accepts a plain Object that is checked and casted internally.

Parameters:
server - Jetty server (normally a Spring-DM OSGi service reference)

afterPropertiesSet

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

createDeployment

protected WarDeployment createDeployment(Bundle bundle,
                                         String contextPath)
                                  throws Exception
Creates and configures (but does not start) the web deployment for the given bundle. The returned object will be passed to AbstractWarDeployer.startDeployment(WarDeployment). Creates an OSGi-specific Jetty war deployer.

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(WarDeployment deployment)
                        throws Exception
Description copied from class: AbstractWarDeployer
Starts the deployment artifact using the object returned by AbstractWarDeployer.createDeployment(Bundle, String).

Specified by:
startDeployment in class AbstractWarDeployer
Parameters:
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-2011 Spring Framework. All Rights Reserved.