public abstract class AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder extends AbstractStandaloneLocalConfiguration implements DataSourceSupport, ResourceSupport
StandaloneLocalConfiguration
configurations
with DataSourceSupport
. It does this by implementing DataSourceSupport
and
instead asking for the inputs to this:
createConfigurationBuilder
: how do we generate the xml element(s) representing the
datasourcegetXpathForDataSourcesParent
: under which element should datasource elements be
inserted?getNamespaces
: does this configuration file use namespaces?getOrCreateDataSourceConfigurationFile
: where do we load and store the datasource
configuration?RESOURCE_PATH
Constructor and Description |
---|
AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder(String dir) |
Modifier and Type | Method and Description |
---|---|
void |
configure(DataSource ds,
LocalContainer container) |
void |
configure(LocalContainer container)
Configure the specified container.
|
void |
configure(Resource ds,
LocalContainer container) |
void |
configureDataSources(LocalContainer container)
Configure the DataSources defined for this configuration.
|
void |
configureResources(LocalContainer container)
Configure the Resources defined for this configuration.
|
protected abstract ConfigurationBuilder |
createConfigurationBuilder(LocalContainer container) |
protected abstract Map<String,String> |
getNamespaces()
Implementations should avoid passing null, and instead pass
Collections.EMPTY_MAP , if the document is DTD bound. |
protected abstract String |
getOrCreateDataSourceConfigurationFile(DataSource ds,
LocalContainer container)
note that this file could hold other configuration besides datasources.
|
protected abstract String |
getOrCreateResourceConfigurationFile(Resource resource,
LocalContainer container)
note that this file could hold other configuration besides Resources.
|
protected abstract String |
getXpathForDataSourcesParent()
DataSource entries must be stored in the xml configuration file.
|
protected abstract String |
getXpathForResourcesParent()
Resource entries must be stored in the xml configuration file.
|
protected void |
writeConfigurationToXpath(String file,
String xml,
String path)
Utility method used to write XML to an appropriate place in the configuration file.
|
addXmlReplacement, addXmlReplacement, addXmlReplacement, addXmlReplacement, configureFiles, getType, getXmlReplacements, performXmlReplacements, removeXmlReplacement, removeXmlReplacement, replaceInFile, setupConfigurationDir, verify
addDataSource, addDataSourcesFromProperties, addDeployable, addResource, addResourcesFromProperties, addUser, addUsersFromProperties, applyPortOffset, applyPortOffset, collectUnsupportedDataSourcesAndThrowException, collectUnsupportedResourcesAndThrowException, createFilterChain, doConfigure, flagOffestApplied, getAntUtils, getDataSources, getDeployables, getDestDirectoryLocation, getDestFileLocation, getFileHandler, getFileProperties, getFilterChain, getHome, getPropertyValue, getResources, getResourceUtils, getUsers, isOffsetApplied, isOffsetApplied, parsePropertiesForPendingConfiguration, revertPortOffset, revertPortOffset, setConfigFileProperty, setFileHandler, setFileProperty, setLogger
getProperties, setProperty
getLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addDataSource, addDeployable, addResource, addUser, applyPortOffset, getDataSources, getDeployables, getFileHandler, getFileProperties, getHome, getResources, getUsers, isOffsetApplied, revertPortOffset, setConfigFileProperty, setFileHandler, setFileProperty
getCapability, getProperties, getPropertyValue, setProperty
public AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder(String dir)
dir
- configuration homeprotected abstract Map<String,String> getNamespaces()
Collections.EMPTY_MAP
, if the document is DTD bound.protected abstract String getXpathForDataSourcesParent()
protected abstract String getXpathForResourcesParent()
protected abstract String getOrCreateDataSourceConfigurationFile(DataSource ds, LocalContainer container)
ds
- the DataSource configuration you wish to install on the container.container
- the container whose configuration you wish to affect.protected abstract String getOrCreateResourceConfigurationFile(Resource resource, LocalContainer container)
resource
- the Resource configuration you wish to install on the container.container
- the container whose configuration you wish to affect.protected abstract ConfigurationBuilder createConfigurationBuilder(LocalContainer container)
container
- Container the dataSource will be configured on.public void configure(LocalContainer container)
configure
in interface LocalConfiguration
configure
in class AbstractLocalConfiguration
container
- the container to configurepublic void configureDataSources(LocalContainer container)
configureDataSources
in interface DataSourceSupport
container
- the container whose configuration you wish to affect.public void configure(Resource ds, LocalContainer container)
configure
in interface ResourceSupport
ds
- the Resource configuration you wish to install on the container.container
- the container whose configuration you wish to affect.public void configureResources(LocalContainer container)
configureResources
in interface ResourceSupport
container
- the container whose configuration you wish to affect.public void configure(DataSource ds, LocalContainer container)
configure
in interface DataSourceSupport
ds
- the DataSource configuration you wish to install on the container.container
- the container whose configuration you wish to affect.protected void writeConfigurationToXpath(String file, String xml, String path)
file
- where to write the datasource configuration to.xml
- node you wish to write to the resources configuration file.path
- where in the file to write the configuration.Copyright © 2004–2018 Github. All rights reserved.