INT-2901 Fix Mail HeaderEnricher Doc

The move from attributes to child elements was not reflected
in the reference manual.
INT-2901 Add Namespace Prefix

Avoid confusion with the core header enricher.
Fix Syslog Test

Test didn't wait for the TCP server to start listening.
INT-3087:Fix MongoDbMessageStore RemoveMessage Bug

Add new query so the same message found in pollMessageFromGroup is the
one which gets deleted.

See jira for more details: https://jira.springsource.org/browse/INT-3087

INT-3087 Polishing

Use an atomic method in pollMessageFromGroup to pop the first message.

Add test cases for pollMessageFromGroup and removeMessageFromGroup
where the same message exists in multiple groups.
INT-3111 Fix Close Cached TCP Connection

A TCP Connection is closed when an outbound gateway times out.

However, with the CachingClientConnectionFactory, the connection
was returned to the pool instead of being physically closed.

Override forceClose() and physically close the connection so the
next time it is retrieved from the pool it is detected as stale
and re-established.

Refactor test case and invoke it twice; once with a regular connection
factory and once with a cached factory.

Remove an unused logger.
INT-2822: 'requires-reply' for Outbound Gateways

* Add `requires-reply` attribute for all adapters outbound gateways as `true` by default
* WS-outbound-gateway is still without it, because it has its own specific attribute `ignore-empty-responses`
* Make `requires-reply` as `false` by default for `jdbc:stored-proc-outbound-gateway` inasmuch as `jdbc:stored-proc-outbound-adapter`
doesn't have ability to configure `returning-resultset`
* add parser tests for `requires-reply`

JIRA: https://jira.springsource.org/browse/INT-2822

INT-2822 'requires-reply' for ws:outbound-gateway

Default false.

INT-2822: Polishing after rebase

INT-2822: deprecate 'ignore-empty-responses'

* Add 'requires-reply' section into What's New

INT-2822: remove 'ignore-empty-responses' from RM

INT-2822: Polishing after rebase

INT-2822: Rebased and polished

INT-2822: Rebased and polished

Add WARN within deprecated `AbstractWebServiceOutboundGateway#setIgnoreEmptyResponses`

Revert 'ignore-empty-responses'; Doc Polishing
INT-3063: 'Expires' HTTP header workaround

According to RFC 2616 HTTP clients should ignore invalid values
for date-aware header, but Spring MVC `HttpHeaders` raises
`IllegalArgumentException` in this case.
Proposal fix to Spring Integration just to `try...catch` call of
`HttpHeaders.getExpires()` and `return null`.

JIRA: https://jira.springsource.org/browse/INT-3063
Fix while Block Formatting in SimplePool
INT-2994 Advice Chain Config via Annotations

Allow configuration of request handler advice chain using

- ServiceActivator
- Filter
- Splitter
- Transformer

annotations.

Also, with splitter, allow setting discardWithinAdvice (See
INT-2938).

INT-2994 Polishing: PR Comments

- Change adviceChain attribute to an array
- Use a boolean for the discardWithinAdvice attribute

INT-2994 Handler Advice Doc Polishing

Add a paragraph about Advice Order.
INT-3051 Derive Script Language from Extension

Make 'lang' attribute optional on a script element and
attempt to derive the language from the file extension.

Change return value on ScriptParser.deriveLanguageFromExtension to the language name

Polishing (PR Comments)
INT-2243: Delayer: Add 'expression' Support

Previously, the `<delayer>` provided a `delay-header-name` attribute.
In complex cases there was need to precede it with `<header-enricher>`.

* Add support for an 'expression' attribute and sub-element
* Deprecate `delay-header-name`
* Make `DelayHandler.DelayedMessageWrapper` *public* to allow access for Messages in the Store
* Add tests
* Add 'What's new' section
* Polishing Delayer's doc regarding new abilities

JIRA: https://jira.springsource.org/browse/INT-2243, https://jira.springsource.org/browse/INT-3049

INT-2243: ban delay-header-name with expression

INT-2243 Polishing

INT-2243: fall-back to default on Eval Exception

INT-2243: DelayedMessageWrapper refactoring

