com.amazon.redshift.ds.common

## Class RedshiftObjectFactory

- java.lang.Object
- - com.amazon.redshift.ds.common.RedshiftObjectFactory

All Implemented Interfaces:
  ObjectFactory

Direct Known Subclasses:
  RedshiftXADataSourceFactory

    public class RedshiftObjectFactory
    extends Object
    implements ObjectFactory

Returns a DataSource-ish thing based on a JNDI reference. In the case of a SimpleDataSource or ConnectionPool, a new instance is created each time, as there is no connection state to maintain. In the case of a PoolingDataSource, the same DataSource will be returned for every invocation within the same VM/ClassLoader, so that the state of the connections in the pool will be consistent.

Author:
  Aaron Mulder (ammulder@chariotsolutions.com)

### Constructor Summary

Constructors
Constructor and Description
`RedshiftObjectFactory()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Object` `getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)` Dereferences a Redshift DataSource.
`protected String` `getProperty(Reference ref, String s)`
`protected Object` `loadBaseDataSource(BaseDataSource ds, Reference ref)`

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

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

### Constructor Detail

#### RedshiftObjectFactory

    public RedshiftObjectFactory()

### Method Detail

#### getObjectInstance

    public Object getObjectInstance(Object obj,
                                    Name name,
                                    Context nameCtx,
                                    Hashtable<?,?> environment)
                             throws Exception

Dereferences a Redshift DataSource. Other types of references are ignored.

Specified by:
  `getObjectInstance` in interface `ObjectFactory`
Throws:
  `Exception`

#### loadBaseDataSource

    protected Object loadBaseDataSource(BaseDataSource ds,
                                        Reference ref)

#### getProperty

    protected String getProperty(Reference ref,
                                 String s)