private Object getDestinationName ( String destinationType , Object destination ) throws Exception { String methodName ; if ( "javax.jms.Queue" . equals ( destinationType ) ) methodName = "getQueueName" ; else if ( "javax.jms.Topic" . equals ( destinationType ) ) methodName = "getTopicName" ; else throw new InvalidPropertyException ( "destinationType: " + destinationType ) ; try { return destination . getClass ( ) . getMethod ( methodName ) . invoke ( destination ) ; } catch ( NoSuchMethodException x ) { throw new InvalidPropertyException ( Tr . formatMessage ( tc , "J2CA8505.destination.type.mismatch" , destination , destinationType ) , x ) ; } }
Returns the name of the queue or topic .