• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IndexedRecord类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.resource.cci.IndexedRecord的典型用法代码示例。如果您正苦于以下问题:Java IndexedRecord类的具体用法?Java IndexedRecord怎么用?Java IndexedRecord使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IndexedRecord类属于javax.resource.cci包,在下文中一共展示了IndexedRecord类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: mapTo

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
public void mapTo(Context context, IndexedRecordBindingData target) throws Exception {
    super.mapTo(context, target);

    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);
        }  else if (matches(name, getIncludeRegexes(), new ArrayList<Pattern>())) {
            record.add(name + "=" + value);
        }
    }
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:27,代码来源:IndexedRecordContextMapper.java


示例2: createIndexedRecord

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
/**
 * @see RecordFactory#createIndexedRecord(String)
 */
public IndexedRecord createIndexedRecord(String recordName)
	throws ResourceException {

	HelloWorldIndexedRecordImpl record = null;

	if ((recordName.equals(HelloWorldIndexedRecordImpl.INPUT))
		|| (recordName.equals(HelloWorldIndexedRecordImpl.OUTPUT))) {
		record = new HelloWorldIndexedRecordImpl();
		record.setRecordName(recordName);
	}
	if (record == null) {
		throw new ResourceException(INVALID_RECORD_NAME);
	} else {
		return record;
	}
}
 
开发者ID:WASdev,项目名称:ci.maven,代码行数:20,代码来源:HelloWorldRecordFactoryImpl.java


示例3: testCreateIndexedRecord

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
@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");

	verify(recordFactory).createIndexedRecord("name");
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:14,代码来源:CciTemplateTests.java


示例4: mapFrom

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void mapFrom(IndexedRecordBindingData source, Context context) throws Exception {
    super.mapFrom(source, context);

    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);
    }

    for (int i = 0; i < record.size(); i++) {
        Object o = record.get(i);
        if (o instanceof String) {
            String element = (String) o;
            if (element.contains("=")) {
                String[] strings = element.split("=");

                if (strings.length >= 2) {
                    String key = strings[0];
                    String value = strings[1];
                    if (matches(key, getIncludeRegexes(), new ArrayList<Pattern>())) {
                        context.setProperty(key, value, Scope.EXCHANGE);
                    }
                }
            }
        }
    }
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:36,代码来源:IndexedRecordContextMapper.java


示例5: appendToRecord

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void appendToRecord(final Record record, final String fieldName, final Object value) {
    if (record instanceof IndexedRecord) {
        ((IndexedRecord) record).add(value);
    } else {
        ((MappedRecord) record).put(fieldName, value);
    }
}
 
开发者ID:hibersap,项目名称:hibersap,代码行数:9,代码来源:JCAMapper.java


示例6: mapToMappedRecord

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void mapToMappedRecord(final RecordFactory recordFactory, final Record record, final Map<String, Object> map)
        throws ResourceException {
    for (final String fieldName : map.keySet()) {
        final Object value = map.get(fieldName);

        if (Map.class.isAssignableFrom(value.getClass())) {
            final Map<String, Object> structureMap = UnsafeCastHelper.castToMap(value);
            final Record structure = recordFactory.createMappedRecord(fieldName);

            appendToRecord(record, fieldName, structure);

            mapToMappedRecord(recordFactory, structure, structureMap);
        } else if (Collection.class.isAssignableFrom(value.getClass())) {
            final Collection<Map<String, Object>> tableMap = UnsafeCastHelper.castToCollectionOfMaps(value);
            final IndexedRecord table = recordFactory.createIndexedRecord(fieldName);

            appendToRecord(record, fieldName, table);

            int i = 0;
            for (final Map<String, Object> row : tableMap) {
                MappedRecord rowRecord = recordFactory.createMappedRecord(fieldName + ":row:" + i);
                mapToMappedRecord(recordFactory, rowRecord, row);
                table.add(rowRecord);
                i++;
            }
        } else {
            appendToRecord(record, fieldName, value);
        }
    }
}
 
开发者ID:hibersap,项目名称:hibersap,代码行数:32,代码来源:JCAMapper.java


示例7: mapToMappedRecord

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
@Test
public void mapToMappedRecord()
        throws Exception {
    // map
    Map<String, Object> functionMap = createFunctionMap();
    MappedRecord record = mapper.mapFunctionMapValuesToMappedRecord("BAPI_NAME", recordFactory, functionMap);

    assertEquals("BAPI_NAME", record.getRecordName());

    // check import parameters
    String importParam1 = (String) record.get("IMPORT_PARAM2");
    assertEquals("importParam2", importParam1);

    int param3 = (Integer) record.get("IMPORT_PARAM3");
    assertEquals(3, param3);

    MappedRecord importStruct = (MappedRecord) record.get("IMPORT_PARAM1");
    assertEquals("IMPORT_PARAM1", importStruct.getRecordName());
    assertEquals(1, importStruct.get("STRUCT_FIELD1"));
    assertEquals("structField2", importStruct.get("STRUCT_FIELD2"));

    // check changing parameters
    assertThat(record.get("CHANGING_PARAM1")).isEqualTo("changingParam1");
    assertThat(record.get("CHANGING_PARAM2")).isEqualTo(2);

    // check table parameters
    IndexedRecord tableParam1 = (IndexedRecord) record.get("TABLE_PARAM1");
    assertEquals("TABLE_PARAM1", tableParam1.getRecordName());

    MappedRecord row1 = (MappedRecord) tableParam1.get(0);
    assertEquals("tableField1", row1.get("TABLE_FIELD1"));
    assertEquals(new Date(1), row1.get("TABLE_FIELD2"));
    assertEquals(1, row1.get("TABLE_FIELD3"));

    MappedRecord row2 = (MappedRecord) tableParam1.get(1);
    assertEquals("tableField2", row2.get("TABLE_FIELD1"));
    assertEquals(new Date(2), row2.get("TABLE_FIELD2"));
    assertEquals(2, row2.get("TABLE_FIELD3"));
}
 
