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, unsubscribe
public 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
Provider
start
in interface Provider
start
in class ProviderWrapper<FailoverProvider>
IOException
- if an error occurs during start processing.IllegalStateException
- if the Provider is improperly configured.public void close()
Provider
close
in interface Provider
close
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)
DiscoveryListener
onServiceAdd
in interface DiscoveryListener
remoteURI
- the URI of the newly discovered peer.public void onServiceRemove(URI remoteURI)
DiscoveryListener
onServiceRemove
in interface DiscoveryListener
remoteURI
- the URI of the previously discovered peer that is no longer active.public void onConnectionInterrupted(URI remoteURI)
ProviderListener
onConnectionInterrupted
in interface ProviderListener
onConnectionInterrupted
in class ProviderWrapper<FailoverProvider>
remoteURI
- The URI of the Broker whose connection was lost.public void onConnectionRestored(URI remoteURI)
ProviderListener
onConnectionRestored
in interface ProviderListener
onConnectionRestored
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.