Apache Tomcat 6.0.51

## org.apache.naming.factory
Class DataSourceLinkFactory

    java.lang.Object
      org.apache.naming.factory.ResourceLinkFactory
          org.apache.naming.factory.DataSourceLinkFactory

All Implemented Interfaces:
  javax.naming.spi.ObjectFactory

    public class DataSourceLinkFactory

extends ResourceLinkFactory

Object factory for resource links for shared data sources.

Author:
  Filip Hanik

Nested Class Summary
`static class` | `DataSourceLinkFactory.DataSourceHandler` Simple wrapper class that will allow a user to configure a ResourceLink for a data source so that when `DataSource.getConnection()` is called, it will invoke `DataSource.getConnection(String, String)` with the preconfigured username and password.

Constructor Summary
`DataSourceLinkFactory()`

Method Summary
`java.lang.Object` | `getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable environment)` Create a new DataSource instance.
`static void` | `setGlobalContext(javax.naming.Context newGlobalContext)`
`protected java.lang.Object` | `wrapDataSource(java.lang.Object datasource, java.lang.String username, java.lang.String password)`

Methods inherited from class org.apache.naming.factory.ResourceLinkFactory
`deregisterGlobalResourceAccess, deregisterGlobalResourceAccess, registerGlobalResourceAccess`

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

Constructor Detail

### DataSourceLinkFactory

    public DataSourceLinkFactory()

Method Detail

### setGlobalContext

    public static void setGlobalContext(javax.naming.Context newGlobalContext)

### getObjectInstance

    public java.lang.Object getObjectInstance(java.lang.Object obj,
                                              javax.naming.Name name,
                                              javax.naming.Context nameCtx,
                                              java.util.Hashtable environment)
                                       throws javax.naming.NamingException

  Create a new DataSource instance.

  Specified by:
    `getObjectInstance` in interface `javax.naming.spi.ObjectFactory`
  Overrides:
    `getObjectInstance` in class `ResourceLinkFactory`
  Parameters:
    `obj` - The reference object describing the DataSource
  Throws:
    `javax.naming.NamingException`

### wrapDataSource

    protected java.lang.Object wrapDataSource(java.lang.Object datasource,
                                              java.lang.String username,
                                              java.lang.String password)
                                       throws javax.naming.NamingException

  Throws:
    `javax.naming.NamingException`

Apache Tomcat 6.0.51

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.