user manual

Chapter 27: Using VisiConnect 329
Other Considerations
if ( value != null )
{
ref.add( new javax.naming.StringRefAddr(
"connectionmanager-class", value ) );
}
}
return ref;
}
// ...
}
Then implement the associated object factory class, in this case:
com.shme.shmeAdapter.GoodCFObjectFactory
package com.shme.shmeAdapter;
import javax.naming.spi.*;
import javax.resource.spi.*;
public class GoodCFObjectFactory implements ObjectFactory {
public GoodCFObjectFactory() {};
public Object getObjectInstance( Object obj,
javax.naming.Name name,
javax.naming.Context context,
java.util.Hashtable env )
throws Exception
{
if ( !( obj instanceof javinstance ofReference ) )
{
return null;
}
javax.naming.Reference ref = (javax.naming.Reference)obj;
if ( ref.getClassName().equals(
"com.shme.shmeAdapter.GoodConnectionFactory" ) )
{
ManagedConnectionFactory refMcf = null;
ConnectionManager refCm = null;
if ( ref.get( "managedconnectionfactory-class" ) != null )
{
String managedCxFactoryStr =
(String)ref.get( "managedconnectionfactory-class" ).getContent();
Class mcfClass = Class.forName( managedCxFactoryStr );
refMcf = (ManagedConnectionFactory)mcfClass.newInstance();
}
if ( ref.get( "connectionmanager-class" ) != null )