* Make `DelayedMessageWrapper` Spring Data Mongo mapping compatible.
In terms of Spring Data - add Persistence Constructor

INT-2243 add 'ignore-expression-failures' support

* Add `ignore-expression-failures` to the `<delayer>`
* Add tests for `ignore-expression-failures`
* Add a note to the RM
* Describe SpEL side-effects for `DelayHandler`

Doc Polishing
INT-3078, INT-3079: Redis & Gemfire Delayer Tests

Add Redis & Gemfire Delayer integration tests
to be sure that Delayer works correctly

JIRA: https://jira.springsource.org/browse/INT-3078
https://jira.springsource.org/browse/INT-3079
INT-3112 Fix OOM in SimplePool

The SimplePool maintains an 'allocated' set, for the sole reason
of preventing a "foreign" (non-managed) object being returned.

When a pool item is detected as stale, it is removed from the pool
but remains in the 'allocated' set.

Add a test to verify the allocated size is reduced when a stale
item is popped from the pool.

Add a FileTransferringMessageHandler test (where the problem was
discovered).

Fix a test in TCP to expect a close().

Polishing

Do not allow returning null items to just release a permit - it
cannot remove the item from allocated. Clients must return the
stale item to the pool so it can be refreshed on the next get.

Only used by the TCP caching CF when returning a connection when
the factory is not running; but should not be allowed.

Also, protect against double release - not currently an issue with
existing users of SimplePool, but should be protected against. Could
cause the permit count to exceed the pool size.

Add inUse Set to the pool so we can detect attempts to release an
item that has already been released.
INT-3096 TCP Allow Stacking Cache and Failover

Support nesting the fail over and caching client connection
factories.

The TcpListener chain was not set up properly; this prevented
caching Failover connections, or Failover cached connections.

Each nested interceptor needs the next outer interceptor set
up as its listener, so the underlying connection calls
onMessage() all the way up to the ultimate listener (adapter
or gateway).

Fix the Listener hierarchy; add tests for caching failover
connections and failing over cached connections.

Don't overrwrite the actual connection id if it has already
been set up by a lower level wrapper.
INT-1639 Externalize SpEL Evaluation Context

Allow modification of context property accessors and
functions.

Polishing

- Fix tests to ensure the EvaluationContextFactoryBean is
available when necessary.

Polishing - Use Utility for ALL EvaluationContexts

Add Test Showing Custom Function

See SpelTransformerIntegrationTests-context.xml

Polishing

Polishing -fix Remote Sync

Polishing - Emit WARN if No BeanFactory

Polishing - Do Not Override ConversionService

Kludge to Prevent Warning When No BeanFactory

Expressions for method invoking in the MessagingMethodInvokerHelper
don't need a BeanFactory - suppress the warning.

Polishing - PR Comments - Invert Boolean
INT-3103 TCP Propagate Exceptions to GW Thread

Previously, when a calling thread was waiting for a reply, and an exception
occurred on the socket, the exception was not propagated to the thread and
it would eventually get a timeout, but with no indication of the problem.

Propagate the exception to the calling thread by invoking onMessage()
with an ErrorMessage.

Ignore the ErrorMessage in other TcpListeners (inbound adapter, gateway).

Ensure NIO closes are not missed by sending an ErrorMessage when the selector
thread detects a closed channel.

Add tests for Net, NIO, cached and failover connection factories.

Polishing

Remove left-over debug logs; add comment to setReply().

Add comments for ErrorMessages in onMessage().
INT-3054 URI Variable Mapping Improvements

Permit missing URI vars in HTTP outbound gateway

Do not attempt to evaluate uri variables that are not in the URL

The http gateway might not know what uri variables it might obtain in the URI.
This patch makes sure that only the uri variables defined in the uri are parsed (the rest are ignored)
INT-3054: Add ExpressionEvalMap Support

Use an immutable Map wrapper to evaluate expressions
only when accessed.

Polishing
Merge pull request #822 from wwadge/INT-3054

* INT-3054:
  INT-3054: Add ExpressionEvalMap Support
  INT-3054 URI Variable Mapping Improvements
Remove DOS Newlines from ECMP

ExpressionCommandMessageProcessor