public abstract class AbstractLocalConfiguration extends AbstractConfiguration implements LocalConfiguration
ContainerConfiguration
that can be
specialized for standalone configuration, existing configuration or other local configurations.Modifier and Type | Field and Description |
---|---|
protected static String |
RESOURCE_PATH
The path under which the container resources are stored in the JAR.
|
Constructor and Description |
---|
AbstractLocalConfiguration(String home) |
Modifier and Type | Method and Description |
---|---|
void |
addDataSource(DataSource dataSource) |
protected void |
addDataSourcesFromProperties()
Parse properties and add any DataSources to pending configuration.
|
void |
addDeployable(Deployable newDeployable)
Deploy a
Deployable in the container. |
void |
addResource(Resource resource)
Add resources the container can take advantage of.
|
protected void |
addResourcesFromProperties()
Parse properties and add any Resources to pending configuration.
|
void |
collectUnsupportedDataSourcesAndThrowException()
Warn user and throw an Exception if any unsupported
DataSource s are setup for this
configuration. |
void |
collectUnsupportedResourcesAndThrowException()
Warn user and throw an Exception if any unsupported
Resource s are setup for this
configuration. |
void |
configure(LocalContainer container)
Setup the container which means setting up a valid directory structure, setting up
configuration files and deploying static deployables.
|
protected abstract void |
doConfigure(LocalContainer container)
Implementation of
LocalConfiguration.configure(LocalContainer) that all local
configuration using this class must implement. |
protected org.codehaus.cargo.util.AntUtils |
getAntUtils() |
List |
getDataSources() |
List |
getDeployables() |
org.codehaus.cargo.util.FileHandler |
getFileHandler() |
String |
getHome() |
List |
getResources() |
protected ResourceUtils |
getResourceUtils() |
void |
parsePropertiesForPendingConfiguration()
Some configuration can be specified as encoded properties.
|
void |
setFileHandler(org.codehaus.cargo.util.FileHandler fileHandler) |
void |
verify()
Verify that the configuration is valid.
|
getProperties, getPropertyValue, setProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCapability, getProperties, getPropertyValue, getType, setProperty
protected static final String RESOURCE_PATH
public AbstractLocalConfiguration(String home)
home
- the home directory where the container will be set up to start and where it will
deploy its deployables.public org.codehaus.cargo.util.FileHandler getFileHandler()
getFileHandler
in interface LocalConfiguration
public void setFileHandler(org.codehaus.cargo.util.FileHandler fileHandler)
setFileHandler
in interface LocalConfiguration
fileHandler
- the file utility class to use for performing all file I/O.protected final org.codehaus.cargo.util.AntUtils getAntUtils()
protected final ResourceUtils getResourceUtils()
public void addDeployable(Deployable newDeployable)
Deployable
in the container. It installs the Deployable
in the
container's configuration directory.addDeployable
in interface LocalConfiguration
newDeployable
- the Deployable
to deployLocalConfiguration.addDeployable(org.codehaus.cargo.container.deployable.Deployable)
public List getDeployables()
getDeployables
in interface LocalConfiguration
Deployable
s that are going to be deployed in the container when
it is startedLocalConfiguration.getDeployables()
public String getHome()
getHome
in interface LocalConfiguration
LocalConfiguration.getHome()
public void configure(LocalContainer container)
configure
in interface LocalConfiguration
container
- the container to configureLocalConfiguration.configure(LocalContainer)
public void verify()
verify
in interface ContainerConfiguration
verify
in class AbstractConfiguration
ContainerConfiguration.verify()
public void collectUnsupportedResourcesAndThrowException()
Resource
s are setup for this
configuration.public void collectUnsupportedDataSourcesAndThrowException()
DataSource
s are setup for this
configuration.public void parsePropertiesForPendingConfiguration()
protected void addResourcesFromProperties()
ResourcePropertySet.RESOURCE
protected void addDataSourcesFromProperties()
DatasourcePropertySet.DATASOURCE
protected abstract void doConfigure(LocalContainer container) throws Exception
LocalConfiguration.configure(LocalContainer)
that all local
configuration using this class must implement. This provides the ability to perform generic
actions before and after the container-specific implementation. Another way would be to use
AOP...container
- the container to configureException
- if any error is raised during the configurationpublic void addResource(Resource resource)
addResource
in interface LocalConfiguration
resource
- the Resource
to add.LocalConfiguration.addResource(Resource)
public List getResources()
getResources
in interface LocalConfiguration
public void addDataSource(DataSource dataSource)
LocalConfiguration#addDataSource(DataSource)
public List getDataSources()
Copyright © 2004-2013 Codehaus. All Rights Reserved.