org.codehaus.cargo.container.jetty
Class Jetty7xEmbeddedLocalContainer

java.lang.Object
  extended by org.codehaus.cargo.util.log.LoggedObject
      extended by org.codehaus.cargo.container.spi.AbstractContainer
          extended by org.codehaus.cargo.container.spi.AbstractLocalContainer
              extended by org.codehaus.cargo.container.spi.AbstractEmbeddedLocalContainer
                  extended by org.codehaus.cargo.container.jetty.internal.AbstractJettyEmbeddedLocalContainer
                      extended by org.codehaus.cargo.container.jetty.Jetty7xEmbeddedLocalContainer
All Implemented Interfaces:
Container, EmbeddedLocalContainer, RunnableContainer, LocalContainer, Loggable

public class Jetty7xEmbeddedLocalContainer
extends AbstractJettyEmbeddedLocalContainer

A Jetty 7.x instance running embedded.

Version:
$Id: Jetty7xEmbeddedLocalContainer.java 1735 2008-09-25 08:58:42Z alitokmen $

Field Summary
static String ID
          Unique container id.
 
Fields inherited from class org.codehaus.cargo.container.jetty.internal.AbstractJettyEmbeddedLocalContainer
server
 
Constructor Summary
Jetty7xEmbeddedLocalContainer(LocalConfiguration configuration)
          
 
Method Summary
 void addHandler(Object handler)
          Deploy the handler representing the webapp to jetty.
 Object createHandler(Deployable deployable)
          Create a WebAppContext for the Deployable.
 Object createHandler(String contextPath, String war)
          Create a WebAppContext for the webapp given as a string.
protected  void createServerObject()
          Create a Jetty Server Object.
protected  void doStart()
          Implementation of RunnableContainer.start() that all containers extending this class must implement.
 String getId()
          
 String getName()
          
 void removeHandler(Object handler)
          Undeploy the handler representing the webapp.
 void setDefaultRealm(Object webapp)
          If a default realm is available, set it on the given webapp.
 
Methods inherited from class org.codehaus.cargo.container.jetty.internal.AbstractJettyEmbeddedLocalContainer
doStop, getCapability, getServer
 
Methods inherited from class org.codehaus.cargo.container.spi.AbstractEmbeddedLocalContainer
getClassLoader, getType, setClassLoader, startInternal, stopInternal
 
Methods inherited from class org.codehaus.cargo.container.spi.AbstractLocalContainer
getConfiguration, getFileHandler, getOutput, getState, getTimeout, isAppend, setAppend, setConfiguration, setFileHandler, setOutput, setState, setTimeout, start, stop, verify, waitForCompletion
 
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.cargo.container.LocalContainer
getConfiguration, getFileHandler, setConfiguration, setFileHandler
 
Methods inherited from interface org.codehaus.cargo.container.Container
getState
 
Methods inherited from interface org.codehaus.cargo.util.log.Loggable
getLogger, setLogger
 
Methods inherited from interface org.codehaus.cargo.container.internal.RunnableContainer
getOutput, getTimeout, isAppend, setAppend, setOutput, setTimeout, start, stop
 

Field Detail

ID

public static final String ID
Unique container id.

See Also:
Constant Field Values
Constructor Detail

Jetty7xEmbeddedLocalContainer

public Jetty7xEmbeddedLocalContainer(LocalConfiguration configuration)

See Also:
AbstractJettyEmbeddedLocalContainer.AbstractJettyEmbeddedLocalContainer(org.codehaus.cargo.container.configuration.LocalConfiguration)
Method Detail

getId

public String getId()

Returns:
the short name of the container. Note: this is not a unique id. It is simply the name in a computer-usable format.
See Also:
Container.getId()

getName

public String getName()

Returns:
the human readable name of the Container (ex: "Resin 3.x", "JBoss 3.0.8", etc).
See Also:
Container.getName()

setDefaultRealm

public void setDefaultRealm(Object webapp)
                     throws Exception
If a default realm is available, set it on the given webapp.

Parameters:
webapp - the webapp to set the realm on
Throws:
Exception - on invokation error

doStart

protected void doStart()
                throws Exception
Implementation of RunnableContainer.start() that all containers extending this class must implement.

Specified by:
doStart in class AbstractEmbeddedLocalContainer
Throws:
Exception - if any error is raised during the container start
See Also:
AbstractEmbeddedLocalContainer.doStart()

createHandler

public Object createHandler(Deployable deployable)
                     throws Exception
Create a WebAppContext for the Deployable. NB also force the defaultRealm to be set on it if one is present.

Parameters:
deployable - the cargo webapp to deploy
Returns:
a jetty webapp
Throws:
Exception - on invokation exception

createHandler

public Object createHandler(String contextPath,
                            String war)
                     throws Exception
Create a WebAppContext for the webapp given as a string. NB Also force the defaultRealm to be set if one is present.

Parameters:
contextPath - the context path for the webapp
war - the webapp
Returns:
a jetty webapp
Throws:
Exception - on invokation exception

addHandler

public void addHandler(Object handler)
                throws Exception
Deploy the handler representing the webapp to jetty. If jetty is already started, then start the handler.

Parameters:
handler - the handler representing the webapp
Throws:
Exception - on invocation exception

removeHandler

public void removeHandler(Object handler)
                   throws Exception
Undeploy the handler representing the webapp.

Parameters:
handler - the handler representing the webapp
Throws:
Exception - on invocation exception

createServerObject

protected void createServerObject()
                           throws Exception
Create a Jetty Server Object.

Overrides:
createServerObject in class AbstractJettyEmbeddedLocalContainer
Throws:
Exception - in case of error
See Also:
AbstractJettyEmbeddedLocalContainer.createServerObject()


Copyright © 2004-2012 Codehaus. All Rights Reserved.