public class RxJavaPlugins extends Object
register methods in this classSystem.getProperty(String) (see get methods for property names)In addition to the rxjava.plugin.[simple classname].implementation system properties, you can define two system property:
rxjava.plugin.[index].class}
rxjava.plugin.[index].impl}
Where the
.class property contains the simple classname 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 chosing. 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 |
|---|---|
RxJavaErrorHandler |
getErrorHandler()
Retrieves an instance of
RxJavaErrorHandler to use based on order of precedence as defined in
RxJavaPlugins class header.
|
static RxJavaPlugins |
getInstance()
Retrieves the single
RxJavaPlugins instance.
|
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.
|
void |
registerErrorHandler(RxJavaErrorHandler
Registers an
RxJavaErrorHandler implementation as a global override of any injected or default implementations.
|
void |
registerObservableExecutionHook(RxJavaObservableExecutionHook
Register an
RxJavaObservableExecutionHook implementation as a global override of any injected or default implementations.
|
void |
registerSchedulersHook(RxJavaSchedulersHook
Registers an
RxJavaSchedulersHook implementation as a global override of any injected or default implementations.
|
public static RxJavaPluginsgetInstance()
RxJavaPlugins instance.
RxJavaPlugins instance
public RxJavaErrorHandlergetErrorHandler()
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 classname to load.
RxJavaErrorHandler implementation to use
public void registerErrorHandler(RxJavaErrorHandlerimpl)
RxJavaErrorHandler implementation as a global override of any injected or default implementations.
impl -
RxJavaErrorHandler implementation
IllegalStateException - if called more than once or after the default was initialized (if usage occurs before trying to register)
public RxJavaObservableExecutionHookgetObservableExecutionHook()
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 classname to load.
RxJavaObservableExecutionHook implementation to use
public void registerObservableExecutionHook(RxJavaObservableExecutionHookimpl)
RxJavaObservableExecutionHook implementation as a global override of any injected or default implementations.
impl -
RxJavaObservableExecutionHook implementation
IllegalStateException - if called more than once or after the default was initialized (if usage occurs before trying to register)
public RxJavaSchedulersHookgetSchedulersHook()
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 classname to load.
RxJavaSchedulersHook implementation in use
public void registerSchedulersHook(RxJavaSchedulersHookimpl)
RxJavaSchedulersHook implementation as a global override of any injected or default implementations.
impl -
RxJavaSchedulersHook implementation
IllegalStateException - if called more than once or after the default was initialized (if usage occurs before trying to register)