public class DiscoveryProvider extends ProviderWrapper<FailoverProvider> implements DiscoveryListener
listener, next| Constructor and Description |
|---|
DiscoveryProvider(URI discoveryUri,
FailoverProvider next)
Creates a new instance of the DiscoveryProvider.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this Provider terminating all connections and canceling any pending
operations.
|
List<DiscoveryAgent> |
getDiscoveryAgents() |
URI |
getDiscoveryURI() |
void |
onConnectionInterrupted(URI remoteURI)
Called from a fault tolerant Provider instance to signal that the underlying
connection to the Broker has been lost.
|
void |
onConnectionRestored(URI remoteURI)
Called to signal that all recovery operations are now complete and the Provider
is again in a normal connected state.
|
void |
onServiceAdd(URI remoteURI)
Called when a DiscoveryAgent becomes aware of a new remote peer.
|
void |
onServiceRemove(URI remoteURI)
Called when a DiscoveryAgent can no longer detect a previously known remote peer.
|
void |
setDiscoveryAgents(List<DiscoveryAgent> agents)
Sets the discovery agents used by this provider to locate remote peer instance.
|
void |
start()
Starts the Provider.
|
acknowledge, acknowledge, commit, connect, create, destroy, getMessageFactory, getNext, getProviderListener, getRemoteURI, onConnectionEstablished, onConnectionFailure, onConnectionRecovered, onConnectionRecovery, onInboundMessage, onProviderException, onResourceRemotelyClosed, pull, recover, rollback, send, setProviderListener, start, stop, unsubscribepublic DiscoveryProvider(URI discoveryUri, FailoverProvider next)
discoveryUri - The URI that configures the discovery provider.next - The FailoverProvider that will be used to manage connections.public void start()
throws IOException,
IllegalStateException
Providerstart in interface Providerstart in class ProviderWrapper<FailoverProvider>IOException - if an error occurs during start processing.IllegalStateException - if the Provider is improperly configured.public void close()
Providerclose in interface Providerclose in class ProviderWrapper<FailoverProvider>public URI getDiscoveryURI()
public List<DiscoveryAgent> getDiscoveryAgents()
public void setDiscoveryAgents(List<DiscoveryAgent> agents)
agents - the agents to use to discover remote peerspublic void onServiceAdd(URI remoteURI)
DiscoveryListeneronServiceAdd in interface DiscoveryListenerremoteURI - the URI of the newly discovered peer.public void onServiceRemove(URI remoteURI)
DiscoveryListeneronServiceRemove in interface DiscoveryListenerremoteURI - the URI of the previously discovered peer that is no longer active.public void onConnectionInterrupted(URI remoteURI)
ProviderListeneronConnectionInterrupted in interface ProviderListeneronConnectionInterrupted in class ProviderWrapper<FailoverProvider>remoteURI - The URI of the Broker whose connection was lost.public void onConnectionRestored(URI remoteURI)
ProviderListeneronConnectionRestored in interface ProviderListeneronConnectionRestored in class ProviderWrapper<FailoverProvider>remoteURI - The URI of the Broker that the client has now connected to.Copyright © 2013–2016 The Apache Software Foundation. All rights reserved.