org.eclipse.incquery.runtime.extensibility

## Class QueryBackendRegistry

- java.lang.Object
- - org.eclipse.incquery.runtime.extensibility.QueryBackendRegistry

-     public class QueryBackendRegistry
      extends java.lang.Object

  A registry component for storing all known query backend factories.
  Since:
    0.9
  Author:
    Zoltan Ujhelyi

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Iterable<java.util.Map.Entry<java.lang.Class<? extends IQueryBackend>,IQueryBackendFactory>>` | `getAllKnownFactories()` Returns all known factory instances in an iterable object
    `java.lang.Class<? extends IQueryBackend>` | `getDefaultBackendClass()`
    `java.lang.Class<? extends IQueryBackend>` | `getDefaultCachingBackendClass()`
    `IQueryBackendFactory` | `getFactory(java.lang.Class<? extends IQueryBackend> backend)` Returns a factory for the selected backend class.
    `static QueryBackendRegistry` | `getInstance()` Returns the singleton instanceof of the backend registry
    `void` | `registerQueryBackendFactory(java.lang.Class<? extends IQueryBackend> backend, IQueryBackendFactory factory)` Registers a factory instance for a backend class.
    `void` | `registerQueryBackendFactoryUnchecked(java.lang.Class<? extends IQueryBackend> backend, IQueryBackendFactory factory)` Registers a factory instance for a backend class if no class is already registered

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getInstance

          public static QueryBackendRegistry getInstance()

      Returns the singleton instanceof of the backend registry

    - #### getDefaultBackendClass

          public java.lang.Class<? extends IQueryBackend> getDefaultBackendClass()

      Returns:
        the default backend

    - #### getDefaultCachingBackendClass

          public java.lang.Class<? extends IQueryBackend> getDefaultCachingBackendClass()

      Returns:
        the default caching backend, if a caching backend is explicitly requested

    - #### registerQueryBackendFactory

          public void registerQueryBackendFactory(java.lang.Class<? extends IQueryBackend> backend,
                                                  IQueryBackendFactory factory)

      Registers a factory instance for a backend class.
      Throws:
        `java.lang.IllegalStateException` - if a factory is already registered for the selected backend

    - #### registerQueryBackendFactoryUnchecked

          public void registerQueryBackendFactoryUnchecked(java.lang.Class<? extends IQueryBackend> backend,
                                                           IQueryBackendFactory factory)

      Registers a factory instance for a backend class if no class is already registered
      Throws:
        `java.lang.IllegalStateException` - if a factory is already registered for the selected backend
      Since:
        1.0

    - #### getFactory

          public IQueryBackendFactory getFactory(java.lang.Class<? extends IQueryBackend> backend)

      Returns a factory for the selected backend class. If no factories are available for the selected backend, an exception is thrown.
      Parameters:
        `backend` -
      Throws:
        `java.lang.IllegalStateException` - if no corresponding backend is registered into the factory

    - #### getAllKnownFactories

          public java.lang.Iterable<java.util.Map.Entry<java.lang.Class<? extends IQueryBackend>,IQueryBackendFactory>> getAllKnownFactories()

      Returns all known factory instances in an iterable object