Package javax.resource.cci

Examples of javax.resource.cci.RecordFactory


        Record outputRecordToUse = outputRecord;
        try {
          if (outputRecord != null || getOutputRecordCreator() != null) {
            // Use the CCI execute method with output record as parameter.
            if (outputRecord == null) {
              RecordFactory recordFactory = getRecordFactory(connectionFactory);
              outputRecordToUse = getOutputRecordCreator().createRecord(recordFactory);
            }
            interaction.execute(spec, inputRecord, outputRecordToUse);
          }
          else {
View Full Code Here


   * @see #getRecordFactory(javax.resource.cci.ConnectionFactory)
   * @see javax.resource.cci.RecordFactory#createIndexedRecord(String)
   */
  public IndexedRecord createIndexedRecord(String name) throws DataAccessException {
    try {
      RecordFactory recordFactory = getRecordFactory(getConnectionFactory());
      return recordFactory.createIndexedRecord(name);
    }
    catch (NotSupportedException ex) {
      throw new RecordTypeNotSupportedException("Creation of indexed Record not supported by connector", ex);
    }
    catch (ResourceException ex) {
View Full Code Here

   * @see #getRecordFactory(javax.resource.cci.ConnectionFactory)
   * @see javax.resource.cci.RecordFactory#createMappedRecord(String)
   */
  public MappedRecord createMappedRecord(String name) throws DataAccessException {
    try {
      RecordFactory recordFactory = getRecordFactory(getConnectionFactory());
      return recordFactory.createMappedRecord(name);
    }
    catch (NotSupportedException ex) {
      throw new RecordTypeNotSupportedException("Creation of mapped Record not supported by connector", ex);
    }
    catch (ResourceException ex) {
View Full Code Here

   * @see #getRecordFactory(javax.resource.cci.ConnectionFactory)
   * @see RecordCreator#createRecord(javax.resource.cci.RecordFactory)
   */
  protected Record createRecord(RecordCreator recordCreator) throws DataAccessException {
    try {
      RecordFactory recordFactory = getRecordFactory(getConnectionFactory());
      return recordCreator.createRecord(recordFactory);
    }
    catch (NotSupportedException ex) {
      throw new RecordTypeNotSupportedException(
          "Creation of the desired Record type not supported by connector", ex);
View Full Code Here

   * @see #getRecordFactory(javax.resource.cci.ConnectionFactory)
   * @see javax.resource.cci.RecordFactory#createIndexedRecord(String)
   */
  public IndexedRecord createIndexedRecord(String name) throws DataAccessException {
    try {
      RecordFactory recordFactory = getRecordFactory(getConnectionFactory());
      return recordFactory.createIndexedRecord(name);
    }
    catch (NotSupportedException ex) {
      throw new RecordTypeNotSupportedException("Creation of indexed Record not supported by connector", ex);
    }
    catch (ResourceException ex) {
View Full Code Here

   * @see #getRecordFactory(javax.resource.cci.ConnectionFactory)
   * @see javax.resource.cci.RecordFactory#createMappedRecord(String)
   */
  public MappedRecord createMappedRecord(String name) throws DataAccessException {
    try {
      RecordFactory recordFactory = getRecordFactory(getConnectionFactory());
      return recordFactory.createMappedRecord(name);
    }
    catch (NotSupportedException ex) {
      throw new RecordTypeNotSupportedException("Creation of mapped Record not supported by connector", ex);
    }
    catch (ResourceException ex) {
View Full Code Here

   * @see #getRecordFactory(javax.resource.cci.ConnectionFactory)
   * @see RecordCreator#createRecord(javax.resource.cci.RecordFactory)
   */
  protected Record createRecord(RecordCreator recordCreator) throws DataAccessException {
    try {
      RecordFactory recordFactory = getRecordFactory(getConnectionFactory());
      return recordCreator.createRecord(recordFactory);
    }
    catch (NotSupportedException ex) {
      throw new RecordTypeNotSupportedException(
          "Creation of the desired Record type not supported by connector", ex);
View Full Code Here

  public void testCreateIndexedRecord() throws ResourceException {
    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl recordFactoryControl = MockControl.createStrictControl(RecordFactory.class);
    RecordFactory recordFactory = (RecordFactory) recordFactoryControl.getMock();
    MockControl indexedRecordControl = MockControl.createStrictControl(IndexedRecord.class);
    IndexedRecord indexedRecord = (IndexedRecord) indexedRecordControl.getMock();

    connectionFactory.getRecordFactory();
    connectionFactoryControl.setReturnValue(recordFactory, 1);

    recordFactory.createIndexedRecord("name");
    recordFactoryControl.setReturnValue(indexedRecord, 1);

    connectionFactoryControl.replay();
    recordFactoryControl.replay();
View Full Code Here

  public void testCreateMappedRecord() throws ResourceException {
    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl recordFactoryControl = MockControl.createStrictControl(RecordFactory.class);
    RecordFactory recordFactory = (RecordFactory) recordFactoryControl.getMock();
    MockControl mappedRecordControl = MockControl.createStrictControl(MappedRecord.class);
    MappedRecord mappedRecord = (MappedRecord) mappedRecordControl.getMock();

    connectionFactory.getRecordFactory();
    connectionFactoryControl.setReturnValue(recordFactory, 1);

    recordFactory.createMappedRecord("name");
    recordFactoryControl.setReturnValue(mappedRecord, 1);

    connectionFactoryControl.replay();
    recordFactoryControl.replay();
View Full Code Here

  public void testTemplateExecuteInputTrueWithCreator() throws ResourceException {
    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl recordFactoryControl = MockControl.createStrictControl(RecordFactory.class);
    RecordFactory recordFactory = (RecordFactory) recordFactoryControl.getMock();
    MockControl connectionControl = MockControl.createStrictControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createStrictControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();
    MockControl creatorControl = MockControl.createStrictControl(RecordCreator.class);
View Full Code Here

TOP

Related Classes of javax.resource.cci.RecordFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.