Class JRun4xConfigurationBuilder
- java.lang.Object
-
- org.codehaus.cargo.container.spi.configuration.builder.AbstractConfigurationBuilder
-
- org.codehaus.cargo.container.jrun.internal.JRun4xConfigurationBuilder
-
- All Implemented Interfaces:
ConfigurationBuilder
public class JRun4xConfigurationBuilder extends AbstractConfigurationBuilder
Contains the xml elements used to build a normal or XA compliant DataSource for JRun.
-
-
Field Summary
Fields Modifier and Type Field Description static String
RESOURCE_CONFIGURATION_UNSUPPORTED
Exception message when trying to configure a Resource.
-
Constructor Summary
Constructors Constructor Description JRun4xConfigurationBuilder()
Initialized the XML DOM document builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
buildConfigurationEntryForXADataSourceConfiguredDataSource(DataSource ds)
String
buildEntryForDriverConfiguredDataSourceWithLocalTx(DataSource ds)
String
buildEntryForDriverConfiguredDataSourceWithNoTx(DataSource ds)
String
buildEntryForDriverConfiguredDataSourceWithXaTx(DataSource ds)
protected String
configureDataSourceWithImplementationClass(DataSource ds, String className)
String
toConfigurationEntry(Resource resource)
Detects the type of theResource
and creates an appropriate configuration.-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.builder.AbstractConfigurationBuilder
toConfigurationEntry
-
-
-
-
Field Detail
-
RESOURCE_CONFIGURATION_UNSUPPORTED
public static final String RESOURCE_CONFIGURATION_UNSUPPORTED
Exception message when trying to configure a Resource.- See Also:
- Constant Field Values
-
-
Method Detail
-
configureDataSourceWithImplementationClass
protected String configureDataSourceWithImplementationClass(DataSource ds, String className)
- Parameters:
ds
- the DataSource we are configuring.className
- the implementation class used for this DataSource- Returns:
- a datasource xml fragment that can be embedded directly into the jrun-resources.xml file
-
buildEntryForDriverConfiguredDataSourceWithLocalTx
public String buildEntryForDriverConfiguredDataSourceWithLocalTx(DataSource ds)
- Specified by:
buildEntryForDriverConfiguredDataSourceWithLocalTx
in classAbstractConfigurationBuilder
- Parameters:
ds
- theDataSource
with the following state:DataSource.getJndiLocation()
is set to a unique path for the container.DataSource.getDriverClass()
is an implementation ofjava.sql.Driver
DataSource.getTransactionSupport()
isTransactionSupport.LOCAL_TRANSACTION
- Returns:
- configuration binding a container provided implementation of type
javax.sql.DataSource
to the JNDI path specified atDataSource.getJndiLocation()
.
-
buildEntryForDriverConfiguredDataSourceWithNoTx
public String buildEntryForDriverConfiguredDataSourceWithNoTx(DataSource ds)
- Specified by:
buildEntryForDriverConfiguredDataSourceWithNoTx
in classAbstractConfigurationBuilder
- Parameters:
ds
- theDataSource
with the following state:DataSource.getJndiLocation()
is set to a unique path for the container.DataSource.getDriverClass()
is an implementation ofjava.sql.Driver
DataSource.getTransactionSupport()
isTransactionSupport.NO_TRANSACTION
- Returns:
- configuration binding a container provided implementation of type
javax.sql.DataSource
to the JNDI path specified atDataSource.getJndiLocation()
.
-
buildEntryForDriverConfiguredDataSourceWithXaTx
public String buildEntryForDriverConfiguredDataSourceWithXaTx(DataSource ds)
- Specified by:
buildEntryForDriverConfiguredDataSourceWithXaTx
in classAbstractConfigurationBuilder
- Parameters:
ds
- theDataSource
with the following state:DataSource.getJndiLocation()
is set to a unique path for the container.DataSource.getDriverClass()
is an implementation ofjava.sql.Driver
DataSource.getTransactionSupport()
isTransactionSupport.XA_TRANSACTION
- Returns:
- configuration binding a container provided implementation of type
javax.sql.DataSource
to the JNDI path specified atDataSource.getJndiLocation()
.
-
buildConfigurationEntryForXADataSourceConfiguredDataSource
public String buildConfigurationEntryForXADataSourceConfiguredDataSource(DataSource ds)
- Specified by:
buildConfigurationEntryForXADataSourceConfiguredDataSource
in classAbstractConfigurationBuilder
- Parameters:
ds
- theDataSource
with the following state:DataSource.getJndiLocation()
is set to a unique path for the container.DataSource.getConnectionType()
isjavax.sql.XADataSource
DataSource.getDriverClass()
is an implementation ofjavax.sql.XADataSource
- Returns:
- configuration binding a container provided implementation of type
javax.sql.DataSource
to the JNDI path specified atDataSource.getJndiLocation()
. This container will provide XA support through the third party implementation specified atDataSource.getDriverClass()
.
-
toConfigurationEntry
public String toConfigurationEntry(Resource resource)
Detects the type of theResource
and creates an appropriate configuration. This implementation throws an UnsupportedOperationException as Resource configuration is not supported in JRun.- Parameters:
resource
- the Resource you wish to build a configuration entry for.- Returns:
- the container-specific representation of this configuration.
-
-