public class BlockingQueueMonitorNotificationServiceFactory extends java.lang.Object implements MonitorNotificationServiceFactory, java.lang.AutoCloseable
| Constructor and Description |
|---|
BlockingQueueMonitorNotificationServiceFactory(int numberOfThreads,
int bufferSize)
Creates a new factory with the capability of generating MonitorNotificationService
instances for each Consumer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes down this service factory and releases all underlying resources.
|
int |
getQosMetricBufferSizePerConsumer()
Returns an indication of the size of each consumer's notification buffer
(for service implementations which provide buffering).
|
boolean |
getQosMetricIsBuffered()
Returns an indication of whether this service implementation can be expected
to drop notifications or whether it will buffer them in situations where
the publication rate exceeds the rate at which the consumers can process the
data.
|
boolean |
getQosMetricIsNullPublishable()
Returns an indication of whether the publish method accepts null
as a valid token to be sent to the Coinsumer.
|
int |
getQosMetricNumberOfNotificationThreadsPerConsumer()
Returns an indication of how many threads the consumer may be called back on.
|
int |
getServiceCount()
Returns the count of service instances created by this provider.
|
<T> MonitorNotificationService<T> |
getServiceForConsumer(java.util.function.Consumer<? super T> consumer)
Returns a service instance which will publish events to the specified Consumer.
|
public BlockingQueueMonitorNotificationServiceFactory(int numberOfThreads,
int bufferSize)
numberOfThreads - the number of threads that will take items off the work queue.bufferSize - the size of the notification value buffer.public <T> MonitorNotificationService<T> getServiceForConsumer(java.util.function.Consumer<? super T> consumer)
getServiceForConsumer in interface MonitorNotificationServiceFactoryT - the type of events that this service instance will publish.consumer - the consumer to publish to.public void close()
close in interface java.lang.AutoCloseableclose in interface MonitorNotificationServiceFactorypublic int getServiceCount()
getServiceCount in interface MonitorNotificationServiceFactorypublic boolean getQosMetricIsBuffered()
getQosMetricIsBuffered in interface MonitorNotificationServiceFactorypublic int getQosMetricBufferSizePerConsumer()
getQosMetricBufferSizePerConsumer in interface MonitorNotificationServiceFactorypublic int getQosMetricNumberOfNotificationThreadsPerConsumer()
getQosMetricNumberOfNotificationThreadsPerConsumer in interface MonitorNotificationServiceFactorypublic boolean getQosMetricIsNullPublishable()
getQosMetricIsNullPublishable in interface MonitorNotificationServiceFactory