public class NonReliableSubscriber extends java.lang.Object implements Subscriber, org.fabric3.spi.federation.addressing.AddressListener
| Constructor and Description |
|---|
NonReliableSubscriber(java.lang.String id,
ContextManager manager,
java.util.List<org.fabric3.spi.federation.addressing.SocketAddress> addresses,
org.fabric3.spi.container.channel.EventStreamHandler head,
org.fabric3.api.binding.zeromq.model.ZeroMQMetadata metadata,
java.util.concurrent.ExecutorService executorService)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
decrementConnectionCount()
Decrements the connection count.
|
java.util.List<java.lang.String> |
getAddresses() |
java.lang.String |
getId() |
boolean |
hasConnections()
True if this subscriber has active consumer connections.
|
void |
incrementConnectionCount()
Increments the connection count.
|
void |
onUpdate(java.util.List<org.fabric3.spi.federation.addressing.SocketAddress> addresses) |
void |
start()
Initializes the server and its underlying socket.
|
void |
stop()
Disposes the server and any open resources.
|
public NonReliableSubscriber(java.lang.String id,
ContextManager manager,
java.util.List<org.fabric3.spi.federation.addressing.SocketAddress> addresses,
org.fabric3.spi.container.channel.EventStreamHandler head,
org.fabric3.api.binding.zeromq.model.ZeroMQMetadata metadata,
java.util.concurrent.ExecutorService executorService)
id - the unique subscriber id, typically the consumer URI.manager - the ZeroMQ context manageraddresses - the publisher addresses the subscriber must connect tohead - the head handler for dispatching eventsmetadata - subscriber metadataexecutorService - the executor for scheduling workpublic void start()
Subscriberstart in interface Subscriberpublic void stop()
Subscriberstop in interface Subscriberpublic java.util.List<java.lang.String> getAddresses()
public void incrementConnectionCount()
SubscriberincrementConnectionCount in interface Subscriberpublic void decrementConnectionCount()
SubscriberdecrementConnectionCount in interface Subscriberpublic boolean hasConnections()
SubscriberhasConnections in interface Subscriberpublic java.lang.String getId()
getId in interface org.fabric3.spi.federation.addressing.AddressListenerpublic void onUpdate(java.util.List<org.fabric3.spi.federation.addressing.SocketAddress> addresses)
onUpdate in interface org.fabric3.spi.federation.addressing.AddressListener