/** * {@inheritDoc} */ @Override public Property setProperty(String name, Object val) { return _context.setProperty(name, val); }
/** * {@inheritDoc} */ @Override public Property setProperty(String name, Object val) { return getContext().setProperty(name, val); }
@Override public ReferenceInvocation setProperty(String name, String value) { _exchange.getContext(_inMessage).setProperty(name, value); return this; }
@Override public Property setProperty(String name, Object val, Scope scope) { if (_contexts.containsKey(scope)) { return _contexts.get(scope).setProperty(name, val); } throw new IllegalArgumentException(scope.name()); }
/** * {@inheritDoc} */ @Override public Property setProperty(String name, Object val, Scope scope) { return getContext().setProperty(name, val, scope); }
private void copyHttpHeadersToContext(Context context, String name, List<String> values) { if (values.size() == 1) { context.setProperty(name, values.get(0), Scope.EXCHANGE).addLabels(SOAP_MIME_LABELS); } else { context.setProperty(name, values, Scope.EXCHANGE).addLabels(SOAP_MIME_LABELS); } }
private void copySOAPHeadersToContext(Context context, String name, Object value) { if (matches(name, getIncludeRegexes(), new ArrayList<Pattern>())) { context.setProperty(name, value, Scope.EXCHANGE).addLabels(SOAP_HEADER_LABELS); } }
/** * Associate this instance with the supplied message context. * @param message associate the transform to this message */ public void associateWith(Message message) { message.getContext().setProperty(TransformSequence.class.getName(), this) .addLabels(BehaviorLabel.TRANSIENT.label()); }
/** * Mark message as sent. */ public void sent() { getContext().setProperty(CamelExchange.MESSAGE_SENT, true) .addLabels(BehaviorLabel.TRANSIENT.label()); }
/** * Indicate that a given policy is required for the exchange. * @param exchange require policy on this exchange * @param policy the policy to require */ public static void require(Exchange exchange, Policy policy) { Set<Policy> required = getPolicies(exchange, REQUIRED_PROPERTY); required.add(policy); exchange.getContext().setProperty(REQUIRED_PROPERTY, required, Scope.EXCHANGE).addLabels(BehaviorLabel.TRANSIENT.label()); }
/** * Indicate that a given policy is satisfied for the exchange. * @param exchange assert policy on this exchange * @param policy the policy to assert */ public static void provide(Exchange exchange, Policy policy) { Set<Policy> provided = getPolicies(exchange, PROVIDED_PROPERTY); provided.add(policy); exchange.getContext().setProperty(PROVIDED_PROPERTY, provided, Scope.EXCHANGE).addLabels(BehaviorLabel.TRANSIENT.label()); }
/** * Mark message as sent. */ public void sent() { getContext().setProperty(CamelExchange.MESSAGE_SENT, true) .addLabels(BehaviorLabel.TRANSIENT.label()); }
@Override public void mapFrom(JMSBindingData source, Context context) throws Exception { super.mapFrom(source, context); context.setProperty("testProp", "testVal", Scope.EXCHANGE); }
/** * {@inheritDoc} */ @Override public HttpBindingData decompose(Exchange exchange, HttpBindingData target) throws Exception { Object content = exchange.getMessage().getContent(); if ((content instanceof String) && (content.equals(""))) { exchange.getContext().setProperty(HttpContextMapper.HTTP_RESPONSE_STATUS, 404).addLabels(new String[]{EndpointLabel.HTTP.label()}); } target = super.decompose(exchange, target); return target; }
private void initContentType(Message message) { QName exchangeInputType = _contract.getConsumerOperation().getInputType(); if (exchangeInputType != null) { message.getContext().setProperty(Exchange.CONTENT_TYPE, exchangeInputType, Scope.MESSAGE) .addLabels(BehaviorLabel.TRANSIENT.label()); } }
private void initContentType(Message message) { QName exchangeInputType = _contract.getConsumerOperation().getInputType(); if (exchangeInputType != null) { message.getContext().setProperty(Exchange.CONTENT_TYPE, exchangeInputType, Scope.MESSAGE) .addLabels(BehaviorLabel.TRANSIENT.label()); } }
private void initInContentType() { QName exchangeInputType = getContract().getConsumerOperation().getInputType(); if (exchangeInputType != null) { getContext().setProperty(Exchange.CONTENT_TYPE, exchangeInputType) .addLabels(BehaviorLabel.TRANSIENT.label()); } }
private void initFaultContentType() { if (_contract.getProviderOperation() != null) { QName serviceOperationFaultType = _contract.getProviderOperation().getFaultType(); if (serviceOperationFaultType != null) { _message.getContext().setProperty(Exchange.FAULT_TYPE, serviceOperationFaultType, Scope.MESSAGE) .addLabels(BehaviorLabel.TRANSIENT.label()); } } }
@Override public void onMessage_fault_commit(String name) throws JCAJMSFault { _storeResult.onMessage(name); if (_declaredFaultCount < 4) { _declaredFaultCount++; _storeFault.onMessage("faultmessage"); _context.setProperty(Exchange.ROLLBACK_ON_FAULT, false); throw new JCAJMSFault("faultmessage"); } }
private void setContentType(Exchange exchange) { QName currentType = TransformSequence.getCurrentMessageType(exchange); if (currentType != null) { exchange.getContext().setProperty(Exchange.CONTENT_TYPE, currentType).addLabels(BehaviorLabel.TRANSIENT.label()); } else { // make sure no property is used for current scope Property p = exchange.getContext().getProperty(Exchange.CONTENT_TYPE); if (p != null) { exchange.getContext().removeProperty(p); } } }