public interface Provider
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledge(JmsInboundMessageDispatch envelope,
ProviderConstants.ACK_TYPE ackType,
AsyncResult request)
Called to acknowledge a JmsMessage has been delivered, consumed, re-delivered...etc.
|
void |
acknowledge(JmsSessionId sessionId,
ProviderConstants.ACK_TYPE ackType,
AsyncResult request)
Called to acknowledge all messages that have been delivered in a given session.
|
void |
close()
Closes this Provider terminating all connections and canceling any pending
operations.
|
void |
commit(JmsTransactionInfo transactionInfo,
JmsTransactionInfo nextTransactionInfo,
AsyncResult request)
Called to commit an open transaction, and start a new one if a new transaction info
object is provided.
|
void |
connect(JmsConnectionInfo connectionInfo)
Performs the initial low level connection for this provider such as TCP or
SSL connection to a remote Broker.
|
void |
create(JmsResource resource,
AsyncResult request)
Create the Provider version of the given JmsResource.
|
void |
destroy(JmsResource resource,
AsyncResult request)
Instruct the Provider to dispose of a given JmsResource.
|
List<URI> |
getAlternateURIs()
Returns a
List of alternate remote peers (possibly found via discovery) to
which the caller can attempt a recoonect should this provider connection fail. |
JmsMessageFactory |
getMessageFactory()
Gets the Provider specific Message factory for use in the JMS layer when a Session
is asked to create a Message type.
|
ProviderListener |
getProviderListener()
Gets the currently set ProdiverListener instance.
|
URI |
getRemoteURI()
Returns the URI used to configure this Provider and specify the remote address of the
Broker it connects to.
|
ProviderFuture |
newProviderFuture()
Gets a ProviderFuture instance from the Provider for use in performing Provider calls
that require an asynchronous completion to know when the call to the provider has succeeded
or failed.
|
ProviderFuture |
newProviderFuture(ProviderSynchronization synchronization)
Gets a ProviderFuture instance from the Provider for use in performing Provider calls
that require an asynchronous completion to know when the call to the provider has succeeded
or failed.
|
void |
pull(JmsConsumerId consumerId,
long timeout,
AsyncResult request)
Request a remote peer send a Message to this client.
|
void |
recover(JmsSessionId sessionId,
AsyncResult request)
Called to recover all unacknowledged messages for a Session in client Ack mode.
|
void |
rollback(JmsTransactionInfo transactionInfo,
JmsTransactionInfo nextTransactionInfo,
AsyncResult request)
Called to roll back an open transaction, and start a new one if a new transaction info
object is provided.
|
void |
send(JmsOutboundMessageDispatch envelope,
AsyncResult request)
Sends the JmsMessage contained in the outbound dispatch envelope.
|
void |
setProviderListener(ProviderListener listener)
Sets the listener of events from this Provider instance.
|
void |
start()
Starts the Provider.
|
void |
start(JmsResource resource,
AsyncResult request)
Starts the Provider version of the given JmsResource.
|
void |
stop(JmsResource resource,
AsyncResult request)
Stops (pauses) the Provider version of the given JmsResource, the resource would then
need to be started again via a call to
start()
For some JMS Resources it is necessary or advantageous to have a stopped state that
can be triggered to stop the resource generating new events or messages. |
void |
unsubscribe(String subscription,
AsyncResult request)
Remove a durable topic subscription by name.
|
void connect(JmsConnectionInfo connectionInfo) throws ProviderException
connectionInfo - The JmsConnectionInfo that contains the properties that define this connection.ProviderException - if the remote resource can not be contacted.void start()
throws ProviderException,
IllegalStateException
ProviderException - if an error occurs during start processing.IllegalStateException - if the Provider is improperly configured.void close()
URI getRemoteURI()
List<URI> getAlternateURIs()
List of alternate remote peers (possibly found via discovery) to
which the caller can attempt a recoonect should this provider connection fail. If there
are no known alternates this method returns an empty List.void create(JmsResource resource, AsyncResult request) throws ProviderException
resource - The JmsResouce instance that indicates what is being created.request - The request object that should be signaled when this operation completes.ProviderException - if an error occurs or the Provider is already closed.void start(JmsResource resource, AsyncResult request) throws ProviderException
resource - The JmsResouce instance that indicates what is being started.request - The request object that should be signaled when this operation completes.ProviderException - if an error occurs or the Provider is already closed.void stop(JmsResource resource, AsyncResult request) throws ProviderException
start()
For some JMS Resources it is necessary or advantageous to have a stopped state that
can be triggered to stop the resource generating new events or messages.
An example of this would be a JMS Session which should not receive any incoming messages
for any consumers until the JMS layer is in a state to handle them. One such time would be
during a transaction rollback. A JMS Session should normally ensure that messages received
in a transaction are set to be redelivered prior to any new deliveries on a transaction
rollback.
The provider is required to implement this method and not throw any error other than
an ProviderException if a communication error occurs. The stop operation is not required to
have any effect on the provider resource but must not throw UnsupportedOperation etc.resource - The JmsResouce instance that indicates what is being stopped.request - The request object that should be signaled when this operation completes.ProviderException - if an error occurs or the Provider is already closed.void destroy(JmsResource resource, AsyncResult request) throws ProviderException
resource - The JmsResouce that identifies a previously created JmsResource.request - The request object that should be signaled when this operation completes.ProviderException - if an error occurs or the Provider is already closed.void send(JmsOutboundMessageDispatch envelope, AsyncResult request) throws ProviderException
envelope - the message envelope containing the JmsMessage to send.request - The request object that should be signaled when this operation completes.ProviderException - if an error occurs or the Provider is already closed.void acknowledge(JmsSessionId sessionId, ProviderConstants.ACK_TYPE ackType, AsyncResult request) throws ProviderException
sessionId - the ID of the Session whose delivered messages should be acknowledged.ackType - The type of acknowledgement being done.request - The request object that should be signaled when this operation completes.ProviderException - if an error occurs or the Provider is already closed.void acknowledge(JmsInboundMessageDispatch envelope, ProviderConstants.ACK_TYPE ackType, AsyncResult request) throws ProviderException
envelope - The message dispatch envelope containing the Message delivery information.ackType - The type of acknowledgement being done.request - The request object that should be signaled when this operation completes.ProviderException - if an error occurs or the Provider is already closed.void commit(JmsTransactionInfo transactionInfo, JmsTransactionInfo nextTransactionInfo, AsyncResult request) throws ProviderException
transactionInfo - the transaction info that describes the transaction being committed.nextTransactionInfo - the transaction info that describes the new transaction that should be created.request - The request object that should be signaled when this operation completes.ProviderException - if an error occurs or the Provider is already closed.void rollback(JmsTransactionInfo transactionInfo, JmsTransactionInfo nextTransactionInfo, AsyncResult request) throws ProviderException
transactionInfo - the transaction info that describes the transaction being rolled back.nextTransactionInfo - the transaction info that describes the new transaction that should be created.request - The request object that should be signaled when this operation completes.ProviderException - if an error occurs or the Provider is already closed.void recover(JmsSessionId sessionId, AsyncResult request) throws ProviderException
sessionId - the Id of the JmsSession that is recovering unacknowledged messages..request - The request object that should be signaled when this operation completes.ProviderException - if an error occurs or the Provider is already closed.void unsubscribe(String subscription, AsyncResult request) throws ProviderException
subscription - the name of the durable subscription that is to be removed.request - The request object that should be signaled when this operation completes.ProviderException - if an error occurs or the Provider is already closed.void pull(JmsConsumerId consumerId, long timeout, AsyncResult request) throws ProviderException
consumerId - the ID of the Consumer instance that is attempt to pull a message from the remote.timeout - the amount of time to tell the remote peer to keep this pull request valid.request - The request object that should be signaled when this operation completes.ProviderException - if an error occurs or the Provider is already closed.JmsMessageFactory getMessageFactory()
ProviderFuture newProviderFuture()
ProviderFuture newProviderFuture(ProviderSynchronization synchronization)
synchronization - A ProviderSynchronization to assign to the resulting ProviderFuture.void setProviderListener(ProviderListener listener)
listener - The listener instance that will receive all event callbacks.ProviderListener getProviderListener()
Copyright © 2013–2019 The Apache Software Foundation. All rights reserved.