org.codehaus.cargo.container.spi
Class AbstractEmbeddedLocalContainer

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
All Implemented Interfaces:
Container, EmbeddedLocalContainer, RunnableContainer, LocalContainer, Loggable
Direct Known Subclasses:
AbstractJettyEmbeddedLocalContainer, Tomcat5xEmbeddedLocalContainer

public abstract class AbstractEmbeddedLocalContainer
extends AbstractLocalContainer
implements EmbeddedLocalContainer

Default container implementation that all local embedded container implementations must extend.

Version:
$Id: AbstractEmbeddedLocalContainer.java 1705 2008-09-02 13:14:55Z adriana $

Constructor Summary
AbstractEmbeddedLocalContainer(LocalConfiguration configuration)
          
 
Method Summary
protected abstract  void doStart()
          Implementation of RunnableContainer.start() that all containers extending this class must implement.
protected abstract  void doStop()
          Implementation of RunnableContainer.stop() that all containers extending this class must implement.
 ClassLoader getClassLoader()
           
 ContainerType getType()
          
 void setClassLoader(ClassLoader classLoader)
           
protected  void startInternal()
          Installed and Embedded containers do not have the same signature for their doStart method.
protected  void stopInternal()
          Installed and Embedded containers do not have the same signature for their doStop method.
 
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
getCapability, getId, getName, 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
 

Constructor Detail

AbstractEmbeddedLocalContainer

public AbstractEmbeddedLocalContainer(LocalConfiguration configuration)

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

setClassLoader

public void setClassLoader(ClassLoader classLoader)
Specified by:
setClassLoader in interface EmbeddedLocalContainer
Parameters:
classLoader - the custom classloader to use for loading the Embedded container's classes.

getClassLoader

public ClassLoader getClassLoader()
Specified by:
getClassLoader in interface EmbeddedLocalContainer
Returns:
the custom classloader to use for loading the Embedded container's classes.

startInternal

protected final void startInternal()
                            throws Exception
Installed and Embedded containers do not have the same signature for their doStart method. Thus we need to abstract it.

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

stopInternal

protected final void stopInternal()
                           throws Exception
Installed and Embedded containers do not have the same signature for their doStop method. Thus we need to abstract it.

Specified by:
stopInternal in class AbstractLocalContainer
Throws:
Exception - if any error is raised during the container stop
See Also:
AbstractLocalContainer.stopInternal()

doStart

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

Throws:
Exception - if any error is raised during the container start

doStop

protected abstract void doStop()
                        throws Exception
Implementation of RunnableContainer.stop() that all containers extending this class must implement.

Throws:
Exception - if any error is raised during the container stop

getType

public ContainerType getType()

Specified by:
getType in interface Container
Returns:
the container's type (local , remote, etc)
See Also:
Container.getType()


Copyright © 2004-2012 Codehaus. All Rights Reserved.