DataSourceBasedMultiTenantConnectionProviderImpl (Hibernate JavaDocs)
Date: 2012-04-05

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hibernate.service.jdbc.connections.spi
Class DataSourceBasedMultiTenantConnectionProviderImpl

    java.lang.Object
      org.hibernate.service.jdbc.connections.spi.AbstractDataSourceBasedMultiTenantConnectionProviderImpl
          org.hibernate.service.jdbc.connections.spi.DataSourceBasedMultiTenantConnectionProviderImpl

All Implemented Interfaces:
  Serializable, MultiTenantConnectionProvider, Service, ServiceRegistryAwareService, Stoppable, Wrapped

    public class DataSourceBasedMultiTenantConnectionProviderImpl

extends AbstractDataSourceBasedMultiTenantConnectionProviderImpl
implements ServiceRegistryAwareService, Stoppable

A concrete implementation of the `MultiTenantConnectionProvider` contract bases on a number of reasonable assumptions. We assume that:

- The `DataSource` instances are all available from JNDI named by the tenant identifier relative to a single base JNDI context
- `AvailableSettings.DATASOURCE` is a string naming either the any data source or the base JNDI context. If the latter, `TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY` must also be set.

See Also:
  Serialized Form

Field Summary
`static String` | `TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY`

Constructor Summary
`DataSourceBasedMultiTenantConnectionProviderImpl()`

Method Summary
`void` | `injectServices(ServiceRegistryImplementor serviceRegistry)` Callback to inject the registry.
`protected DataSource` | `selectAnyDataSource()`
`protected DataSource` | `selectDataSource(String tenantIdentifier)`
`void` | `stop()` Stop phase notification

Methods inherited from class org.hibernate.service.jdbc.connections.spi.AbstractDataSourceBasedMultiTenantConnectionProviderImpl
`getAnyConnection, getConnection, isUnwrappableAs, releaseAnyConnection, releaseConnection, supportsAggressiveRelease, unwrap`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY

    public static final String TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY

See Also:
  Constant Field Values

Constructor Detail

### DataSourceBasedMultiTenantConnectionProviderImpl

    public DataSourceBasedMultiTenantConnectionProviderImpl()

Method Detail

### selectAnyDataSource

    protected DataSource selectAnyDataSource()

  Specified by:
    `selectAnyDataSource` in class `AbstractDataSourceBasedMultiTenantConnectionProviderImpl`

### selectDataSource

    protected DataSource selectDataSource(String tenantIdentifier)

  Specified by:
    `selectDataSource` in class `AbstractDataSourceBasedMultiTenantConnectionProviderImpl`

### injectServices

    public void injectServices(ServiceRegistryImplementor serviceRegistry)

  Description copied from interface: `ServiceRegistryAwareService`
  Callback to inject the registry.

  Specified by:
    `injectServices` in interface `ServiceRegistryAwareService`
  Parameters:
    `serviceRegistry` - The registry

### stop

    public void stop()

  Description copied from interface: `Stoppable`
  Stop phase notification

  Specified by:
    `stop` in interface `Stoppable`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.