Example usage for javax.resource.cci ConnectionFactory getRecordFactory

List of usage examples for javax.resource.cci ConnectionFactory getRecordFactory

Introduction

In this page you can find the example usage for javax.resource.cci ConnectionFactory getRecordFactory.

Prototype

public RecordFactory getRecordFactory() throws ResourceException;

Source Link

Document

Gets a RecordFactory instance.

Usage

From source file:org.hibersap.execution.jca.JCAConnection.java

public JCAConnection(final ConnectionFactory connectionFactory, final String connectionSpecFactoryName) {
    connectionProvider = new ConnectionProvider(connectionFactory, connectionSpecFactoryName);
    try {/* w w w .j  a va 2 s.co m*/
        recordFactory = connectionFactory.getRecordFactory();
    } catch (ResourceException e) {
        throw new HibersapException("Problem creating RecordFactory.", e);
    }
}

From source file:org.springframework.jca.cci.core.CciTemplate.java

/**
 * Return a RecordFactory for the given ConnectionFactory.
 * <p>Default implementation returns the connector's RecordFactory if
 * available, falling back to a NotSupportedRecordFactory placeholder.
 * This allows to invoke a RecordCreator callback with a non-null
 * RecordFactory reference in any case./*ww w .j  a va2  s  .  c om*/
 * @param connectionFactory the CCI ConnectionFactory
 * @return the CCI RecordFactory for the ConnectionFactory
 * @throws ResourceException if thrown by CCI methods
 * @see org.springframework.jca.cci.connection.NotSupportedRecordFactory
 */
protected RecordFactory getRecordFactory(ConnectionFactory connectionFactory) throws ResourceException {
    try {
        return connectionFactory.getRecordFactory();
    } catch (NotSupportedException ex) {
        return new NotSupportedRecordFactory();
    }
}