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:
getXAConnection
in 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:
getXAConnection
in interfaceXADataSource
- Throws:
SQLException
-
getResourceAdapter
public org.apache.derby.iapi.jdbc.ResourceAdapter getResourceAdapter()
- Specified by:
getResourceAdapter
in interfaceorg.apache.derby.jdbc.EmbeddedXADataSourceInterface
-
setDatabaseName
public void setDatabaseName(String paramString)
- Specified by:
setDatabaseName
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getDatabaseName
public String getDatabaseName()
- Specified by:
getDatabaseName
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setDataSourceName
public void setDataSourceName(String paramString)
- Specified by:
setDataSourceName
in 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:
getDataSourceName
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setDescription
public void setDescription(String paramString)
- Specified by:
setDescription
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setUser
public void setUser(String paramString)
- Specified by:
setUser
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getUser
public String getUser()
- Specified by:
getUser
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setPassword
public void setPassword(String paramString)
- Specified by:
setPassword
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getPassword
public String getPassword()
- Specified by:
getPassword
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getLoginTimeout
public int getLoginTimeout() throws SQLException
- Specified by:
getLoginTimeout
in interfaceCommonDataSource
- Specified by:
getLoginTimeout
in interfaceDataSource
- Specified by:
getLoginTimeout
in interfaceXADataSource
- Throws:
SQLException
-
setLoginTimeout
public void setLoginTimeout(int paramInt) throws SQLException
- Specified by:
setLoginTimeout
in interfaceCommonDataSource
- Specified by:
setLoginTimeout
in interfaceDataSource
- Specified by:
setLoginTimeout
in interfaceXADataSource
- Throws:
SQLException
-
getLogWriter
public PrintWriter getLogWriter() throws SQLException
- Specified by:
getLogWriter
in interfaceCommonDataSource
- Specified by:
getLogWriter
in interfaceDataSource
- Specified by:
getLogWriter
in interfaceXADataSource
- Throws:
SQLException
-
setLogWriter
public void setLogWriter(PrintWriter paramPrintWriter) throws SQLException
- Specified by:
setLogWriter
in interfaceCommonDataSource
- Specified by:
setLogWriter
in interfaceDataSource
- Specified by:
setLogWriter
in interfaceXADataSource
- Throws:
SQLException
-
setCreateDatabase
public void setCreateDatabase(String paramString)
- Specified by:
setCreateDatabase
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getCreateDatabase
public String getCreateDatabase()
- Specified by:
getCreateDatabase
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setConnectionAttributes
public void setConnectionAttributes(String paramString)
- Specified by:
setConnectionAttributes
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getConnectionAttributes
public String getConnectionAttributes()
- Specified by:
getConnectionAttributes
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setShutdownDatabase
public void setShutdownDatabase(String paramString)
- Specified by:
setShutdownDatabase
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getShutdownDatabase
public String getShutdownDatabase()
- Specified by:
getShutdownDatabase
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
setAttributesAsPassword
public void setAttributesAsPassword(boolean paramBoolean)
- Specified by:
setAttributesAsPassword
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getAttributesAsPassword
public boolean getAttributesAsPassword()
- Specified by:
getAttributesAsPassword
in interfaceorg.apache.derby.jdbc.EmbeddedDataSourceInterface
-
getConnection
public Connection getConnection() throws SQLException
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
getConnection
public Connection getConnection(String paramString1, String paramString2) throws SQLException
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> paramClass) throws SQLException
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
unwrap
public <T> T unwrap(Class<T> paramClass) throws SQLException
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
getParentLogger
public Logger getParentLogger() throws SQLFeatureNotSupportedException
- Specified by:
getParentLogger
in interfaceCommonDataSource
- Throws:
SQLFeatureNotSupportedException
-
-