CoreModule (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.configuration.runtime, class: CoreModule

# Class CoreModule

java.lang.Object
org.apache.cayenne.configuration.runtime.CoreModule

All Implemented Interfaces:
  `Module`

public class CoreModule extends Object implements Module
A DI module containing all Cayenne runtime configuration.

Since:
  3.1 introduced, 5.0 renamed from ServerModule

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CoreModule()`
  Creates a new `CoreModule`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `configure(Binder binder)`
  `static ListBuilder<DbAdapterDetector>`
  `contributeAdapterDetectors(Binder binder)`
  Deprecated.
  in favor of `extend(Binder)` API
  `static ListBuilder<ExtendedType>`
  `contributeDefaultTypes(Binder binder)`
  Deprecated.
  in favor of `extend(Binder)` API
  `static ListBuilder<Object>`
  `contributeDomainListeners(Binder binder)`
  Deprecated.
  in favor of `extend(Binder)` API
  `static ListBuilder<DataChannelQueryFilter>`
  `contributeDomainQueryFilters(Binder binder)`
  Deprecated.
  in favor of `extend(Binder)` API
  `static ListBuilder<DataChannelSyncFilter>`
  `contributeDomainSyncFilters(Binder binder)`
  Deprecated.
  in favor of `extend(Binder)` API
  `static MapBuilder<PkGenerator>`
  `contributePkGenerators(Binder binder)`
  Deprecated.
  in favor of `extend(Binder)` API
  `static ListBuilder<String>`
  `contributeProjectLocations(Binder binder)`
  Deprecated.
  in favor of `extend(Binder)` API
  `static MapBuilder<String>`
  `contributeProperties(Binder binder)`
  Deprecated.
  in favor of `extend(Binder)` API
  `static ListBuilder<ExtendedTypeFactory>`
  `contributeTypeFactories(Binder binder)`
  Deprecated.
  in favor of `extend(Binder)` API
  `static ListBuilder<ExtendedType>`
  `contributeUserTypes(Binder binder)`
  Deprecated.
  in favor of `extend(Binder)` API
  `static ListBuilder<ValueObjectType>`
  `contributeValueObjectTypes(Binder binder)`
  Deprecated.
  in favor of `extend(Binder)` API
  `static CoreModuleExtender`
  `extend(Binder b)`
  Returns an extender object that allows the app to customize the CoreModule services.
  `static void`
  `setSnapshotCacheSize(Binder binder, int size)`
  Deprecated.
  in favor of `extend(Binder)` API
  `static void`
  `useExternalTransactions(Binder binder, boolean useExternal)`
  Deprecated.
  in favor of `extend(Binder)` API

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### CoreModule

    public CoreModule()
    Creates a new `CoreModule`.
    Since:
      4.0

- ## Method Details

  - ### extend

    public static CoreModuleExtender extend(Binder b)
    Returns an extender object that allows the app to customize the CoreModule services.
    Since:
      5.0

  - ### useExternalTransactions

    @Deprecated(since="5.0") public static void useExternalTransactions(Binder binder, boolean useExternal)
    Deprecated.
    in favor of `extend(Binder)` API
    Sets transaction management to either external or internal transactions. Default is internally-managed transactions.
    Parameters:
      `binder` - DI binder passed to the module during injector startup.
      `useExternal` - whether external (true) or internal (false) transaction management should be used.
    Since:
      4.0

  - ### setSnapshotCacheSize

    @Deprecated(since="5.0") public static void setSnapshotCacheSize(Binder binder, int size)
    Deprecated.
    in favor of `extend(Binder)` API
    Sets max size of snapshot cache, in pre 4.0 version this was set in the Modeler.
    Parameters:
      `binder` - DI binder passed to the module during injector startup.
      `size` - max size of snapshot cache
    Since:
      4.0

  - ### contributeProjectLocations

    @Deprecated(since="5.0") public static ListBuilder<String> contributeProjectLocations(Binder binder)
    Deprecated.
    in favor of `extend(Binder)` API
    Provides access to a DI collection builder for String locations that allows downstream modules to "contribute" their own Cayenne project locations.
    Parameters:
      `binder` - DI binder passed to the module during injector startup.
    Returns:
      ListBuilder for String locations.

  - ### contributeDomainQueryFilters

    @Deprecated(since="5.0") public static ListBuilder<DataChannelQueryFilter> contributeDomainQueryFilters(Binder binder)
    Deprecated.
    in favor of `extend(Binder)` API
    Provides access to a DI collection builder for `DataChannelQueryFilter`'s that allows downstream modules to "contribute" their own DataDomain query filters
    Parameters:
      `binder` - DI binder passed to the module during injector startup.
    Returns:
      ListBuilder for DataChannelQueryFilter.
    Since:
      4.1

  - ### contributeDomainSyncFilters

    @Deprecated(since="5.0") public static ListBuilder<DataChannelSyncFilter> contributeDomainSyncFilters(Binder binder)
    Deprecated.
    in favor of `extend(Binder)` API
    Provides access to a DI collection builder for `DataChannelSyncFilter`'s that allows downstream modules to "contribute" their own DataDomain sync filters
    Parameters:
      `binder` - DI binder passed to the module during injector startup.
    Returns:
      ListBuilder for DataChannelSyncFilter.
    Since:
      4.1

  - ### contributeDomainListeners

    @Deprecated(since="5.0") public static ListBuilder<Object> contributeDomainListeners(Binder binder)
    Deprecated.
    in favor of `extend(Binder)` API
    Provides access to a DI collection builder for lifecycle events listeners.
    Parameters:
      `binder` - DI binder passed to the module during injector startup.
    Returns:
      ListBuilder for listener Objects.
    Since:
      4.0

  - ### contributeAdapterDetectors

    @Deprecated(since="5.0") public static ListBuilder<DbAdapterDetector> contributeAdapterDetectors(Binder binder)
    Deprecated.
    in favor of `extend(Binder)` API
    Provides access to a DI collection builder for `DbAdapterDetector`'s that allows downstream modules to "contribute" their own adapter detectors.
    Parameters:
      `binder` - DI binder passed to the module during injector startup.
    Returns:
      ListBuilder for DbAdapterDetectors.
    Since:
      4.0

  - ### contributePkGenerators

    @Deprecated(since="5.0") public static MapBuilder<PkGenerator> contributePkGenerators(Binder binder)
    Deprecated.
    in favor of `extend(Binder)` API
    Provides access to a DI map builder for `PkGenerator`'s that allows downstream modules to "contribute" their own pk generators.
    Parameters:
      `binder` - DI binder passed to the module during injector startup.
    Returns:
      MapBuilder for properties.
    Since:
      4.1

  - ### contributeProperties

    @Deprecated(since="5.0") public static MapBuilder<String> contributeProperties(Binder binder)
    Deprecated.
    in favor of `extend(Binder)` API
    Provides access to a DI map builder for runtime properties that allows downstream modules to "contribute" their own properties.
    Parameters:
      `binder` - DI binder passed to the module during injector startup.
    Returns:
      MapBuilder for properties.
    Since:
      4.0

  - ### contributeTypeFactories

    @Deprecated(since="5.0") public static ListBuilder<ExtendedTypeFactory> contributeTypeFactories(Binder binder)
    Deprecated.
    in favor of `extend(Binder)` API
    Provides access to a DI collection builder for `ExtendedTypeFactory`'s that allows downstream modules to "contribute" their own factories.
    Parameters:
      `binder` - DI binder passed to the module during injector startup.
    Returns:
      ListBuilder for ExtendedTypes.
    Since:
      4.0

  - ### contributeDefaultTypes

    @Deprecated(since="5.0") public static ListBuilder<ExtendedType> contributeDefaultTypes(Binder binder)
    Deprecated.
    in favor of `extend(Binder)` API
    Provides access to a DI collection builder for default adapter-agnostic `ExtendedType`'s that allows downstream modules to "contribute" their own types. "Default" types are loaded before adapter-provided or "user" types, so they may be overridden by those.
    Parameters:
      `binder` - DI binder passed to the module during injector startup.
    Returns:
      ListBuilder for ExtendedTypes.
    Since:
      4.0

  - ### contributeUserTypes

    @Deprecated(since="5.0") public static ListBuilder<ExtendedType> contributeUserTypes(Binder binder)
    Deprecated.
    in favor of `extend(Binder)` API
    Provides access to a DI collection builder for `ExtendedType`'s that allows downstream modules to "contribute" their own types. Unlike "default" types, "user" types are loaded after the adapter-provided types and can override those.
    Parameters:
      `binder` - DI binder passed to the module during injector startup.
    Returns:
      ListBuilder for ExtendedTypes.
    Since:
      4.0

  - ### contributeValueObjectTypes

    @Deprecated(since="5.0") public static ListBuilder<ValueObjectType> contributeValueObjectTypes(Binder binder)
    Deprecated.
    in favor of `extend(Binder)` API
    Parameters:
      `binder` - DI binder passed to module during injector startup
    Returns:
      ListBuilder for user-contributed ValueObjectTypes
    Since:
      4.0

  - ### configure

    public void configure(Binder binder)
    Specified by:
      `configure` in interface `Module`