Class ReactorFactory
java.lang.Object
org.ovirt.vdsm.jsonrpc.client.reactors.ReactorFactory
Factory class which provide single instance of
Reactors or ResponseWorker within single
loading scope.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intDefault timeout to clean up unprocessed events, which are in the queue more than this timeout.private static SSLStompReactorprivate static StompReactorprivate static ResponseWorker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
EVENT_TIMEOUT_IN_HOURS
private static final int EVENT_TIMEOUT_IN_HOURSDefault 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:
-
stompReactor
-
sslStompReactor
-
worker
-
-
Constructor Details
-
ReactorFactory
public ReactorFactory()
-
-
Method Details
-
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
- Parameters:
parallelism- the parallelism level using for event processing.- Returns:
- Single instance of
ResponseWorker.
-
getWorker
- 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
- Throws:
ClientConnectionException
-
getSslStompReactor
private static Reactor getSslStompReactor(ManagerProvider provider) throws ClientConnectionException - Throws:
ClientConnectionException
-