INT-1807 Add Mechanism For Headers with TCP

TCP streams have no standard message structure. Therefore, the
TCP implementation previously only transferred the message
payload.

If someone wanted to convey header information, they would have
to write their own wrapper and/or use Java serialization for
the entire message.

This change provides a strategy to allow users to determine
which headers are transferred, and how.

A MessageConvertingMessageMapper is now provided that invokes
any MessageConverter. A MapMessageConverter is provided that
converts the payload, and selected heades to a Map with two
entries ("payload") and ("headers").

A MapJsonSerializer is provided that converts a Map to/from
JSON. Jackson can't delimit multiple objects in a stream
so another serializer is required to encode/decode structure.
A ByteArrayLfSerializer is used by default, inserting a
linefeed between JSON objects.

The combination of these elements now allows header
information to be transferred over TCP. Of course, users
can implment their own (de)serializer to format the
bits on the wire exactly as needed by their application.

INT-1807 Polishing

Add a test that uses a Map MessageConverter with a
Java (de)serializer.

INT-1807: Polishing

INT-1807: Rebased and polished

Change `MapJsonSerializer` to use `JsonObjectMapper` abstraction

Doc Polishing
Update Project Lead
Update Maven Dev Info
INT-3067 Xslt method=text StringResult coercion

Previously there was a need to add `result-type="StringResult"`
to <int-xml:xslt-transformer> for xslt output `method='text'`
in case payload was non-standard type (e.g. `File`), if we wanted to get
result as text.

* Add coercion to `StringResult` code, if `Transformer`'s property `method` is 'text' and there is no explicit `resultFactory` provided.
* Add documentation to reference manual

JIRA: https://jira.springsource.org/browse/INT-3067
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.