@Override public Object get(Object key) { if (!(key instanceof String)) { return null; } return message.getProperty((String) key, propertyScope); }
private Map<String, Object> getPropertiesInScope(PropertyScope scope) { Map<String, Object> props = new HashMap<String, Object>(); for (String s : message.getPropertyNames(scope)) { props.put(s, message.getProperty(s, scope)); } return props; } }
protected void renameInScope(String oldKey, String newKey, PropertyScope propertyScope, MuleMessage message) { Object propValue = message.getProperty(oldKey, propertyScope); DataType<?> propertyDataType = message.getPropertyDataType(oldKey, propertyScope); message.removeProperty(oldKey, propertyScope); message.setProperty(newKey, propValue, propertyScope, propertyDataType); }
@Override public String toString() { Map<String, Object> map = new HashMap<String, Object>(); for (String key : message.getPropertyNames(propertyScope)) { Object value = message.getProperty(key, propertyScope); map.put(key, value); } return map.toString(); } }
private String getSenderId(MuleMessage muleMessage) { return (String) muleMessage.getProperty("senderid", PropertyScope.SESSION); }
public static TypedValue getTypedProperty(String expression, MuleMessage msg, PropertyScope scope) { boolean required = true; if (expression.endsWith(OPTIONAL_ARGUMENT)) { expression = expression.substring(0, expression.length() - OPTIONAL_ARGUMENT.length()); required = false; } final String propertyName = expression.trim(); Object result = msg.getProperty(propertyName, scope); if (result == null && required) { throw new RequiredValueException(CoreMessages.expressionEvaluatorReturnedNull("header", scope.getScopeName() + ":" + expression)); } DataType<?> propertyDataType = msg.getPropertyDataType(propertyName, scope); if (propertyDataType == null) { propertyDataType = DataTypeFactory.create(Object.class, null); } return new TypedValue(result, propertyDataType); }
protected void populateProcessVariables(MuleEvent event, Map processVariables, PropertyScope propertyScope) { for (String propertyName : event.getMessage().getPropertyNames(propertyScope)) { // The session property can become rather large and causes problems with DB persistence. if (!propertyName.equals(MuleProperties.MULE_SESSION_PROPERTY)) { processVariables.put(propertyName, event.getMessage().getProperty(propertyName, propertyScope)); } } } }
private String getOriginalServiceConsumerId(MuleMessage muleMessage) { return (String) muleMessage.getProperty("originalServiceconsumerHsaid", PropertyScope.SESSION); }
protected void populateProcessVariables(MuleEvent event, Map processVariables, PropertyScope propertyScope) { for (String propertyName : event.getMessage().getPropertyNames(propertyScope)) { // The session property can become rather large and causes problems with DB persistence. if (!propertyName.equals(MuleProperties.MULE_SESSION_PROPERTY)) { processVariables.put(propertyName, event.getMessage().getProperty(propertyName, propertyScope)); } } }
@Override public Object load(String key) { Object object = message.getProperty(key, PropertyScope.OUTBOUND); // ugly but it works if (object == null) { object = message.getProperty(key, PropertyScope.INVOCATION); if (object == null) { object = message.getProperty(key, PropertyScope.INBOUND); if (object == null) { object = muleContext.getRegistry().lookupObject(key); } } } return object; } }
protected void populateProcessVariables(MuleEvent event, Map processVariables, PropertyScope propertyScope) { for (String propertyName : event.getMessage().getPropertyNames(propertyScope)) { // The session property can become rather large and causes problems with DB persistence. if (!propertyName.equals(MuleProperties.MULE_SESSION_PROPERTY)) { processVariables.put(propertyName, event.getMessage().getProperty(propertyName, propertyScope)); } } }
public boolean accept(MuleMessage message) { if (message == null) { return false; } Object value = message.getProperty(propertyName, scope); boolean match; if (value == null) { match = compare(null, propertyValue); } else { match = compare(value.toString(), propertyValue); } if (!match && logger.isDebugEnabled()) { logger.debug(String.format("Property: '%s' not found in scope '%s'. Message %n%s", propertyName, scope, message)); } return match; }
protected void copyMessageProperties(MuleMessage muleMessage) { for (PropertyScope scope : new PropertyScope[]{PropertyScope.INBOUND, PropertyScope.OUTBOUND}) { try { for (String name : muleMessage.getPropertyNames(scope)) { Object value = muleMessage.getProperty(name, scope); if (value != null) { setPropertyInternal(name, value, scope, DataTypeFactory.createFromObject(value)); } } } catch (IllegalArgumentException iae) { // ignore non-registered property scope } } }
protected boolean resolveEventSynchronicity() { return transacted || isFlowConstructSynchronous() || exchangePattern.hasResponse() && !isFlowConstructNonBlockingProcessingStrategy() || message.getProperty(MuleProperties.MULE_FORCE_SYNC_PROPERTY, PropertyScope.INBOUND, Boolean.FALSE); }
public ExceptionMessage(MuleEvent event, Throwable exception, String componentName, URI endpointUri) { this.payload = event.getMessage().getPayload(); properties = new HashMap<String, Object>(); this.exception = exception; timeStamp = new Date(); this.componentName = componentName; if (endpointUri != null) { this.endpointUri = endpointUri.toString(); } for (Iterator iterator = event.getMessage().getPropertyNames(PropertyScope.OUTBOUND).iterator(); iterator.hasNext();) { String propertyKey = (String) iterator.next(); setProperty(propertyKey, event.getMessage().getProperty(propertyKey, PropertyScope.OUTBOUND)); } }
Object prop = message.getProperty(getProperty, scope); if (prop != null)
/** * Extracts header properties from a Mule event * * @param event */ public MuleSoapHeaders(MuleEvent event) { setCorrelationId(event.getMessage().getCorrelationId()); setCorrelationGroup(String.valueOf(event.getMessage().getCorrelationGroupSize())); setCorrelationSequence(String.valueOf(event.getMessage().getCorrelationSequence())); // only propogate the reply to header if it's in the outbound scope Object replyTo = event.getMessage().getProperty(MuleProperties.MULE_REPLY_TO_PROPERTY, PropertyScope.OUTBOUND); if (replyTo != null) { setReplyTo(replyTo.toString()); } }
String contentType = message.getProperty(MuleProperties.CONTENT_TYPE_PROPERTY, PropertyScope.INBOUND); if (contentType == null) contentType = message.getProperty(MuleProperties.CONTENT_TYPE_PROPERTY, PropertyScope.OUTBOUND);
public Method getMethod(MuleEvent event) throws Exception { Method method = null; String opName = (String)event.getMessage().getProperty(CxfConstants.OPERATION); if (opName != null) { method = getMethodFromOperation(opName); } if (method == null) { opName = operation; if (opName != null) { method = getMethodFromOperation(opName); } } if (method == null) { throw new MessagingException(CxfMessages.noOperationWasFoundOrSpecified(), event, this); } return method; }
String contentType = message.getProperty(MuleProperties.CONTENT_TYPE_PROPERTY, PropertyScope.OUTBOUND); if (contentType == null)