Package org.epics.ca.impl.monitor
Class MonitorNotificationServiceFactoryCreator
- java.lang.Object
-
- org.epics.ca.impl.monitor.MonitorNotificationServiceFactoryCreator
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class MonitorNotificationServiceFactoryCreator extends java.lang.Object implements java.lang.AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_IMPLThis definition configures the behaviour that is applicable for a wide range of clients.static java.lang.StringHUMAN_CONSUMER_IMPLThis definition configures the behaviour for a client that does not mind dropping intermediate events to keep up with the notification rate.static java.lang.StringMACHINE_CONSUMER_IMPLThis definition configures the behaviour for a client which requires events to be buffered to keep up with the notification rate during busy periods.static intNOTIFICATION_VALUE_BUFFER_SIZE_DEFAULTThe size of the notification value buffer which will be used by default.static intNUMBER_OF_SERVICE_THREADS_DEFAULTThe number of service threads that will be used by default for service implementations which require more than one thread.static java.lang.StringV1_1_0_DEFAULT_IMPLThis definition configures the behaviour of the CA library V_1_1_0 release.
-
Constructor Summary
Constructors Constructor Description MonitorNotificationServiceFactoryCreator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static MonitorNotificationServiceFactorycreate(java.lang.String serviceConfiguration)Constructs a factory which will generate service instances based on the specified service implementation.static java.util.List<java.lang.String>getAllServiceImplementations()Returns a list of all service implementations recognised by this factory.static longgetServiceCount()static voidshutdownExecutor(java.util.concurrent.ExecutorService executorService)Utility method to cleanly shutdown an ExecutorService
-
-
-
Field Detail
-
V1_1_0_DEFAULT_IMPL
public static final java.lang.String V1_1_0_DEFAULT_IMPL
This definition configures the behaviour of the CA library V_1_1_0 release.- Implementation Note:
- This release used a BlockingQueueMonitorNotificationService with 5 queue workers.
-
DEFAULT_IMPL
public static final java.lang.String DEFAULT_IMPL
This definition configures the behaviour that is applicable for a wide range of clients.- Implementation Note:
- The current implementation uses a BlockingQueueMultipleWorkerMonitorNotificationService running with 16 notification threads. This may change in future releases.
-
HUMAN_CONSUMER_IMPL
public static final java.lang.String HUMAN_CONSUMER_IMPL
This definition configures the behaviour for a client that does not mind dropping intermediate events to keep up with the notification rate.- Implementation Note:
- The current implementation uses a BlockingQueueMultipleWorkerMonitorNotificationServiceImpl running with 100 notification threads and a non-buffering queue. This may change in future releases.
-
MACHINE_CONSUMER_IMPL
public static final java.lang.String MACHINE_CONSUMER_IMPL
This definition configures the behaviour for a client which requires events to be buffered to keep up with the notification rate during busy periods.- Implementation Note:
- The current implementation uses a StripedExecutorMonitorNotificationService running with 100 notification threads. This may change in future releases.
-
NUMBER_OF_SERVICE_THREADS_DEFAULT
public static final int NUMBER_OF_SERVICE_THREADS_DEFAULT
The number of service threads that will be used by default for service implementations which require more than one thread.- See Also:
- Constant Field Values
- Implementation Note:
- This definition currently applies to the BlockingQueueMultipleWorkerMonitorNotificationServiceImpl and StripedExecutorServiceMonitorNotificationService service implementations.
-
NOTIFICATION_VALUE_BUFFER_SIZE_DEFAULT
public static final int NOTIFICATION_VALUE_BUFFER_SIZE_DEFAULT
The size of the notification value buffer which will be used by default.- See Also:
- Constant Field Values
- Implementation Note:
- This definition currently applies to the BlockingQueueSingleWorkerMonitorNotificationServiceImpl, BlockingQueueMultipleWorkerMonitorNotificationServiceImpl service implementations.
-
-
Method Detail
-
create
public static MonitorNotificationServiceFactory create(java.lang.String serviceConfiguration)
Constructs a factory which will generate service instances based on the specified service implementation. The following properties are supported:- BlockingQueueSingleWorkerMonitorNotificationServiceImpl,NumberOfThreads,BufferSize
- BlockingQueueMultipleWorkerMonitorNotificationServiceImpl,NumberOfThreads,BufferSize
- DisruptorOldMonitorNotificationServiceImpl
- DisruptorNewMonitorNotificationServiceImpl
- StripedExecutorServiceMonitorNotificationServiceImpl,NumberOfThreads
- Parameters:
serviceConfiguration- specifies the properties of the service instances that this factory will generate.- Returns:
- the factory.
- Throws:
java.lang.IllegalArgumentException- if the serviceImpl string was of the incorrect format.
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
getAllServiceImplementations
public static java.util.List<java.lang.String> getAllServiceImplementations()
Returns a list of all service implementations recognised by this factory.- Returns:
- the list.
-
getServiceCount
public static long getServiceCount()
-
shutdownExecutor
public static void shutdownExecutor(java.util.concurrent.ExecutorService executorService)
Utility method to cleanly shutdown an ExecutorService- Parameters:
executorService- the service to shut down.
-
-