/** * {@inheritDoc} */ @Override public Property getProperty(String name, Scope scope) { return _context.getProperty(name, scope); }
protected boolean getTxEnabledFromContext(Context ctx) { String key = CONTEXT_PROPERTY_PREFIX + KEY_TRANSACTED; if (ctx.getProperty(key) != null) { boolean transacted = Boolean.parseBoolean(ctx.getPropertyValue(key).toString()); if (_logger.isDebugEnabled()) { _logger.debug("transacted is set to '" + transacted + "'"); } return transacted; } return _defaultTxEnabled; }
/** * {@inheritDoc} */ @Override public Property getProperty(String name) { return _context.getProperty(name); }
protected int getAcknowledgeModeFromContext(Context ctx) { String key = CONTEXT_PROPERTY_PREFIX + KEY_ACKNOWLEDGE_MODE; if (ctx.getProperty(key) != null) { int ackMode = Integer.parseInt(ctx.getPropertyValue(key).toString()); if (_logger.isDebugEnabled()) { _logger.debug("Acknowledge Mode is set to '" + ackMode + "'"); } return ackMode; } return _defaultAckMode; }
/** * {@inheritDoc} */ @Override public Property getProperty(String name) { return _context.getProperty(name); }
protected MessageType getOutputMessageTypeFromContext(Context ctx) { String key = CONTEXT_PROPERTY_PREFIX + KEY_MESSAGE_TYPE; if (ctx.getProperty(key) != null) { MessageType msgType = MessageType.valueOf(ctx.getPropertyValue(key).toString()); if (_logger.isDebugEnabled()) { _logger.debug("Output message type is set to '" + msgType.toString() + "'"); } return msgType; } return _defaultOutMessageType; }
/** * {@inheritDoc} */ @Override public Property getProperty(String name, Scope scope) { return _context.getProperty(name, scope); }
protected MessageType getOutputMessageTypeFromContext(Context ctx) { String key = CONTEXT_PROPERTY_PREFIX + KEY_MESSAGE_TYPE; if (ctx.getProperty(key) != null) { MessageType type = MessageType.valueOf(ctx.getPropertyValue(key).toString()); if (_logger.isDebugEnabled()) { _logger.debug("Output message type is set to '" + type.toString() + "'"); } return type; } return _defaultOutMessageType; }
@Override public Property getProperty(String name, Scope scope) { if (!_contexts.containsKey(scope)) { return null; } return _contexts.get(scope).getProperty(name); }
@Override public Property getProperty(String name, Scope scope) { if (!_contexts.containsKey(scope)) { return null; } return _contexts.get(scope).getProperty(name); }
/** * {@inheritDoc} */ @Override public Property getProperty(String name) { return getContext().getProperty(name); }
/** * {@inheritDoc} */ @Override public Property getProperty(String name, Scope scope) { return getContext().getProperty(name, scope); }
/** * {@inheritDoc} */ @Override public Property getProperty(String name, Scope scope) { return getContext().getProperty(name, scope); }
@SuppressWarnings("unchecked") private static Set<Policy> getPolicies(Exchange exchange, String propertyName) { Property intentsProperty = exchange.getContext().getProperty(propertyName, Scope.EXCHANGE); Set<Policy> intents = new HashSet<Policy>(); if (intentsProperty != null) { intents.addAll((Set<Policy>)intentsProperty.getValue()); } return intents; }
@SuppressWarnings("unchecked") private static Set<Policy> getPolicies(Exchange exchange, String propertyName) { Property intentsProperty = exchange.getContext().getProperty(propertyName, Scope.EXCHANGE); Set<Policy> intents = new HashSet<Policy>(); if (intentsProperty != null) { intents.addAll((Set<Policy>)intentsProperty.getValue()); } return intents; }
private static TransformSequence get(final Exchange exchange) { Property sequenceProperty = exchange.getContext().getProperty(TransformSequence.class.getName()); if (sequenceProperty != null) { return (TransformSequence)sequenceProperty.getValue(); } else { return null; } } }
private static TransformSequence get(final Exchange exchange) { Property sequenceProperty = exchange.getContext().getProperty(TransformSequence.class.getName()); if (sequenceProperty != null) { return (TransformSequence)sequenceProperty.getValue(); } else { return null; } } }
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); } } }
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); } } }
@Test public void testMessageIdSetOnSend() { ServiceReference service = _domain.createInOnlyService(new QName("IdTest")); Exchange exchange = service.createExchange(); exchange.send(exchange.createMessage()); Assert.assertNotNull(exchange.getMessage().getContext().getProperty(Exchange.MESSAGE_ID)); }