org.javasimon.jdbcx4.SimonXAConnection Maven / Gradle / Ivy
package org.javasimon.jdbcx4;
import java.sql.SQLException;
import javax.sql.StatementEventListener;
import javax.sql.XAConnection;
import javax.transaction.xa.XAResource;
/**
* Simon implementation of XAConnection
, needed for
* Simon XADataSource implementation.
*
* All method invokes its real implementation.
*
* See the {@link org.javasimon.jdbcx4 package description} for more
* information.
*
* @author Radovan Sninsky
* @author Richard "Virgo" Richter
* @since 2.4
*/
public final class SimonXAConnection extends SimonPooledConnection implements XAConnection {
private final XAConnection realConn;
/**
* Class constructor.
*
* @param connection real xa connection
* @param prefix Simon prefix
*/
public SimonXAConnection(XAConnection connection, String prefix) {
super(connection, prefix);
this.realConn = connection;
}
@Override
public XAResource getXAResource() throws SQLException {
return realConn.getXAResource();
}
@Override
public void addStatementEventListener(StatementEventListener listener) {
realConn.addStatementEventListener(listener);
}
@Override
public void removeStatementEventListener(StatementEventListener listener) {
realConn.removeStatementEventListener(listener);
}
}