INT-4314: MutableMessageBuilder Javadocs

JIRA: https://jira.spring.io/browse/INT-4314
This commit is contained in:
Gary Russell
2017-10-30 14:29:30 -04:00
committed by Artem Bilan
parent f35aa13636
commit 56de7149c3
2 changed files with 22 additions and 5 deletions

View File

@@ -27,11 +27,18 @@ import org.springframework.util.ObjectUtils;
/**
* An implementation of {@link Message} with a generic payload. Unlike
* {@link GenericMessage}, this message (or its headers) can be modified
* after creation. Great care must be taken, when mutating messages, that
* some other element/thread is not concurrently using the message. Also note
* that any in-memory stores (such as {@link SimpleMessageStore}) may have
* a reference to the message and changes will be reflected there too.
* {@link GenericMessage}, this message (or its headers) can be modified after creation.
* Great care must be taken, when mutating messages, that some other element/thread is not
* concurrently using the message. Also note that any in-memory stores (such as
* {@link SimpleMessageStore}) may have a reference to the message and changes will be
* reflected there too.
*
* <p>
* <b>IMPORTANT: Mutable messages may share state (such as message headers); such messages
* should never be exposed to other components or undesirable side-effects may result.</b>
* <p>
* <b>It is generally recommended that messages transferred between components should
* always be immutable unless great care is taken with their use.</b>
*
* @author Gary Russell
* @author Artem Bilan

View File

@@ -30,6 +30,16 @@ import org.springframework.util.StringUtils;
/**
* Specialized message builder that can be used within a component to avoid the overhead
* of having to build multiple messages for mutations within that component.
*
* <p>
* <b>IMPORTANT: Mutable messages may share state (such as message headers); such messages
* should never be exposed to other components or undesirable side-effects may result.</b>
* <p>
* <b>It is generally recommended that messages transferred between components should
* always be immutable unless great care is taken with their use.</b>
*
* @author Gary Russell
* @author Artem Bilan
* @since 4.0