Class TestEmbeddedXADataSource
- java.lang.Object
-
- com.ibm.fhir.persistence.proxy.rm.test.TestEmbeddedXADataSource
-
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource,XADataSource,org.apache.derby.jdbc.EmbeddedDataSourceInterface,org.apache.derby.jdbc.EmbeddedXADataSourceInterface
public class TestEmbeddedXADataSource extends Object implements org.apache.derby.jdbc.EmbeddedXADataSourceInterface
This class is used in the testing of the XA resource recovery function within the proxy datasource class. It serves as a wrapper class for the derby EmbeddedXADataSource class and provides additional function to artificially trigger failures during the two-phase commit process.
-
-
Constructor Summary
Constructors Constructor Description TestEmbeddedXADataSource()
-
Method Summary
-
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
-
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Methods inherited from interface javax.sql.XADataSource
createXAConnectionBuilder
-
-
-
-
Method Detail
-
getFailStep
public String getFailStep()
-
setFailStep
public void setFailStep(String failStep)
-
getFailCount
public int getFailCount()
-
setFailCount
public void setFailCount(int failCount)
-
getXAConnection
public XAConnection getXAConnection() throws SQLException
We'll override this method so that we can insert our own class as a wrapper around the XAConnection served up by the super class.- Specified by:
getXAConnectionin interfaceXADataSource- Throws:
SQLException
-
getReference
public final Reference getReference() throws NamingException
- Throws:
NamingException
-
getXAConnection
public final XAConnection getXAConnection(String paramString1, String paramString2) throws SQLException
- Specified by:
getXAConnectionin interfaceXADataSource- Throws:
SQLException
-
getResourceAdapter
public org.apache.derby.iapi.jdbc.ResourceAdapter getResourceAdapter()
- Specified by:
getResourceAdapterin interfaceorg.apache.derby.jdbc.EmbeddedXADataSourceInterface
-
setDatabaseName
public void setDatabaseName(String paramString)
- Specified by:
setDatabaseNamein interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getDatabaseName
public String getDatabaseName()
- Specified by:
getDatabaseNamein interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setDataSourceName
public void setDataSourceName(String paramString)
- Specified by:
setDataSourceNamein interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getObjectInstance
public Object getObjectInstance(Object paramObject, Name paramName, Context paramContext, Hashtable<?,?> paramHashtable) throws Exception
- Throws:
Exception
-
getDataSourceName
public String getDataSourceName()
- Specified by:
getDataSourceNamein interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setDescription
public void setDescription(String paramString)
- Specified by:
setDescriptionin interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setUser
public void setUser(String paramString)
- Specified by:
setUserin interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getUser
public String getUser()
- Specified by:
getUserin interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setPassword
public void setPassword(String paramString)
- Specified by:
setPasswordin interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getPassword
public String getPassword()
- Specified by:
getPasswordin interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getLoginTimeout
public int getLoginTimeout() throws SQLException- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource- Specified by:
getLoginTimeoutin interfaceXADataSource- Throws:
SQLException
-
setLoginTimeout
public void setLoginTimeout(int paramInt) throws SQLException- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource- Specified by:
setLoginTimeoutin interfaceXADataSource- Throws:
SQLException
-
getLogWriter
public PrintWriter getLogWriter() throws SQLException
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource- Specified by:
getLogWriterin interfaceXADataSource- Throws:
SQLException
-
setLogWriter
public void setLogWriter(PrintWriter paramPrintWriter) throws SQLException
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource- Specified by:
setLogWriterin interfaceXADataSource- Throws:
SQLException
-
setCreateDatabase
public void setCreateDatabase(String paramString)
- Specified by:
setCreateDatabasein interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getCreateDatabase
public String getCreateDatabase()
- Specified by:
getCreateDatabasein interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setConnectionAttributes
public void setConnectionAttributes(String paramString)
- Specified by:
setConnectionAttributesin interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getConnectionAttributes
public String getConnectionAttributes()
- Specified by:
getConnectionAttributesin interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setShutdownDatabase
public void setShutdownDatabase(String paramString)
- Specified by:
setShutdownDatabasein interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getShutdownDatabase
public String getShutdownDatabase()
- Specified by:
getShutdownDatabasein interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setAttributesAsPassword
public void setAttributesAsPassword(boolean paramBoolean)
- Specified by:
setAttributesAsPasswordin interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getAttributesAsPassword
public boolean getAttributesAsPassword()
- Specified by:
getAttributesAsPasswordin interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getConnection
public Connection getConnection() throws SQLException
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
public Connection getConnection(String paramString1, String paramString2) throws SQLException
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> paramClass) throws SQLException
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
unwrap
public <T> T unwrap(Class<T> paramClass) throws SQLException
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
getParentLogger
public Logger getParentLogger() throws SQLFeatureNotSupportedException
- Specified by:
getParentLoggerin interfaceCommonDataSource- Throws:
SQLFeatureNotSupportedException
-
-