public class RxJavaPlugins
extends java.lang.Object
register methods in this classSystem.getProperty(String) (see get methods for
property names)In addition to the rxjava.plugin.[simple class name].implementation system properties,
you can define two system property:
rxjava.plugin.[index].class}
rxjava.plugin.[index].impl}
Where the .class property contains the simple class name from above and the .impl
contains the fully qualified name of the implementation class. The [index] can be
any short string or number of your choosing. For example, you can now define a custom
RxJavaErrorHandler via two system property:
rxjava.plugin.1.class=RxJavaErrorHandler
rxjava.plugin.1.impl=some.package.MyRxJavaErrorHandler
| Modifier and Type | Method and Description |
|---|---|
RxJavaCompletableExecutionHook |
getCompletableExecutionHook()
Retrieves the instance of
RxJavaCompletableExecutionHook to use based on order of precedence as
defined in RxJavaPlugins class header. |
RxJavaErrorHandler |
getErrorHandler()
Retrieves an instance of
RxJavaErrorHandler to use based on order of precedence as defined in
RxJavaPlugins class header. |
static RxJavaPlugins |
getInstance()
Deprecated.
use the static methods of
RxJavaHooks. |
RxJavaObservableExecutionHook |
getObservableExecutionHook()
Retrieves the instance of
RxJavaObservableExecutionHook to use based on order of precedence as
defined in RxJavaPlugins class header. |
RxJavaSchedulersHook |
getSchedulersHook()
Retrieves the instance of
RxJavaSchedulersHook to use based on order of precedence as defined
in the RxJavaPlugins class header. |
RxJavaSingleExecutionHook |
getSingleExecutionHook()
Retrieves the instance of
RxJavaSingleExecutionHook to use based on order of precedence as
defined in RxJavaPlugins class header. |
void |
registerCompletableExecutionHook(RxJavaCompletableExecutionHook impl)
Register an
RxJavaCompletableExecutionHook implementation as a global override of any injected or
default implementations. |
void |
registerErrorHandler(RxJavaErrorHandler impl)
Registers an
RxJavaErrorHandler implementation as a global override of any injected or default
implementations. |
void |
registerObservableExecutionHook(RxJavaObservableExecutionHook impl)
Register an
RxJavaObservableExecutionHook implementation as a global override of any injected or
default implementations. |
void |
registerSchedulersHook(RxJavaSchedulersHook impl)
Registers an
RxJavaSchedulersHook implementation as a global override of any injected or
default implementations. |
void |
registerSingleExecutionHook(RxJavaSingleExecutionHook impl)
Register an
RxJavaSingleExecutionHook implementation as a global override of any injected or
default implementations. |
void |
reset()
Reset
RxJavaPlugins instance |
@Deprecated public static RxJavaPlugins getInstance()
RxJavaHooks.RxJavaPlugins instance.RxJavaPlugins instancepublic void reset()
RxJavaPlugins instance
This API is experimental. Resetting the plugins is dangerous during application runtime and also bad code could invoke it in the middle of an application life-cycle and really break applications if not used cautiously. For more detailed discussions:
public RxJavaErrorHandler getErrorHandler()
RxJavaErrorHandler to use based on order of precedence as defined in
RxJavaPlugins class header.
Override the default by calling registerErrorHandler(RxJavaErrorHandler) or by setting the
property rxjava.plugin.RxJavaErrorHandler.implementation with the full class name to load.
RxJavaErrorHandler implementation to usepublic void registerErrorHandler(RxJavaErrorHandler impl)
RxJavaErrorHandler implementation as a global override of any injected or default
implementations.impl - RxJavaErrorHandler implementationjava.lang.IllegalStateException - if called more than once or after the default was initialized (if usage occurs before trying
to register)public RxJavaObservableExecutionHook getObservableExecutionHook()
RxJavaObservableExecutionHook to use based on order of precedence as
defined in RxJavaPlugins class header.
Override the default by calling registerObservableExecutionHook(RxJavaObservableExecutionHook)
or by setting the property rxjava.plugin.RxJavaObservableExecutionHook.implementation with the
full class name to load.
RxJavaObservableExecutionHook implementation to usepublic void registerObservableExecutionHook(RxJavaObservableExecutionHook impl)
RxJavaObservableExecutionHook implementation as a global override of any injected or
default implementations.impl - RxJavaObservableExecutionHook implementationjava.lang.IllegalStateException - if called more than once or after the default was initialized (if usage occurs before trying
to register)public RxJavaSingleExecutionHook getSingleExecutionHook()
RxJavaSingleExecutionHook to use based on order of precedence as
defined in RxJavaPlugins class header.
Override the default by calling registerSingleExecutionHook(RxJavaSingleExecutionHook)
or by setting the property rxjava.plugin.RxJavaSingleExecutionHook.implementation with the
full class name to load.
RxJavaSingleExecutionHook implementation to usepublic void registerSingleExecutionHook(RxJavaSingleExecutionHook impl)
RxJavaSingleExecutionHook implementation as a global override of any injected or
default implementations.impl - RxJavaSingleExecutionHook implementationjava.lang.IllegalStateException - if called more than once or after the default was initialized (if usage occurs before trying
to register)public RxJavaCompletableExecutionHook getCompletableExecutionHook()
RxJavaCompletableExecutionHook to use based on order of precedence as
defined in RxJavaPlugins class header.
Override the default by calling registerCompletableExecutionHook(RxJavaCompletableExecutionHook)
or by setting the property rxjava.plugin.RxJavaCompletableExecutionHook.implementation with the
full class name to load.
RxJavaCompletableExecutionHook implementation to usepublic void registerCompletableExecutionHook(RxJavaCompletableExecutionHook impl)
RxJavaCompletableExecutionHook implementation as a global override of any injected or
default implementations.impl - RxJavaCompletableExecutionHook implementationjava.lang.IllegalStateException - if called more than once or after the default was initialized (if usage occurs before trying
to register)public RxJavaSchedulersHook getSchedulersHook()
RxJavaSchedulersHook to use based on order of precedence as defined
in the RxJavaPlugins class header.
Override the default by calling registerSchedulersHook(RxJavaSchedulersHook) or by setting
the property rxjava.plugin.RxJavaSchedulersHook.implementation with the full class name to
load.
RxJavaSchedulersHook implementation in usepublic void registerSchedulersHook(RxJavaSchedulersHook impl)
RxJavaSchedulersHook implementation as a global override of any injected or
default implementations.impl - RxJavaSchedulersHook implementationjava.lang.IllegalStateException - if called more than once or after the default was initialized (if usage occurs before trying
to register)