org.jboss.test.jca.adapter
Class MockedXADataSource

java.lang.Object
  extended byorg.jboss.test.jca.adapter.MockedXADataSource
All Implemented Interfaces:
XADataSource (src)

public class MockedXADataSource
extends java.lang.Object
implements XADataSource (src)


Nested Class Summary
 class MockedXADataSource.MockedXAConnection (src)
           
 
Constructor Summary
MockedXADataSource()
           
 
Method Summary
static MockedXADataSource (src) getInstance(java.lang.String url)
           
 int getLoginTimeout()
          Gets the maximum time in seconds that this data source can wait while attempting to connect to a database.
 java.io.PrintWriter getLogWriter()
          Get the log writer for this data source.
 java.lang.String getURL()
           
static java.lang.String[] getUrls()
           
 XAConnection (src) getXAConnection()
          Attempt to establish a database connection.
 XAConnection (src) getXAConnection(java.lang.String user, java.lang.String password)
          Attempt to establish a database connection.
 void setLoginTimeout(int seconds)
          Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.
 void setLogWriter(java.io.PrintWriter out)
          Set the log writer for this data source.
 void setURL(java.lang.String url)
           
static void start(java.lang.String url)
           
static void stop(java.lang.String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockedXADataSource

public MockedXADataSource()
Method Detail

getInstance

public static MockedXADataSource (src)  getInstance(java.lang.String url)

stop

public static void stop(java.lang.String url)

start

public static void start(java.lang.String url)

getUrls

public static java.lang.String[] getUrls()

getURL

public java.lang.String getURL()

setURL

public void setURL(java.lang.String url)

getLoginTimeout

public int getLoginTimeout()
                    throws java.sql.SQLException
Description copied from interface: XADataSource (src)
Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. A value of zero means that the timeout is the default system timeout if there is one; otherwise it means that there is no timeout. When a data source object is created the login timeout is initially zero.

Specified by:
getLoginTimeout in interface XADataSource (src)
Returns:
the data source login time limit
Throws:
java.sql.SQLException - - if a database-access error occurs.

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws java.sql.SQLException
Description copied from interface: XADataSource (src)
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero specifies that the timeout is the default system timeout if there is one; otherwise it specifies that there is no timeout. When a data source object is created the login timeout is initially zero.

Specified by:
setLoginTimeout in interface XADataSource (src)
Parameters:
seconds - - the data source login time limit
Throws:
java.sql.SQLException - - if a database-access error occurs.

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws java.sql.SQLException
Description copied from interface: XADataSource (src)

Get the log writer for this data source.

The log writer is a character output stream to which all logging and tracing messages for this data source object instance will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.Drivermanager class. When a data source object is created the log writer is initially null, in other words, logging is disabled.

Specified by:
getLogWriter in interface XADataSource (src)
Returns:
the log writer for this data source, null if disabled
Throws:
java.sql.SQLException - - if a database-access error occurs.

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws java.sql.SQLException
Description copied from interface: XADataSource (src)

Set the log writer for this data source.

The log writer is a character output stream to which all logging and tracing messages for this data source object instance will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.Drivermanager class. When a data source object is created the log writer is initially null, in other words, logging is disabled.

Specified by:
setLogWriter in interface XADataSource (src)
Parameters:
out - - the new log writer; to disable, set to null
Throws:
java.sql.SQLException - - if a database-access error occurs.

getXAConnection

public XAConnection (src)  getXAConnection()
                             throws java.sql.SQLException
Description copied from interface: XADataSource (src)
Attempt to establish a database connection.

Specified by:
getXAConnection in interface XADataSource (src)
Returns:
a Connection to the database
Throws:
java.sql.SQLException - - if a database-access error occurs.

getXAConnection

public XAConnection (src)  getXAConnection(java.lang.String user,
                                    java.lang.String password)
                             throws java.sql.SQLException
Description copied from interface: XADataSource (src)
Attempt to establish a database connection.

Specified by:
getXAConnection in interface XADataSource (src)
Parameters:
user - - the database user on whose behalf the Connection is being made
password - - the user's password
Returns:
a Connection to the database
Throws:
java.sql.SQLException - - if a database-access error occurs.