org.codehaus.cargo.container.spi.configuration
Class AbstractStandaloneLocalConfiguration

java.lang.Object
  extended byorg.codehaus.cargo.util.log.LoggedObject
      extended byorg.codehaus.cargo.container.spi.configuration.AbstractConfiguration
          extended byorg.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
              extended byorg.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration
All Implemented Interfaces:
Configuration, ContainerConfiguration, LocalConfiguration, org.codehaus.cargo.util.log.Loggable, StandaloneLocalConfiguration

public abstract class AbstractStandaloneLocalConfiguration
extends AbstractLocalConfiguration
implements StandaloneLocalConfiguration

Base implementation for a standalone local configuration.

Version:
$Id: AbstractStandaloneLocalConfiguration.java 1192 2006-10-27 13:38:24Z vmassol $

Field Summary
 
Fields inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
RESOURCE_PATH
 
Constructor Summary
AbstractStandaloneLocalConfiguration(java.lang.String dir)
          {@inheritDoc}
 
Method Summary
protected  org.apache.tools.ant.types.FilterChain createFilterChain()
          Creates the default filter chain that should be applied while copying container configuration files to the working directory from which the container is started.
 ConfigurationType getType()
          
protected  void setupConfigurationDir()
          Set up the configuration directory (create it and clean it).
 void verify()
          Verify that the configuration is valid. The checks to be performed may vay whether this is standalone or existing configuration. This method should also be used to verify that the configuration properties specified by the user are valid and that the required ones are set.
 
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
addDeployable, configure, doConfigure, getAntUtils, getDeployables, getFileHandler, getHome, getResourceUtils, setFileHandler
 
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractConfiguration
getProperties, getPropertyValue, setProperty
 
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.configuration.LocalConfiguration
addDeployable, configure, getDeployables, getHome
 
Methods inherited from interface org.codehaus.cargo.container.configuration.Configuration
getCapability, getProperties, getPropertyValue, setProperty
 
Methods inherited from interface org.codehaus.cargo.util.log.Loggable
getLogger, setLogger
 

Constructor Detail

AbstractStandaloneLocalConfiguration

public AbstractStandaloneLocalConfiguration(java.lang.String dir)
{@inheritDoc}

See Also:
AbstractLocalConfiguration.AbstractLocalConfiguration(String)
Method Detail

setupConfigurationDir

protected void setupConfigurationDir()
                              throws java.io.IOException
Set up the configuration directory (create it and clean it). We clean it because we want to be sure the container starts with the same set up every time and there's no side effects introduced by a previous run or someone modifying some files in there.

Note: We only clean the configuration directory if it's empty or if there is a Cargo timestamp file. This is to prevent deleting not empty directories if the user has mistakenly pointed the configuration dir to an existing location.

Throws:
java.io.IOException - if the directory cannot be created

createFilterChain

protected final org.apache.tools.ant.types.FilterChain createFilterChain()
Creates the default filter chain that should be applied while copying container configuration files to the working directory from which the container is started.

Returns:
The default filter chain

verify

public void verify()
Verify that the configuration is valid. The checks to be performed may vay whether this is standalone or existing configuration. This method should also be used to verify that the configuration properties specified by the user are valid and that the required ones are set.

Specified by:
verify in interface ContainerConfiguration
Overrides:
verify in class AbstractConfiguration
See Also:
ContainerConfiguration.verify()

getType

public ConfigurationType getType()

Specified by:
getType in interface Configuration
Returns:
the configuration type (standalone, existing, runtime, etc)
See Also:
Configuration.getType()


Copyright © 2004-2007 Codehaus. All Rights Reserved.