Class ReactorFactory


  • public class ReactorFactory
    extends java.lang.Object
    Factory class which provide single instance of Reactors or ResponseWorker within single loading scope.
    • Field Detail

      • EVENT_TIMEOUT_IN_HOURS

        private static final int EVENT_TIMEOUT_IN_HOURS
        Default timeout to clean up unprocessed events, which are in the queue more than this timeout. The value should be passed from oVirt engine 4.3+, but we need to keep default value to preserve backward compatibility with 4.2.
        See Also:
        Constant Field Values
      • stompReactor

        private static volatile StompReactor stompReactor
    • Constructor Detail

      • ReactorFactory

        public ReactorFactory()
    • Method Detail

      • getReactor

        public static Reactor getReactor​(ManagerProvider provider,
                                         ReactorType type)
                                  throws ClientConnectionException
        Provides instance of Reactor based on ManagerProvider availability and type provided.
        Parameters:
        provider - Provides ability to get SSL context.
        type - ReactorType which will be created.
        Returns:
        NioReactor reactor when provider is null or SSLReactor.
        Throws:
        ClientConnectionException - when unexpected type value is provided or issue with constucting selector.
      • getWorker

        public static ResponseWorker getWorker​(int parallelism)
        Parameters:
        parallelism - the parallelism level using for event processing.
        Returns:
        Single instance of ResponseWorker.
      • getWorker

        public static ResponseWorker getWorker​(int parallelism,
                                               int eventTimeoutInHours)
        Parameters:
        parallelism - the parallelism level using for event processing.
        eventTimeoutInHours - the timeout after which the events are purged from the queue.
        Returns:
        Single instance of ResponseWorker.