org.codehaus.cargo.container.jetty
Class Jetty6xEmbeddedLocalContainer

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

public class Jetty6xEmbeddedLocalContainer
extends AbstractJettyEmbeddedLocalContainer

A Jetty 6.x instance running embedded.

Version:
$Id: Jetty6xEmbeddedLocalContainer.java 1269 2007-01-11 16:11:33Z janb $

Field Summary
static java.lang.String ID
          Unique container id.
 
Fields inherited from class org.codehaus.cargo.container.jetty.internal.AbstractJettyEmbeddedLocalContainer
server
 
Constructor Summary
Jetty6xEmbeddedLocalContainer(org.codehaus.cargo.container.configuration.LocalConfiguration configuration)
          {@inheritDoc}
 
Method Summary
 void addHandler(java.lang.Object handler)
          Deploy the handler representing the webapp to jetty.
 java.lang.Object createHandler(org.codehaus.cargo.container.deployable.Deployable deployable)
          Create a WebAppContext for the Deployable.
 java.lang.Object createHandler(java.lang.String contextPath, java.lang.String war)
          Create a WebAppContext for the webapp given as a string.
protected  void createServerObject()
          Create a Jetty Server Object.
protected  void doStart()
          
 java.lang.String getId()
          
 java.lang.String getName()
          
 void removeHandler(java.lang.Object handler)
          Undeploy the handler representing the webapp.
 void setDefaultRealm(java.lang.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, getOutput, getState, getTimeout, isAppend, setAppend, setConfiguration, 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, setConfiguration
 
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 java.lang.String ID
Unique container id.

See Also:
Constant Field Values
Constructor Detail

Jetty6xEmbeddedLocalContainer

public Jetty6xEmbeddedLocalContainer(org.codehaus.cargo.container.configuration.LocalConfiguration configuration)
{@inheritDoc}

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

getId

public java.lang.String getId()

See Also:
Container.getId()

getName

public java.lang.String getName()

See Also:
Container.getName()

setDefaultRealm

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

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

doStart

protected void doStart()
                throws java.lang.Exception

Throws:
java.lang.Exception
See Also:
AbstractEmbeddedLocalContainer.doStart()

createHandler

public java.lang.Object createHandler(org.codehaus.cargo.container.deployable.Deployable deployable)
                               throws java.lang.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:
java.lang.Exception - on invokation exception

createHandler

public java.lang.Object createHandler(java.lang.String contextPath,
                                      java.lang.String war)
                               throws java.lang.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:
java.lang.Exception - on invokation exception

addHandler

public void addHandler(java.lang.Object handler)
                throws java.lang.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:
java.lang.Exception - on invocation exception

removeHandler

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

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

createServerObject

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

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


Copyright © 2004-2007 Codehaus. All Rights Reserved.