Class ReactorFactory
- java.lang.Object
-
- org.ovirt.vdsm.jsonrpc.client.reactors.ReactorFactory
-
public class ReactorFactory extends java.lang.Object
Factory class which provide single instance ofReactor
s orResponseWorker
within single loading scope.
-
-
Constructor Summary
Constructors Constructor Description ReactorFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Reactor
getReactor(ManagerProvider provider, ReactorType type)
Provides instance ofReactor
based onManagerProvider
availability and type provided.static ResponseWorker
getWorker(int parallelism)
static ResponseWorker
getWorker(int parallelism, int eventTimeoutInHours)
-
-
-
Method Detail
-
getReactor
public static Reactor getReactor(ManagerProvider provider, ReactorType type) throws ClientConnectionException
Provides instance ofReactor
based onManagerProvider
availability and type provided.- Parameters:
provider
- Provides ability to get SSL context.type
-ReactorType
which will be created.- Returns:
NioReactor
reactor when provider isnull
orSSLReactor
.- 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
.
-
-