INT-3166: Improve Groovy Processor Performance

Previously, there was a `synchronized` block in the `GroovyScriptExecutingMessageProcessor`
to achieve thread-safety around script variables.
In addition, the parsing and executing logic was delegated to `GroovyScriptFactory`, who, in turn,
has its own `synchronized` around script parsing.
This causes a bottleneck in a messaging architecture.

* Introduce `GroovyScriptExecutor implements ScriptExecutor`
to encapsulate Groovy parsing and executing logic
* synchronize via `ReentrantLock` only when script resource `isModified()`

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

INT-3166: Fixes and Polishing

INT-3166: add synchronized double check

INT-3166: Remove `GroovyScriptExecutor`

Polishing tests and logic around exceptions

Fix up some white space issues in Groovy*Tests
INT-2629 Extract Gateway Argument Mapping Strategy

https://jira.springsource.org/browse/INT-2629

Strategy for mapping gateway methods to map method arguments
to a message.

Default strategy works as today, but pluggable using attribute
'mapper' on <gateway/>.

A custom mapper should implement InboundMessageMapper<MethodArgsHolder>

where the MethodArgsHolder contains the Method object and the argument
values.

When using a custom mapper, the mapper is entirely responsible for
creating the Message - therefore 'payload-expression' attributes
and <header/> elements are not allowed.

INT-2629 Polishing - Javadocs

INT-2629 Polishing

- Introduce MethodArgsMessageMapper - higher level API for custom mapper.

INT-2629: Polishing docs
INT-2961 Make ARPMH.onInit() Final; Add doInit()

https://jira.springsource.org/browse/INT-2961

onInit() relied on subclasses calling super.onInit() to apply the
advice chain and add the BeanFactory to the MessagingTemplate.

At least one extension (smpp) failed to do this, disabling these features.

Make onInit() final and call doInit() for subclass initialization (no-op in ARPMH).

INT-2961 Polishing

- do not increase visibility of doInit in subclasses.
- remove final modifiers from doInit so user subclasses can participate in initialization if needed.
INT-3180: Fix `FtpParserInboundTests`

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

* Change non-existing interface in the config to existing one
* Change `@Test(expected=BeanCreationException.class)` to `try...catch` block
and check the StackTrace for appropriate, expected `Exception`
INT-1362 HTTP Inbound: Additional EvalCtx Vars.

JIRA: https://jira.springsource.org/browse/INT-1362, https://jira.springsource.org/browse/INT-2469

* Add to the `EvaluationContext` of HTTP Inbound Endpoints additional request variables
* Tests and documentation

INT-2669: Mention SpEL variables in JavaDocs

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

INT-1362 Doc Polishing
INT-3180 Add s-i-ftp/test to .gitIgnore

Inadvertently added left over test files.
INT-3178 Defer Publishing of TCP Open Event

Previously, the TcpConnectionOpenEvent was published as soon
as the socket was connected, but the TcpConnection was not yet
ready for use.

Defer publishing the event until the connection is fully
initialized and registered with the factory and thus available
for use.

Update the test cases to reflect this behavior.

Since the event is now published by the appropriate concrete
factory implementations, enhance the ConnectionToConnectionTests
to verify proper eventing with both Net and NIO implementations.

INT-3178: Add `theConnection` `ReadWriteLock`

INT-3178 Polishing

- Refactor obtainConnection() into obtainSharedConnection() and obtainNewConnection() for Net and NIO Client factories.
- obtainConnection is now common for these two factories, and overridden by the caching and failover factories.
- ReadWriteLock - double check for shared connection after lock obtained.

INT-3178: Polishing
INT-1362-2: Reset RequestContextHolder in Tests

JIRA: https://jira.springsource.org/browse/INT-1362
INT-3181: Improve JdbcChannelMS usingIdCache doc

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

INT-3181: Fix JdbcChannelMS#pollMessageFromGroup

* Add `doRemoveMessageFromGroup` and check its result.
If it is `false` then just return `null`, not polled `Message`
* Add `AbstractTxTimeoutMessageStoreTests#testInt3181ConcurrentPolling` test
and implement it for some DBs
* Make a note regarding MVCC as important in the Doc

Minor Polishing
INT-3185 Fix Direct Handlers When Exposed as MBean

When determining candidates for direct invocation, we need
to use the target of any existing proxy (such as JMX Metrics).

Copy ServiceActivatorDefaultFrameworkMethodTests to the JMX project
and adjust to work with JMX Proxies.

INT-3185: fix for AbstractSMHFBean#checkReuse

JIRA: https://jira.springsource.org/browse/INT-3185
INT-2664: (S)FTP Inbound: Preserve File Timestamp

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

INT-2664: add `preserve-timestamp` attribute

Doc Polishing
Test Case Fixes for Latest SPR 4 Snapshot

- Close child context before parent to publish child close event to parent
- SpelRouter FB injection
- Don't pass null Method to TransactionAttributeSource.getTransactionAttribute()
Merge remote-tracking branch 'upstream/master' into 4.0.0-WIP

Conflicts:
	spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInterfaceTests.java
	spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterWithMappingTests.java
	spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessor.java
	spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayWithPathMappingTests.java
	spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/AbstractTxTimeoutMessageStoreTests.java
	spring-integration-jmx/src/main/java/org/springframework/integration/jmx/OperationInvokingMessageHandler.java

Resolved.
Fix Imports After Merge