Package javax.resource.cci

Examples of javax.resource.cci.IndexedRecord


    /**
     * {@inheritDoc}
     */
    @Override
    public void mapFrom(IndexedRecordBindingData source, Context context) throws Exception {
        IndexedRecord record = source.getRecord();
        String recordName = record.getRecordName();
        if (recordName != null) {
            context.setProperty(JCAConstants.CCI_RECORD_NAME_KEY, recordName).addLabels(INDEXED_RECORD_LABELS);
        }
        String recordDescription = record.getRecordShortDescription();
        if (recordDescription != null) {
            context.setProperty(JCAConstants.CCI_RECORD_SHORT_DESC_KEY, recordDescription).addLabels(INDEXED_RECORD_LABELS);
        }
    }
View Full Code Here


     * {@inheritDoc}
     */
    @SuppressWarnings("unchecked")
    @Override
    public void mapTo(Context context, IndexedRecordBindingData target) throws Exception {
        IndexedRecord record = target.getRecord();
        for (Property property : context.getProperties()) {
            String name = property.getName();
            Object value = property.getValue();
            if (value == null) {
                continue;
            }
            if (name.equals(JCAConstants.CCI_RECORD_NAME_KEY)) {
                record.setRecordName(value.toString());
            } else if (name.equals(JCAConstants.CCI_RECORD_SHORT_DESC_KEY)) {
                record.setRecordShortDescription(value.toString());
            } else if (matches(name)) {
                record.add(name + "=" + value);
            }
        }
    }
View Full Code Here

        _composer = getMessageComposer(IndexedRecordBindingData.class);
    }
   
    @Override
    public Message handle(Exchange exchange, Connection conn, Interaction interact) throws Exception {
        IndexedRecord record = getRecordFactory().createIndexedRecord(IndexedRecordHandler.class.getName());
        IndexedRecord outRecord = (IndexedRecord) interact.execute(getInteractionSpec(), getMessageComposer(IndexedRecordBindingData.class).decompose(exchange, new IndexedRecordBindingData(record)).getRecord());
        return _composer.compose(new IndexedRecordBindingData(outRecord), exchange);
    }
View Full Code Here

  @Test
  public void testCreateIndexedRecord() throws ResourceException {
    ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
    RecordFactory recordFactory = mock(RecordFactory.class);
    IndexedRecord indexedRecord = mock(IndexedRecord.class);
    given(connectionFactory.getRecordFactory()).willReturn(recordFactory);
    given(recordFactory.createIndexedRecord("name")).willReturn(indexedRecord);

    CciTemplate ct = new CciTemplate(connectionFactory);
    ct.createIndexedRecord("name");
View Full Code Here

TOP

Related Classes of javax.resource.cci.IndexedRecord

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.