Example usage for org.springframework.jca.cci RecordTypeNotSupportedException RecordTypeNotSupportedException

List of usage examples for org.springframework.jca.cci RecordTypeNotSupportedException RecordTypeNotSupportedException

Introduction

In this page you can find the example usage for org.springframework.jca.cci RecordTypeNotSupportedException RecordTypeNotSupportedException.

Prototype

public RecordTypeNotSupportedException(String msg, ResourceException ex) 

Source Link

Document

Constructor for RecordTypeNotSupportedException.

Usage

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

/**
 * Create an indexed Record through the ConnectionFactory's RecordFactory.
 * @param name the name of the record/*from   w  w w .  ja v a2s  .c o m*/
 * @return the Record
 * @throws DataAccessException if creation of the Record failed
 * @see #getRecordFactory(javax.resource.cci.ConnectionFactory)
 * @see javax.resource.cci.RecordFactory#createIndexedRecord(String)
 */
public IndexedRecord createIndexedRecord(String name) throws DataAccessException {
    try {
        RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory());
        return recordFactory.createIndexedRecord(name);
    } catch (NotSupportedException ex) {
        throw new RecordTypeNotSupportedException("Creation of indexed Record not supported by connector", ex);
    } catch (ResourceException ex) {
        throw new CannotCreateRecordException("Creation of indexed Record failed", ex);
    }
}

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

/**
 * Create a mapped Record from the ConnectionFactory's RecordFactory.
 * @param name record name/*  www  .  j a v a  2 s  . c o  m*/
 * @return the Record
 * @throws DataAccessException if creation of the Record failed
 * @see #getRecordFactory(javax.resource.cci.ConnectionFactory)
 * @see javax.resource.cci.RecordFactory#createMappedRecord(String)
 */
public MappedRecord createMappedRecord(String name) throws DataAccessException {
    try {
        RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory());
        return recordFactory.createMappedRecord(name);
    } catch (NotSupportedException ex) {
        throw new RecordTypeNotSupportedException("Creation of mapped Record not supported by connector", ex);
    } catch (ResourceException ex) {
        throw new CannotCreateRecordException("Creation of mapped Record failed", ex);
    }
}

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

/**
 * Invoke the given RecordCreator, converting JCA ResourceExceptions
 * to Spring's DataAccessException hierarchy.
 * @param recordCreator the RecordCreator to invoke
 * @return the created Record//from   www  . j ava2s  .  c  o m
 * @throws DataAccessException if creation of the Record failed
 * @see #getRecordFactory(javax.resource.cci.ConnectionFactory)
 * @see RecordCreator#createRecord(javax.resource.cci.RecordFactory)
 */
protected Record createRecord(RecordCreator recordCreator) throws DataAccessException {
    try {
        RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory());
        return recordCreator.createRecord(recordFactory);
    } catch (NotSupportedException ex) {
        throw new RecordTypeNotSupportedException(
                "Creation of the desired Record type not supported by connector", ex);
    } catch (ResourceException ex) {
        throw new CannotCreateRecordException("Creation of the desired Record failed", ex);
    }
}