net.ttddyy.dsproxy.support.jndi
Class JndiProxyDataSourceFactory

java.lang.Object
  extended by net.ttddyy.dsproxy.support.jndi.JndiProxyDataSourceFactory
All Implemented Interfaces:
ObjectFactory

public class JndiProxyDataSourceFactory
extends Object
implements ObjectFactory

Implements the javax.naming ObjectFactory required to support proxied datasources correctly.

Version:
1.0
Author:
Juergen, 2010-03-15

Field Summary
protected  ObjectFactory parentFactory
           
 
Constructor Summary
JndiProxyDataSourceFactory()
           
 
Method Summary
static Reference createReference(JndiProxyDataSource jndiProxyDataSource)
          Creates a reference that can re-construct the proxied datasource.
 Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentFactory

protected ObjectFactory parentFactory
Constructor Detail

JndiProxyDataSourceFactory

public JndiProxyDataSourceFactory()
Method Detail

createReference

public static Reference createReference(JndiProxyDataSource jndiProxyDataSource)
                                 throws NamingException
Creates a reference that can re-construct the proxied datasource.

Parameters:
jndiProxyDataSource - The datasource to reference.
Returns:
a reference that can re-construct the proxied datasource.
Throws:
NamingException - In case of the parten reference failed to get created.

getObjectInstance

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

Specified by:
getObjectInstance in interface ObjectFactory
Throws:
Exception


Copyright © 2012. All Rights Reserved.