Class Jetty7xEmbeddedLocalContainer
- java.lang.Object
-
- org.codehaus.cargo.util.log.LoggedObject
-
- org.codehaus.cargo.container.spi.AbstractContainer
-
- org.codehaus.cargo.container.spi.AbstractLocalContainer
-
- org.codehaus.cargo.container.spi.AbstractEmbeddedLocalContainer
-
- org.codehaus.cargo.container.jetty.internal.AbstractJettyEmbeddedLocalContainer
-
- org.codehaus.cargo.container.jetty.Jetty6xEmbeddedLocalContainer
-
- org.codehaus.cargo.container.jetty.Jetty7xEmbeddedLocalContainer
-
- All Implemented Interfaces:
Container,EmbeddedLocalContainer,RunnableContainer,LocalContainer,Loggable
- Direct Known Subclasses:
Jetty8xEmbeddedLocalContainer
public class Jetty7xEmbeddedLocalContainer extends Jetty6xEmbeddedLocalContainer
A Jetty 7.x instance running embedded.
-
-
Field Summary
Fields Modifier and Type Field Description static StringIDUnique container id.-
Fields inherited from class org.codehaus.cargo.container.jetty.Jetty6xEmbeddedLocalContainer
addHandlerMethod, contextHandlers, defaultRealm, handlerClass, handlers, removeHandlerMethod
-
Fields inherited from class org.codehaus.cargo.container.jetty.internal.AbstractJettyEmbeddedLocalContainer
server
-
-
Constructor Summary
Constructors Constructor Description Jetty7xEmbeddedLocalContainer(LocalConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddJettyHandlers()Add Jetty handlers.protected voidconfigureJettyConnectors()Configure Jetty connectors.protected voidcreateServerObject()Create a Jetty Server Object.StringgetId()protected StringgetWebappContextClassname()voidsetDefaultRealm(Object webapp)If a default realm is available, set it on the given webapp.protected voidsetSecurityRealm()Defines a security realm and adds defined users to it.-
Methods inherited from class org.codehaus.cargo.container.jetty.Jetty6xEmbeddedLocalContainer
addDeployables, addHandler, createHandler, createHandler, doStart, getName, removeHandler, startJetty
-
Methods inherited from class org.codehaus.cargo.container.jetty.internal.AbstractJettyEmbeddedLocalContainer
doStop, getCapability, getServer, getVersion, waitForCompletion
-
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
executePostStartTasks, forceStopInternal, getConfiguration, getFileHandler, getOutput, getState, getTimeout, isAppend, restart, setAppend, setConfiguration, setFileHandler, setOutput, setState, setTimeout, start, stop, verify, waitForPortShutdown, waitForStarting
-
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.internal.RunnableContainer
getOutput, getTimeout, isAppend, restart, 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)
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceContainer- Overrides:
getIdin classJetty6xEmbeddedLocalContainer- Returns:
- the short name of the container. Note: this is not a unique id. It is simply the name in a computer-usable format.
-
setDefaultRealm
public void setDefaultRealm(Object webapp) throws Exception
If a default realm is available, set it on the given webapp.- Overrides:
setDefaultRealmin classJetty6xEmbeddedLocalContainer- Parameters:
webapp- the webapp to set the realm on- Throws:
Exception- on invokation error
-
getWebappContextClassname
protected String getWebappContextClassname()
- Overrides:
getWebappContextClassnamein classJetty6xEmbeddedLocalContainer- Returns:
- The Jetty Webapp context class name.
-
configureJettyConnectors
protected void configureJettyConnectors() throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodExceptionConfigure Jetty connectors.- Overrides:
configureJettyConnectorsin classJetty6xEmbeddedLocalContainer- Throws:
ClassNotFoundException- thrown if the connectors could not be configuredInstantiationException- thrown if the connectors could not be configuredIllegalAccessException- thrown if the connectors could not be configuredInvocationTargetException- thrown if the connectors could not be configuredNoSuchMethodException- thrown if the connectors could not be configured
-
addJettyHandlers
protected void addJettyHandlers() throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodExceptionAdd Jetty handlers.- Overrides:
addJettyHandlersin classJetty6xEmbeddedLocalContainer- Throws:
ClassNotFoundException- thrown if the handlers could not be addedInstantiationException- thrown if the handlers could not be addedIllegalAccessException- thrown if the handlers could not be addedInvocationTargetException- thrown if the handlers could not be addedNoSuchMethodException- thrown if the handlers could not be added
-
setSecurityRealm
protected void setSecurityRealm() throws ExceptionDefines a security realm and adds defined users to it. If a user has specified the standard ServletPropertySet.USERS property, then we try and turn these into an in-memory default realm, and then set that realm on all of the webapps. TODO: this is not ideal. We need a way to specify N named realms to the server so that individual webapps can find their appropriate realms by name.- Overrides:
setSecurityRealmin classJetty6xEmbeddedLocalContainer- Throws:
Exception- in case of error
-
createServerObject
protected void createServerObject() throws ExceptionCreate a Jetty Server Object.- Overrides:
createServerObjectin classJetty6xEmbeddedLocalContainer- Throws:
Exception- in case of error
-
-