开发者ID:hibersap,项目名称:hibersap,代码行数:40,代码来源:JCAMapperTest.java


示例8: createIndexedRecord

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
@Override
public IndexedRecord createIndexedRecord(String name) throws ResourceException {
	throw new NotSupportedException("The RecordFactory facility is not supported by the connector");
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:NotSupportedRecordFactory.java


示例9: createIndexedRecord

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
@Override
public IndexedRecord createIndexedRecord(String arg0) throws ResourceException {
       throw ValidationException.operationNotSupported("createIndexedRecord");
}
 
开发者ID:rhulha,项目名称:EclipseLinkNoSQLDemoPlugin,代码行数:5,代码来源:DemoRecordFactory.java


示例10: createIndexedRecord

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
@Override
public IndexedRecord createIndexedRecord(String recordName) throws ResourceException {
    IndexedRecord rec = new MockIndexedRecord();
    rec.setRecordName(recordName);
    return rec;
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:7,代码来源:MockRecordFactory.java


示例11: handle

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
@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);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:7,代码来源:IndexedRecordHandler.java


示例12: getRecord

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public IndexedRecord getRecord() {
    return _record;
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:8,代码来源:IndexedRecordBindingData.java


示例13: createIndexedRecord

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
public IndexedRecord createIndexedRecord(String name) throws ResourceException {
	throw new NotSupportedException("The RecordFactory facility is not supported by the connector");
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:4,代码来源:NotSupportedRecordFactory.java


示例14: mapRecordToFunctionMap

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
public void mapRecordToFunctionMap(final Map<String, Object> functionMap,
                                   final Map<String, Object> resultRecordMap,
                                   final BapiMapping bapiMapping) {
    LOG.debug("mapRecordToFunctionMap() recordMap=" + resultRecordMap);

    for (final Entry<String, Object> entry : resultRecordMap.entrySet()) {
        final Object recordValue = entry.getValue();
        final String recordKey = entry.getKey();

        if (recordValue != null) {
            LOG.debug("mapping " + recordValue.getClass().getName() + ": " + recordKey + "=" + recordValue);
        }

        if (recordValue instanceof IndexedRecord) {
            // Table parameter
            final IndexedRecord indexedResultRecord = (IndexedRecord) recordValue;
            List<Map<String, Object>> table = new ArrayList<Map<String, Object>>();

            for (Object object : indexedResultRecord) {
                MappedRecord mr = (MappedRecord) object;
                final Map<String, Object> line = new HashMap<String, Object>();

                @SuppressWarnings("unchecked")
                Set<String> keys = mr.keySet();

                for (String key : keys) {
                    line.put(key, mr.get(key));
                }
                table.add(line);
            }

            Map<String, Object> tables = UnsafeCastHelper.castToMap(functionMap.get(TABLE));
            tables.put(indexedResultRecord.getRecordName(), table);
        } else {
            // Simple parameter or structure parameter (the latter is a MappedRecord which luckily implements Map)
            String parameterType = getParameterType(recordKey, bapiMapping);
            if (isNotBlank(parameterType)) {
                Map<String, Object> export = UnsafeCastHelper.castToMap(functionMap.get(parameterType));
                export.put(recordKey, recordValue);
            } else {
                LOG.debug("Skipping unmapped parameter: " + recordKey);
            }
        }
    }
    LOG.debug("mapRecordToFunctionMap() functionMap=" + functionMap);
}
 
开发者ID:hibersap,项目名称:hibersap,代码行数:47,代码来源:JCAMapper.java


示例15: answer

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
public IndexedRecord answer()
        throws Throwable {
    Object[] args = EasyMock.getCurrentArguments();
    return new MyIndexedRecord((String) args[0]);
}
 
开发者ID:hibersap,项目名称:hibersap,代码行数:6,代码来源:JCAMapperTest.java


示例16: createIndexedRecord

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
@Override
public IndexedRecord createIndexedRecord(String recordName) throws ResourceException {
	IndexedRecord indexedRecord = new IndexedRecordImpl(recordName);
	return indexedRecord;
}
 
开发者ID:dlmiles,项目名称:full-example-ee7-jca-eis,代码行数:6,代码来源:RecordFactoryImpl.java


示例17: IndexedRecordBindingData

import javax.resource.cci.IndexedRecord; //导入依赖的package包/类
/**
 * Constructs a new indexed record binding data with the specified indexed record.
 * @param record the specified indexed record
 */
public IndexedRecordBindingData(IndexedRecord record) {
    _record = record;
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:8,代码来源:IndexedRecordBindingData.java



注:本文中的javax.resource.cci.IndexedRecord类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IBarLineScatterCandleBubbleDataSet类代码示例发布时间:2022-05-23
下一篇:
Java ParseContext类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap