Class AbstractOrionStandaloneLocalConfiguration
- java.lang.Object
-
- org.codehaus.cargo.util.log.LoggedObject
-
- org.codehaus.cargo.container.spi.configuration.AbstractConfiguration
-
- org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
-
- org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration
-
- org.codehaus.cargo.container.spi.configuration.builder.AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
-
- 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.
-
-
Field Summary
Fields Modifier and Type Field Description 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
Constructors Constructor Description AbstractOrionStandaloneLocalConfiguration(String dir)
construct the instance and set the rmi port.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
copyCustomResources(String confDir, Map<String,String> replacements)
Copy resources that are different between the different standalone implementations.protected ConfigurationBuilder
createConfigurationBuilder(LocalContainer container)
protected void
doConfigure(LocalContainer container)
Implementation ofLocalConfiguration.configure(LocalContainer)
that all local configuration using this class must implement.ConfigurationCapability
getCapability()
protected Map<String,String>
getNamespaces()
Implementations should avoid passing null, and instead passCollections.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
addXmlReplacement, addXmlReplacement, addXmlReplacement, addXmlReplacement, configureFiles, getType, getXmlReplacements, performXmlReplacements, removeXmlReplacement, removeXmlReplacement, replaceInFile, setupConfigurationDir, verify
-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
addDataSource, addDataSourcesFromProperties, addDeployable, addResource, addResourcesFromProperties, addUser, addUsersFromProperties, applyPortOffset, applyPortOffset, collectUnsupportedDataSourcesAndThrowException, collectUnsupportedResourcesAndThrowException, flagOffsetApplied, getDataSources, getDeployables, getDestDirectoryLocation, getDestFileLocation, getFileHandler, getFileProperties, getHome, getPropertyValue, getReplacements, getResources, getResourceUtils, getUsers, isOffsetApplied, isOffsetApplied, parsePropertiesForPendingConfiguration, revertPortOffset, revertPortOffset, setConfigFileProperty, setFileHandler, setFileProperty, setLogger
-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractConfiguration
getProperties, setProperty
-
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger
-
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.Configuration
getProperties, getPropertyValue, setProperty
-
Methods inherited from interface org.codehaus.cargo.container.configuration.LocalConfiguration
addDataSource, addDeployable, addResource, addUser, applyPortOffset, getDataSources, getDeployables, getFileHandler, getFileProperties, getHome, getResources, getUsers, isOffsetApplied, revertPortOffset, setConfigFileProperty, setFileHandler, setFileProperty
-
-
-
-
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 classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- 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 classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- 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 classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- Parameters:
container
- Container the dataSource will be configured on.- Returns:
- the object that produces xml entries for DataSource definitions.
-
getOrCreateDataSourceConfigurationFile
public String getOrCreateDataSourceConfigurationFile(DataSource ds, LocalContainer container)
note that this file could hold other configuration besides datasources. In this implementation, we will return thedata-sources.xml
file.- Specified by:
getOrCreateDataSourceConfigurationFile
in classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- 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<String,String> getNamespaces()
Implementations should avoid passing null, and instead passCollections.EMPTY_MAP
, if the document is DTD bound. Orion application servers currently use DTD, and therefore return and empty map;- Specified by:
getNamespaces
in classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- 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 classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- Returns:
- path the the parent element datasources should be inserted under.
-
doConfigure
protected void doConfigure(LocalContainer container) throws Exception
Implementation ofLocalConfiguration.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 classAbstractLocalConfiguration
- Parameters:
container
- the container to configure- Throws:
Exception
- if any error is raised during the configuration
-
copyCustomResources
protected abstract void copyCustomResources(String confDir, Map<String,String> replacements) throws Exception
Copy resources that are different between the different standalone implementations.- Parameters:
confDir
- the configuration dir where to copy the resources toreplacements
- the token replacements 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
-
-