concept connection in category mule

This is an excerpt from Manning's book Mule in Action, Second Edition.
For transports, a connector provides the infrastructure to communicate to a particular protocol. An endpoint sends and receives messages on a specific channel using the infrastructure provided by the connector. A JMS connector, for example, is responsible for managing the connection to the JMS broker, handling the authentication and reconnecting in the event of a communication failure. A JMS endpoint, on the other hand, is responsible for sending and receiving messages on queues and topics. Endpoints are the cornerstone of IO with transports in Mule; they’re the tools you’ll use to get data into and out of your flows.
maxWait— When exhaustedAction (see next) is set to WHEN_EXAUSTED_WAIT, sets the number of milliseconds to wait for a connection. exhaustedAction— Defines how the connector will react when the maximum number of active connections is reached. The possible values are these:
- WHEN_EXHAUSTED_FAIL— Instructs Mule to throw a NoSuchElementException when the limit for maxActive connections is reached.
- WHEN_EXHAUSTED_WAIT— Establishes that Mule will wait for a connection for the time set in maxWait; if in that time an available connection isn’t found, the same behavior as WHEN_EXHAUSTED_FAIL should be expected. A negative value will set an infinite wait for an available connection.
- WHEN_EXHAUSTED_GROW— This configuration will create a new connection each time the limit of connections is reached, ignoring the maxActive value. This is the default behavior.
Connection validation (assertion that a connection is alive) and invalidation (establishes the need for reconnection) are handled using the annotations @Validate-Connection and @InvalidateConnectionOn. Although the first one is applied to a method that will return a Boolean if the connection is valid, the second one is applied to methods that are already annotated with @Processor or @Source and if a matching exception is thrown, the connection will be invalidated. Put them in practice in a small weather connector: