Class ReactorFactory
- java.lang.Object
-
- org.ovirt.vdsm.jsonrpc.client.reactors.ReactorFactory
-
public class ReactorFactory extends java.lang.ObjectFactory class which provide single instance ofReactors orResponseWorkerwithin single loading scope.
-
-
Field Summary
Fields Modifier and Type Field Description private static intEVENT_TIMEOUT_IN_HOURSDefault timeout to clean up unprocessed events, which are in the queue more than this timeout.private static SSLStompReactorsslStompReactorprivate static StompReactorstompReactorprivate static ResponseWorkerworker
-
Constructor Summary
Constructors Constructor Description ReactorFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ReactorgetReactor(ManagerProvider provider, ReactorType type)Provides instance ofReactorbased onManagerProvideravailability and type provided.private static ReactorgetSslStompReactor(ManagerProvider provider)private static ReactorgetStompReactor(ManagerProvider provider)static ResponseWorkergetWorker(int parallelism)static ResponseWorkergetWorker(int parallelism, int eventTimeoutInHours)
-
-
-
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
-
sslStompReactor
private static volatile SSLStompReactor sslStompReactor
-
worker
private static volatile ResponseWorker worker
-
-
Method Detail
-
getReactor
public static Reactor getReactor(ManagerProvider provider, ReactorType type) throws ClientConnectionException
Provides instance ofReactorbased onManagerProvideravailability and type provided.- Parameters:
provider- Provides ability to get SSL context.type-ReactorTypewhich will be created.- Returns:
NioReactorreactor when provider isnullorSSLReactor.- 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.
-
getStompReactor
private static Reactor getStompReactor(ManagerProvider provider) throws ClientConnectionException
- Throws:
ClientConnectionException
-
getSslStompReactor
private static Reactor getSslStompReactor(ManagerProvider provider) throws ClientConnectionException
- Throws:
ClientConnectionException
-
-