Generic bean that manages JCA 1.5 message endpoints within a Spring
application context, activating and deactivating the endpoint as part
of the application context's lifecycle.

This class is completely generic in that it may work with any
ResourceAdapter, any MessageEndpointFactory, and any ActivationSpec.
It can be configured in standard bean style, for example through
Spring's XML bean definition format, as follows:

In this example, Spring's own GenericMessageEndpointFactory is used
to point to a standard message listener object that happens to be supported
by the specified target ResourceAdapter: in this case, a JMS
MessageListener object as supported by the ActiveMQ
message broker, defined as a Spring bean:

The target ResourceAdapter may be configured as a local Spring bean as well
(the typical case) or obtained from JNDI (e.g. on WebLogic). For the
example above, a local ResourceAdapter bean could be defined as follows
(matching the "resourceAdapter" bean reference above):

For a different target resource, the configuration would simply point to a
different ResourceAdapter and a different ActivationSpec object (which are
both specific to the resource provider), and possibly a different message
listener (e.g. a CCI MessageListener for a
resource adapter which is based on the JCA Common Client Interface).

The asynchronous execution strategy can be customized through the
"workManager" property on the ResourceAdapterFactoryBean (as shown above).
Check out SimpleTaskWorkManager's
javadoc for its configuration options; alternatively, any other
JCA-compliant WorkManager can be used (e.g. Geronimo's).

Transactional execution is a responsibility of the concrete message endpoint,
as built by the specified MessageEndpointFactory. GenericMessageEndpointFactory
supports XA transaction participation through its "transactionManager" property,
typically with a Spring JtaTransactionManager
or a plain TransactionManager implementation specified there.

setPhase

public void setPhase(int phase)

Specify the phase in which this endpoint manager should be started
and stopped. The startup order proceeds from lowest to highest, and
the shutdown order is the reverse of that. By default this value is
Integer.MAX_VALUE meaning that this endpoint manager starts as late
as possible and stops as soon as possible.

getPhase

public int getPhase()

Return the phase in which this endpoint manager will be started and stopped.

stop

stop

Indicates that a Lifecycle component must stop if it is currently running.

The provided callback is used by the LifecycleProcessor to support an
ordered, and potentially concurrent, shutdown of all components having a
common shutdown order value. The callback must be executed after
the SmartLifecycle component does indeed stop.