org.codehaus.cargo.container.orion.internal
Class AbstractOrionStandaloneLocalConfiguration

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.orion.internal.AbstractOrionStandaloneLocalConfiguration
All Implemented Interfaces:
Configuration, DataSourceSupport, ResourceSupport, LocalConfiguration, StandaloneLocalConfiguration, ContainerConfiguration, Loggable
Direct Known Subclasses:
Oc4j9xStandaloneLocalConfiguration

public abstract class AbstractOrionStandaloneLocalConfiguration
extends AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder

Standalone configuration methods common to both Orion and Oc4j containers.

Version:
$Id: AbstractOrionStandaloneLocalConfiguration.java 1891 2009-02-13 15:40:27Z adriancole $

Field Summary
static String XML_PARENT_OF_RESOURCES
          Where elements for resources will be inserted.
 
Fields inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
RESOURCE_PATH
 
Constructor Summary
AbstractOrionStandaloneLocalConfiguration(String dir)
          construct the instance and set the rmi port.
 
Method Summary
protected abstract  void copyCustomResources(String confDir, org.apache.tools.ant.types.FilterChain filterChain)
          Copy resources that are different between the different standalone implementations.
protected  ConfigurationBuilder createConfigurationBuilder(LocalContainer container)
          
protected  void doConfigure(LocalContainer container)
          Implementation of LocalConfiguration.configure(LocalContainer) that all local configuration using this class must implement.
 ConfigurationCapability getCapability()
          
protected  Map getNamespaces()
          Implementations should avoid passing null, and instead pass Collections.EMPTY_MAP, if the document is DTD bound.
 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 getRoleToken()
           
protected  String getUserToken()
           
protected  String getXpathForDataSourcesParent()
          This expression evaluates to: "//data-sources" DataSource entries must be stored in the xml configuration file.
protected  String getXpathForResourcesParent()
          Resource entries must be stored in the xml configuration file.
 
Methods inherited from class org.codehaus.cargo.container.spi.configuration.builder.AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
configure, configure, configure, configureDataSources, configureResources, 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, toString, 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
 

Field Detail

XML_PARENT_OF_RESOURCES

public static final String XML_PARENT_OF_RESOURCES
Where elements for resources will be inserted. This expression evaluates to: "//data-sources"

See Also:
Constant Field Values
Constructor Detail

AbstractOrionStandaloneLocalConfiguration

public AbstractOrionStandaloneLocalConfiguration(String dir)
construct the instance and set the rmi port.

Parameters:
dir - - home of this configuration
Method Detail

getOrCreateResourceConfigurationFile

protected String getOrCreateResourceConfigurationFile(Resource resource,
                                                      LocalContainer container)
note that this file could hold other configuration besides Resources. This implementation throws an UnsupportedOperationException as Resource configuration is not supported in Orion.

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.

getXpathForResourcesParent

protected String getXpathForResourcesParent()
Resource entries must be stored in the xml configuration file. Under which element do we insert the entries? example: //Engine/DefaultContext This implementation throws an UnsupportedOperationException as Resource configuration is not supported in Orion.

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

getCapability

public ConfigurationCapability getCapability()

Returns:
the ConfigurationCapability of the configuration in term of properties it supports, etc

createConfigurationBuilder

protected ConfigurationBuilder createConfigurationBuilder(LocalContainer container)

Specified by:
createConfigurationBuilder in class AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
Parameters:
container - Container the dataSource will be configured on.
Returns:
the object that produces xml entries for DataSource definitions.
See Also:
OrionConfigurationBuilder

getOrCreateDataSourceConfigurationFile

public String getOrCreateDataSourceConfigurationFile(DataSource ds,
                                                     LocalContainer container)
note that this file could hold other configuration besides datasources. In this implementation, we will return the data-sources.xml file.

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.

getNamespaces

protected Map getNamespaces()
Implementations should avoid passing null, and instead pass Collections.EMPTY_MAP, if the document is DTD bound. Orion application servers currently use DTD, and therefore return and empty map;

Specified by:
getNamespaces in class AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
Returns:
a map of prefixes to the url namespaces used in the datasource configuration file.

getXpathForDataSourcesParent

protected String getXpathForDataSourcesParent()
This expression evaluates to: "//data-sources" 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.

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

copyCustomResources

protected abstract void copyCustomResources(String confDir,
                                            org.apache.tools.ant.types.FilterChain filterChain)
                                     throws Exception
Copy resources that are different between the different standalone implementations.

Parameters:
confDir - the configuration dir where to copy the resources to
filterChain - the Ant filter chain to apply when copying the resources
Throws:
Exception - in case of an error during the copy

getUserToken

protected String getUserToken()
Returns:
an Ant filter token containing all the user-defined users

getRoleToken

protected String getRoleToken()
Returns:
an Ant filter token containing all the role-defined roles


Copyright © 2004-2012 Codehaus. All Rights Reserved.