Merge branch 'master' of git://git.springsource.org/spring-integration/spring-integration
This commit is contained in:
@@ -33,7 +33,20 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* The headers for a {@link Message}.
|
||||
* The headers for a {@link Message}.<br>
|
||||
* IMPORTANT: MessageHeaders are immutable. Any mutating operation (e.g., put(..), putAll(..) etc.)
|
||||
* will result in {@link UnsupportedOperationException}
|
||||
* To create MessageHeaders instance use fluent MessageBuilder API
|
||||
* <pre>
|
||||
* MessageBuilder.withPayload("foo").setHeader("key1", "value1").setHeader("key2", "value2");
|
||||
* </pre>
|
||||
* or create an instance of GenericMessage passing payload as {@link Object} and headers as a regular {@link Map}
|
||||
* <pre>
|
||||
* Map headers = new HashMap();
|
||||
* headers.put("key1", "value1");
|
||||
* headers.put("key2", "value2");
|
||||
* new GenericMessage("foo", headers);
|
||||
* </pre>
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @author Mark Fisher
|
||||
@@ -192,19 +205,27 @@ public final class MessageHeaders implements Map<String, Object>, Serializable {
|
||||
/*
|
||||
* Unsupported operations
|
||||
*/
|
||||
|
||||
/**
|
||||
* Since MessageHeaders are immutable the call to this method will result in {@link UnsupportedOperationException}
|
||||
*/
|
||||
public Object put(String key, Object value) {
|
||||
throw new UnsupportedOperationException("MessageHeaders is immutable.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Since MessageHeaders are immutable the call to this method will result in {@link UnsupportedOperationException}
|
||||
*/
|
||||
public void putAll(Map<? extends String, ? extends Object> t) {
|
||||
throw new UnsupportedOperationException("MessageHeaders is immutable.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Since MessageHeaders are immutable the call to this method will result in {@link UnsupportedOperationException}
|
||||
*/
|
||||
public Object remove(Object key) {
|
||||
throw new UnsupportedOperationException("MessageHeaders is immutable.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Since MessageHeaders are immutable the call to this method will result in {@link UnsupportedOperationException}
|
||||
*/
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("MessageHeaders is immutable.");
|
||||
}
|
||||
|
||||
@@ -57,6 +57,22 @@ public abstract class MessageProducerSupport extends AbstractEndpoint implements
|
||||
Assert.notNull(this.outputChannel, "outputChannel is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes no action by default. Subclasses may override this if they
|
||||
* need lifecycle-managed behavior.
|
||||
*/
|
||||
@Override
|
||||
protected void doStart() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes no action by default. Subclasses may override this if they
|
||||
* need lifecycle-managed behavior.
|
||||
*/
|
||||
@Override
|
||||
protected void doStop() {
|
||||
}
|
||||
|
||||
protected void sendMessage(Message<?> message) {
|
||||
if (message == null) {
|
||||
throw new MessagingException("cannot send a null message");
|
||||
|
||||
@@ -31,11 +31,13 @@ public abstract class AbstractScriptExecutingMessageProcessor<T> implements Mess
|
||||
public final T processMessage(Message<?> message) {
|
||||
try {
|
||||
return this.executeScript(getScriptSource(message), message);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new MessageHandlingException(message, "failed to execute script", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Subclasses must implement this method to create a script source, optionally using the message to locate or
|
||||
* create the script.
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* A message implementation that accepts a {@link Throwable} payload.
|
||||
* Once created this object is immutable.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @author Oleg Zhurakousky
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* Base Message class defining common properties such as id, payload, and headers.
|
||||
* Once created this object is immutable.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user