Examples of MappedRecord


Examples of hu.sztaki.ilab.longneck.process.mapping.MappedRecord

    private Constraint referredConstraint = null;
   
    @Override
    public CheckResult check(Record record, VariableSpace scope) {
      if (mapping.hasRules()) {
            Record mapped = new MappedRecord(record, mapping);
            return referredConstraint.check(mapped, scope);
        }
       
        return referredConstraint.check(record, scope);
    }
View Full Code Here

Examples of hu.sztaki.ilab.longneck.process.mapping.MappedRecord

    private Entity referredEntity = null;

    @Override
    public CheckResult check(Record record, VariableSpace scope) {
        if (mapping.hasRules()) {
            Record mapped = new MappedRecord(record, mapping);
            return referredEntity.check(mapped, scope);
        }
       
        return referredEntity.check(record, scope);
       
View Full Code Here

Examples of hu.sztaki.ilab.longneck.process.mapping.MappedRecord

    @Override
    public Record changeRecord(Record record) throws NoMappingException {
        if (!blockRef.getMapping().hasRules()) {
            throw new NoMappingException();
        }
        return new MappedRecord(record, blockRef.getMapping());
    }
View Full Code Here

Examples of javax.resource.cci.MappedRecord

        return builder.parse(is);
    }

    @Override
    protected String extractString(MappedRecordBindingData binding) throws Exception {
        MappedRecord content = binding.getRecord();
        return String.class.cast(content.get(KEY));
    }
View Full Code Here

Examples of javax.resource.cci.MappedRecord

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

Examples of javax.resource.cci.MappedRecord

    }
   
    @Override
    public Record onMessage(Record record) {
        SynchronousInOutHandler inOutHandler = new SynchronousInOutHandler();
        MappedRecord sourceRecord = MappedRecord.class.cast(record);
        try {
            MappedRecordBindingData bindingData = new MappedRecordBindingData(sourceRecord);
            String operation = _selector != null ? _selector.selectOperation(bindingData).getLocalPart() : null;
            Exchange exchange = createExchange(operation, inOutHandler);
            exchange.send(_composer.compose(bindingData, exchange));

            exchange = inOutHandler.waitForOut(_waitTimeout);
            MappedRecord returnRecord = _recordFactory.createMappedRecord(_recordName);
            returnRecord.setRecordShortDescription(_description);
            return _composer.decompose(exchange, new MappedRecordBindingData(returnRecord)).getRecord();
        } catch (Exception e) {
            throw new SwitchYardException(e);
        }
    }
View Full Code Here

Examples of javax.resource.cci.MappedRecord

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

Examples of javax.resource.cci.MappedRecord

     * {@inheritDoc}
     */
    @SuppressWarnings("unchecked")
    @Override
    public void mapTo(Context context, MappedRecordBindingData target) throws Exception {
        MappedRecord 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.put(name, value);
            }
        }
    }
View Full Code Here

Examples of javax.resource.cci.MappedRecord

  @Test
  public void testCreateMappedRecord() throws ResourceException {
    ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
    RecordFactory recordFactory = mock(RecordFactory.class);
    MappedRecord mappedRecord = mock(MappedRecord.class);

    given(connectionFactory.getRecordFactory()).willReturn(recordFactory);
    given(recordFactory.createMappedRecord("name")).willReturn(mappedRecord);

    CciTemplate ct = new CciTemplate(connectionFactory);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.