RxJava



rx.plugins
Class RxJavaPlugins

java.lang.Object
  extended by rx.plugins.RxJavaPlugins

public class RxJavaPlugins
extends java.lang.Object

Registry for plugin implementations that allows global override and handles the retrieval of correct implementation based on order of precedence:

  1. plugin registered globally via register methods in this class
  2. plugin registered and retrieved using System.getProperty(String) (see get methods for property names)
  3. default implementation
See the RxJava GitHub Wiki for more information: https://github.com/Netflix/RxJava/wiki/Plugins.


Method Summary
 RxJavaErrorHandler getErrorHandler()
          Retrieve instance of RxJavaErrorHandler to use based on order of precedence as defined in RxJavaPlugins class header.
static RxJavaPlugins getInstance()
           
 RxJavaObservableExecutionHook getObservableExecutionHook()
          Retrieve instance of RxJavaObservableExecutionHook to use based on order of precedence as defined in RxJavaPlugins class header.
 void registerErrorHandler(RxJavaErrorHandler impl)
          Register a RxJavaErrorHandler implementation as a global override of any injected or default implementations.
 void registerObservableExecutionHook(RxJavaObservableExecutionHook impl)
          Register a RxJavaObservableExecutionHook implementation as a global override of any injected or default implementations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RxJavaPlugins getInstance()

getErrorHandler

public RxJavaErrorHandler getErrorHandler()
Retrieve instance of RxJavaErrorHandler to use based on order of precedence as defined in RxJavaPlugins class header.

Override default by using RxJavaPlugins.registerErrorHandler(RxJavaErrorHandler) or setting property: rxjava.plugin.RxJavaErrorHandler.implementation with the full classname to load.

Returns:
RxJavaErrorHandler implementation to use

registerErrorHandler

public void registerErrorHandler(RxJavaErrorHandler impl)
Register a RxJavaErrorHandler implementation as a global override of any injected or default implementations.

Parameters:
impl - RxJavaErrorHandler implementation
Throws:
java.lang.IllegalStateException - if called more than once or after the default was initialized (if usage occurs before trying to register)

getObservableExecutionHook

public RxJavaObservableExecutionHook getObservableExecutionHook()
Retrieve instance of RxJavaObservableExecutionHook to use based on order of precedence as defined in RxJavaPlugins class header.

Override default by using RxJavaPlugins.registerObservableExecutionHook(RxJavaObservableExecutionHook) or setting property: rxjava.plugin.RxJavaObservableExecutionHook.implementation with the full classname to load.

Returns:
RxJavaObservableExecutionHook implementation to use

registerObservableExecutionHook

public void registerObservableExecutionHook(RxJavaObservableExecutionHook impl)
Register a RxJavaObservableExecutionHook implementation as a global override of any injected or default implementations.

Parameters:
impl - RxJavaObservableExecutionHook implementation
Throws:
java.lang.IllegalStateException - if called more than once or after the default was initialized (if usage occurs before trying to register)