public class ZeroMQPubSubBrokerImpl extends java.lang.Object implements ZeroMQPubSubBroker, org.fabric3.spi.runtime.event.Fabric3EventListener<org.fabric3.spi.runtime.event.RuntimeStop>
| Constructor and Description |
|---|
ZeroMQPubSubBrokerImpl(ContextManager manager,
org.fabric3.spi.federation.addressing.AddressCache addressCache,
org.fabric3.spi.host.PortAllocator allocator,
org.fabric3.spi.container.channel.TransformerHandlerFactory handlerFactory,
ZeroMQManagementService managementService,
org.fabric3.spi.runtime.event.EventService eventService,
java.util.concurrent.ExecutorService executorService,
org.fabric3.api.host.runtime.HostInfo info,
MessagingMonitor monitor) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect(java.lang.String connectionId,
org.fabric3.api.binding.zeromq.model.ZeroMQMetadata metadata,
boolean dedicatedThread,
org.fabric3.spi.container.channel.ChannelConnection connection,
java.lang.ClassLoader loader)
Connects the channel connection to the publisher for the given channel.
|
void |
init() |
void |
onEvent(org.fabric3.spi.runtime.event.RuntimeStop event) |
void |
release(java.lang.String connectionId,
org.fabric3.api.binding.zeromq.model.ZeroMQMetadata metadata)
Releases a publisher for a channel.
|
void |
setHost(java.lang.String host)
Sets this host to bind the publisher to.
|
void |
setPollTimeout(long timeout)
Sets the timeout in milliseconds for polling operations.
|
void |
startAll()
Starts all publishers and subscribers.
|
void |
stopAll()
Stops all publishers and subscribers.
|
void |
subscribe(java.net.URI subscriberId,
org.fabric3.api.binding.zeromq.model.ZeroMQMetadata metadata,
org.fabric3.spi.container.channel.ChannelConnection connection,
java.lang.ClassLoader loader)
Subscribes a consumer to the given channel.
|
void |
unsubscribe(java.net.URI subscriberId,
org.fabric3.api.binding.zeromq.model.ZeroMQMetadata metadata)
Removes a consumer from the given channel.
|
public ZeroMQPubSubBrokerImpl(ContextManager manager, org.fabric3.spi.federation.addressing.AddressCache addressCache, org.fabric3.spi.host.PortAllocator allocator, org.fabric3.spi.container.channel.TransformerHandlerFactory handlerFactory, ZeroMQManagementService managementService, org.fabric3.spi.runtime.event.EventService eventService, java.util.concurrent.ExecutorService executorService, org.fabric3.api.host.runtime.HostInfo info, MessagingMonitor monitor) throws java.net.UnknownHostException
java.net.UnknownHostExceptionpublic void setPollTimeout(long timeout)
timeout - the timeout in milliseconds for polling operationspublic void setHost(java.lang.String host)
host - the hostpublic void init()
public void subscribe(java.net.URI subscriberId,
org.fabric3.api.binding.zeromq.model.ZeroMQMetadata metadata,
org.fabric3.spi.container.channel.ChannelConnection connection,
java.lang.ClassLoader loader)
throws BrokerException
ZeroMQPubSubBrokersubscribe in interface ZeroMQPubSubBrokersubscriberId - the unique subscription idmetadata - the ZeroMQ metadata to configure the underlying socketconnection - the consumer connection to dispatch received message toloader - the classloader for deserializing events, typically the consumer implementation contribution classloaderBrokerException - if an error occurs creating the subscriptionpublic void unsubscribe(java.net.URI subscriberId,
org.fabric3.api.binding.zeromq.model.ZeroMQMetadata metadata)
ZeroMQPubSubBrokerunsubscribe in interface ZeroMQPubSubBrokersubscriberId - the unique subscription idmetadata - the ZeroMQ metadata to configure the underlying socketpublic void connect(java.lang.String connectionId,
org.fabric3.api.binding.zeromq.model.ZeroMQMetadata metadata,
boolean dedicatedThread,
org.fabric3.spi.container.channel.ChannelConnection connection,
java.lang.ClassLoader loader)
throws BrokerException
ZeroMQPubSubBrokerconnect in interface ZeroMQPubSubBrokerconnectionId - the unique id for the connectionmetadata - the ZeroMQ metadata to configure the underlying socketconnection - the producer that dispatches messages to the publisherloader - the classloader for the event types being sentBrokerException - if an error occurs removing the subscriptionpublic void release(java.lang.String connectionId,
org.fabric3.api.binding.zeromq.model.ZeroMQMetadata metadata)
throws BrokerException
ZeroMQPubSubBrokerrelease in interface ZeroMQPubSubBrokerconnectionId - the unique id for the connectionmetadata - the ZeroMQ metadata to configure the underlying socketBrokerException - if an error occurs removing the publisherpublic void startAll()
ZeroMQPubSubBrokerstartAll in interface ZeroMQPubSubBrokerpublic void stopAll()
ZeroMQPubSubBrokerstopAll in interface ZeroMQPubSubBrokerpublic void onEvent(org.fabric3.spi.runtime.event.RuntimeStop event)
onEvent in interface org.fabric3.spi.runtime.event.Fabric3EventListener<org.fabric3.spi.runtime.event.RuntimeStop>