org.codehaus.cargo.container.resin.internal
Class AbstractResinStandaloneLocalConfiguration

java.lang.Object
  extended by org.codehaus.cargo.util.log.LoggedObject
      extended by org.codehaus.cargo.container.spi.configuration.AbstractConfiguration
          extended by org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
              extended by org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration
                  extended by org.codehaus.cargo.container.spi.configuration.builder.AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
                      extended by org.codehaus.cargo.container.resin.internal.AbstractResinStandaloneLocalConfiguration
All Implemented Interfaces:
Configuration, DataSourceSupport, ResourceSupport, LocalConfiguration, StandaloneLocalConfiguration, ContainerConfiguration, Loggable
Direct Known Subclasses:
Resin2xStandaloneLocalConfiguration, Resin3xStandaloneLocalConfiguration

public abstract class AbstractResinStandaloneLocalConfiguration
extends AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder

Common class for all Resin standalone local configurations. container implementation.

Version:
$Id: AbstractResinStandaloneLocalConfiguration.java 1889 2009-02-13 15:37:37Z adriancole $

Field Summary
 
Fields inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
RESOURCE_PATH
 
Constructor Summary
AbstractResinStandaloneLocalConfiguration(String dir)
          
 
Method Summary
protected  String createExpandedWarTokenValue(String dirAttribute)
           
protected abstract  org.apache.tools.ant.types.FilterChain createResinFilterChain()
           
protected  void doConfigure(LocalContainer container)
          Implementation of LocalConfiguration.configure(LocalContainer) that all local configuration using this class must implement.
 ConfigurationCapability getCapability()
          
 String getOrCreateDataSourceConfigurationFile(DataSource ds, LocalContainer container)
          note that this file could hold other configuration besides datasources.
protected  String getOrCreateResourceConfigurationFile(Resource resource, LocalContainer container)
          note that this file could hold other configuration besides Resources.
protected  String getSecurityToken(String prefix, String suffix)
           
protected  String getXpathForDataSourcesParent()
          DataSource entries must be stored in the xml configuration file.
protected abstract  void prepareAdditions(Container container, org.apache.tools.ant.types.FilterChain filterChain)
          Allow specific version implementations to add custom preparation steps before the container is started.
 String toString()
          
 
Methods inherited from class org.codehaus.cargo.container.spi.configuration.builder.AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
configure, configure, configure, configureDataSources, configureResources, createConfigurationBuilder, getNamespaces, getXpathForResourcesParent, writeConfigurationToXpath
 
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration
configureFiles, createFilterChain, getDestDirectoryLocation, getDestFileLocation, getFileProperties, getFilterChain, getType, setConfigFileProperty, setFileProperty, setupConfigurationDir, verify
 
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
addDataSource, addDataSourcesFromProperties, addDeployable, addResource, addResourcesFromProperties, collectUnsupportedDataSourcesAndThrowException, collectUnsupportedResourcesAndThrowException, getAntUtils, getDataSources, getDeployables, getFileHandler, getHome, getResources, getResourceUtils, parsePropertiesForPendingConfiguration, 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, wait, wait, wait
 
Methods inherited from interface org.codehaus.cargo.container.configuration.LocalConfiguration
addDeployable, addResource, getDeployables, getFileHandler, getHome, getResources, setFileHandler
 
Methods inherited from interface org.codehaus.cargo.container.configuration.Configuration
getProperties, getPropertyValue, setProperty
 
Methods inherited from interface org.codehaus.cargo.util.log.Loggable
getLogger, setLogger
 

Constructor Detail

AbstractResinStandaloneLocalConfiguration

public AbstractResinStandaloneLocalConfiguration(String dir)

See Also:
AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder#AbstractStandaloneLocalConfigurationWithDataSourcesDefinedInXml(String)
Method Detail

getCapability

public ConfigurationCapability getCapability()

Returns:
the ConfigurationCapability of the configuration in term of properties it supports, etc
See Also:
AbstractStandaloneLocalConfiguration#AbstractStandaloneLocalConfiguration(String)

getOrCreateDataSourceConfigurationFile

public String getOrCreateDataSourceConfigurationFile(DataSource ds,
                                                     LocalContainer container)
note that this file could hold other configuration besides datasources.

Specified by:
getOrCreateDataSourceConfigurationFile in class AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
Parameters:
ds - the DataSource configuration you wish to install on the container.
container - the container whose configuration you wish to affect.
Returns:
the file that holds datasource configuration.

getOrCreateResourceConfigurationFile

protected String getOrCreateResourceConfigurationFile(Resource resource,
                                                      LocalContainer container)
note that this file could hold other configuration besides Resources.

Specified by:
getOrCreateResourceConfigurationFile in class AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
Parameters:
resource - the Resource configuration you wish to install on the container.
container - the container whose configuration you wish to affect.
Returns:
the file that holds Resource configuration.

getXpathForDataSourcesParent

protected String getXpathForDataSourcesParent()
DataSource entries must be stored in the xml configuration file. Under which element do we insert the entries? example: //Engine/DefaultContext

Specified by:
getXpathForDataSourcesParent in class AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
Returns:
path the the parent element datasources should be inserted under.

prepareAdditions

protected abstract void prepareAdditions(Container container,
                                         org.apache.tools.ant.types.FilterChain filterChain)
                                  throws IOException
Allow specific version implementations to add custom preparation steps before the container is started.

Parameters:
container - the container to configure
filterChain - the filter chain used to replace Ant tokens in configuration
Throws:
IOException - in case of an error

createResinFilterChain

protected abstract org.apache.tools.ant.types.FilterChain createResinFilterChain()
Returns:
an Ant filter chain containing implementation for the filter tokens used in the Resin configuration files

doConfigure

protected void doConfigure(LocalContainer container)
                    throws Exception
Implementation of 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...

Specified by:
doConfigure in class AbstractLocalConfiguration
Parameters:
container - the container to configure
Throws:
Exception - if any error is raised during the configuration
See Also:
AbstractLocalConfiguration.configure(LocalContainer)

createExpandedWarTokenValue

protected String createExpandedWarTokenValue(String dirAttribute)
Parameters:
dirAttribute - name of attribute used in resin.conf to specify where the war is located. This Attribute is different for different versions of Resin.
Returns:
the value for the resin3x.expanded.webapps filter token

getSecurityToken

protected String getSecurityToken(String prefix,
                                  String suffix)
Parameters:
prefix - the prefix string to use for each user
suffix - the suffix string to use for each user
Returns:
an Ant filter token containing all the user-defined users

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2004-2012 Codehaus. All Rights Reserved.