public Object getObjectInstance(Object reference,
Name name,
Context contex,
Hashtable properties) throws Exception {
boolean debug = cat.isDebugEnabled();
if (debug)
cat.debug( "Extracting SpyConnectionFactory from reference" );
try {
javax.naming.Reference ref = ( javax.naming.Reference )reference;
GenericConnectionFactory dcf = ( GenericConnectionFactory )
ObjectRefAddr.extractObjectRefFrom( ref, "DCF" );
if (debug)
cat.debug("The GenericConnectionFactory is: "+dcf);
if ( ref.getClassName().equals( "org.jboss.mq.SpyConnectionFactory" ) ) {
return new org.jboss.mq.SpyConnectionFactory( dcf );
} else if ( ref.getClassName().equals( "org.jboss.mq.SpyXAConnectionFactory" ) ) {
return new org.jboss.mq.SpyXAConnectionFactory( dcf );
}
} catch ( Throwable ignore ) {
ignore.printStackTrace();
// This method should not throw an exception since
// It would prevent another ObjectFactory from attempting
// to create an instance of the object.
}
return null;
}
getObjectInstance method. |