1 22 package org.jboss.mq.referenceable; 23 24 import org.jboss.logging.Logger; 25 26 34 public class SpyDestinationObjectFactory implements javax.naming.spi.ObjectFactory { 35 36 static Logger cat = Logger.getLogger( SpyDestinationObjectFactory.class ); 37 38 41 public SpyDestinationObjectFactory() { 42 super(); 43 } 44 45 55 public java.lang.Object getObjectInstance( java.lang.Object reference, javax.naming.Name name, javax.naming.Context contex, java.util.Hashtable properties ) 56 throws java.lang.Exception { 57 58 cat.debug( "SpyDestinationObjectFactory->getObjectInstance()" ); 59 60 try { 61 62 javax.naming.Reference ref = ( javax.naming.Reference )reference; 63 if ( ref.getClassName().equals( "org.jboss.mq.SpyTopic" ) ) { 64 65 String dest = ( String )ref.get( "name" ).getContent(); 66 return new org.jboss.mq.SpyTopic( dest ); 67 } else if ( ref.getClassName().equals( "org.jboss.mq.SpyQueue" ) ) { 68 69 String dest = ( String )ref.get( "name" ).getContent(); 70 return new org.jboss.mq.SpyQueue( dest ); 71 } 72 } catch ( RuntimeException ignore ) { 73 } catch ( Exception ignore ) { 74 } 78 return null; 79 } 80 } 81 | Popular Tags |