package org.jboss.mq.referenceable;
import org.jboss.logging.Logger;
public class SpyDestinationObjectFactory implements javax.naming.spi.ObjectFactory {
static Logger cat = Logger.getLogger( SpyDestinationObjectFactory.class );
public SpyDestinationObjectFactory() {
super();
}
public java.lang.Object getObjectInstance( java.lang.Object reference, javax.naming.Name name, javax.naming.Context contex, java.util.Hashtable properties )
throws java.lang.Exception {
cat.debug( "SpyDestinationObjectFactory->getObjectInstance()" );
try {
javax.naming.Reference ref = ( javax.naming.Reference )reference;
if ( ref.getClassName().equals( "org.jboss.mq.SpyTopic" ) ) {
String dest = ( String )ref.get( "name" ).getContent();
return new org.jboss.mq.SpyTopic( dest );
} else if ( ref.getClassName().equals( "org.jboss.mq.SpyQueue" ) ) {
String dest = ( String )ref.get( "name" ).getContent();
return new org.jboss.mq.SpyQueue( dest );
}
} catch ( RuntimeException ignore ) {
} catch ( Exception ignore ) {
}
return null;
}
}