com.atomikos.jdbc.nonxa
Class AtomikosNonXADataSourceBean

java.lang.Object
  extended by com.atomikos.jdbc.AbstractDataSourceBean
      extended by com.atomikos.jdbc.nonxa.AtomikosNonXADataSourceBean
All Implemented Interfaces:
ConnectionPoolProperties, HeuristicDataSource, Serializable, Referenceable, DataSource

public class AtomikosNonXADataSourceBean
extends AbstractDataSourceBean

A Bean class for DataSource access to non-XA JDBC implementations. Instances are JTA transaction-aware and can rollback the work done over multiple connections (provided that all work was done in one and the same thread).

See Also:
Serialized Form

Constructor Summary
AtomikosNonXADataSourceBean()
           
 
Method Summary
protected  void doClose()
           
protected  ConnectionFactory doInit()
           
 Connection getConnection(HeuristicMessage hmsg)
          Get a connection to the datasource for the given description of the work.
 String getDriverClassName()
           
 String getPassword()
           
 boolean getReadOnly()
           
 String getUrl()
          Gets the URL to connect.
 String getUser()
           
 void setDriverClassName(String string)
          Sets the driver class name to be used by the DriverManager.
 void setPassword(String string)
          Sets the password to use.
 void setReadOnly(boolean readOnly)
          Marks this datasource as being used for read-only work.
 void setUrl(String url)
          Sets the URL to use for getting connections.
 void setUser(String string)
          Set the user name to get connections with.
 String toString()
           
 
Methods inherited from class com.atomikos.jdbc.AbstractDataSourceBean
close, getBorrowConnectionTimeout, getConnection, getConnection, getConnection, getConnection, getConnection, getDefaultIsolationLevel, getLocalTransactionMode, getLoginTimeout, getLogWriter, getMaintenanceInterval, getMaxIdleTime, getMaxPoolSize, getMinPoolSize, getReapTimeout, getReference, getTestQuery, getUniqueResourceName, init, poolAvailableSize, poolTotalSize, setBorrowConnectionTimeout, setDefaultIsolationLevel, setLoginTimeout, setLogWriter, setMaintenanceInterval, setMaxIdleTime, setMaxPoolSize, setMinPoolSize, setPoolSize, setReapTimeout, setTestQuery, setUniqueResourceName, throwAtomikosSQLException, throwAtomikosSQLException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AtomikosNonXADataSourceBean

public AtomikosNonXADataSourceBean()
Method Detail

setUrl

public void setUrl(String url)
Sets the URL to use for getting connections. Required.

Parameters:
url -

getUrl

public String getUrl()
Gets the URL to connect.


setReadOnly

public void setReadOnly(boolean readOnly)
Marks this datasource as being used for read-only work. Optional. Setting this to true will avoid warnings/errors upon recovery. ReadOnly mode is intended to avoid XA configuration of databases where no updates are being done.

Parameters:
readOnly - Defaults to false.

getReadOnly

public boolean getReadOnly()
Returns:
Whether or not this datasource is marked as readOnly.

getPassword

public String getPassword()
Returns:
The password.

setPassword

public void setPassword(String string)
Sets the password to use.

Parameters:
string -

setUser

public void setUser(String string)
Set the user name to get connections with.

Parameters:
string -

getUser

public String getUser()
Returns:
The URL to connect with.

getDriverClassName

public String getDriverClassName()
Returns:
The DriverManager class name.

setDriverClassName

public void setDriverClassName(String string)
Sets the driver class name to be used by the DriverManager. Required.

Parameters:
string -

doClose

protected void doClose()
Specified by:
doClose in class AbstractDataSourceBean

doInit

protected ConnectionFactory doInit()
                            throws Exception
Specified by:
doInit in class AbstractDataSourceBean
Throws:
Exception

getConnection

public Connection getConnection(HeuristicMessage hmsg)
                         throws SQLException
Description copied from interface: HeuristicDataSource
Get a connection to the datasource for the given description of the work.

Specified by:
getConnection in interface HeuristicDataSource
Overrides:
getConnection in class AbstractDataSourceBean
Parameters:
hmsg - The heuristic message that best describes the work about to be done.
Returns:
Connection The connection.
Throws:
SQLException - On error.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.