org.apache.cayenne.configuration.osgi

## Class OsgiModuleBuilder

- java.lang.Object
- - org.apache.cayenne.configuration.osgi.OsgiModuleBuilder

-     public class OsgiModuleBuilder
      extends Object

  A builder of a DI module that helps to bootstrap Cayenne in OSGi environment.
  Since:
    4.0

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static OsgiModuleBuilder` | `forProject(Class<?> typeFromProjectBundle)`
    `Module` | `module()`
    `OsgiModuleBuilder` | `withDriver(Class<? extends Driver> driverType)` Registers a JDBC driver class used by Cayenne.
    `OsgiModuleBuilder` | `withType(Class<?> type)` Registers an arbitrary Java class.
    `OsgiModuleBuilder` | `withTypes(Class<?>... types)` Registers an arbitrary Java class.

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

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

- - ### Method Detail

    - #### forProject

          public static OsgiModuleBuilder forProject(Class<?> typeFromProjectBundle)

    - #### withDriver

          public OsgiModuleBuilder withDriver(Class<? extends Driver> driverType)

      Registers a JDBC driver class used by Cayenne. This is an optional piece of information used by Cayenne to find JDBC driver in case of Cayenne managed DataSource. E.g. don't use this when you are using a JNDI DataSource.

    - #### withType

          public OsgiModuleBuilder withType(Class<?> type)

      Registers an arbitrary Java class. If Cayenne tries to load it via reflection later on, it will be using ClassLoader attached to the class passed to this method.

    - #### withTypes

          public OsgiModuleBuilder withTypes(Class<?>... types)

      Registers an arbitrary Java class. If Cayenne tries to load it via reflection later on, it will be using ClassLoader attached to the class passed to this method.

    - #### module

          public Module module()

Copyright © 2001–2018 Apache Cayenne. All rights reserved.