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.apache.openjpa.slice.jdbc
Class DistributedDataSource

    java.lang.Object
      org.apache.openjpa.lib.jdbc.DelegatingDataSource
          org.apache.openjpa.lib.jdbc.DecoratingDataSource
              org.apache.openjpa.slice.jdbc.DistributedDataSource

All Implemented Interfaces:
  Iterable<DataSource>, Wrapper, CommonDataSource, DataSource, Closeable

    public class DistributedDataSource

extends DecoratingDataSource
implements Iterable<DataSource>

A virtual datasource that contains many physical datasources.

Author:
  Pinaki Poddar

Constructor Summary
`DistributedDataSource(List<DataSource> dataSources)`

Method Summary
`void` | `addDataSource(DataSource ds)`
`Connection` | `getConnection()`
`(package private) Connection` | `getConnection(DataSource ds)`
`(package private) Connection` | `getConnection(DataSource ds, String user, String pwd)`
`Connection` | `getConnection(String username, String password)`
`int` | `getLoginTimeout()`
`PrintWriter` | `getLogWriter()`
`Logger` | `getParentLogger()`
`Iterator<DataSource>` | `iterator()`
`void` | `setLoginTimeout(int seconds)`
`void` | `setLogWriter(PrintWriter out)`

Methods inherited from class org.apache.openjpa.lib.jdbc.DecoratingDataSource
`addDecorator, addDecorators, clearDecorators, getDecorators, removeDecorator`

Methods inherited from class org.apache.openjpa.lib.jdbc.DelegatingDataSource
`appendInfo, close, equals, getDelegate, getInnermostDelegate, hashCode, isWrapperFor, toString, unwrap`

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

Constructor Detail

### DistributedDataSource

    public DistributedDataSource(List<DataSource> dataSources)

Method Detail

### addDataSource

    public void addDataSource(DataSource ds)

### getConnection

    Connection getConnection(DataSource ds)
                       throws SQLException

  Throws:
    `SQLException`

### getConnection

    Connection getConnection(DataSource ds,
                             String user,
                             String pwd)
                       throws SQLException

  Throws:
    `SQLException`

### iterator

    public Iterator<DataSource> iterator()

  Specified by:
    `iterator` in interface `Iterable<DataSource>`

### getConnection

    public Connection getConnection()
                             throws SQLException

  Specified by:
    `getConnection` in interface `DataSource`
  Overrides:
    `getConnection` in class `DecoratingDataSource`
  Throws:
    `SQLException`

### getConnection

    public Connection getConnection(String username,
                                    String password)
                             throws SQLException

  Specified by:
    `getConnection` in interface `DataSource`
  Overrides:
    `getConnection` in class `DecoratingDataSource`
  Throws:
    `SQLException`

### getLogWriter

    public PrintWriter getLogWriter()
                             throws SQLException

  Specified by:
    `getLogWriter` in interface `CommonDataSource`
  Overrides:
    `getLogWriter` in class `DelegatingDataSource`
  Throws:
    `SQLException`

### getLoginTimeout

    public int getLoginTimeout()
                        throws SQLException

  Specified by:
    `getLoginTimeout` in interface `CommonDataSource`
  Overrides:
    `getLoginTimeout` in class `DelegatingDataSource`
  Throws:
    `SQLException`

### setLogWriter

    public void setLogWriter(PrintWriter out)
                      throws SQLException

  Specified by:
    `setLogWriter` in interface `CommonDataSource`
  Overrides:
    `setLogWriter` in class `DelegatingDataSource`
  Throws:
    `SQLException`

### setLoginTimeout

    public void setLoginTimeout(int seconds)
                         throws SQLException

  Specified by:
    `setLoginTimeout` in interface `CommonDataSource`
  Overrides:
    `setLoginTimeout` in class `DelegatingDataSource`
  Throws:
    `SQLException`

### getParentLogger

    public Logger getParentLogger()
                           throws SQLFeatureNotSupportedException

  Overrides:
    `getParentLogger` in class `DelegatingDataSource`
  Throws:
    `SQLFeatureNotSupportedException`

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 © 2006-2013 Apache Software Foundation. All Rights Reserved.