class WebsphereMQProvider implements JmsProvider {

  @Override public Destination getDestination( JmsDelegate meta,
                                               VariableSpace variableSpace ) {
    checkNotNull( meta.destinationName, getString( JmsConstants.PKG, "JmsWebsphereMQ.DestinationNameRequired" ) );
    try {
      String destName = variableSpace.environmentSubstitute( meta.destinationName );
      return isQueue( meta, variableSpace )
        ? new MQQueue( destName )
        : new MQTopic( destName );
    } catch ( JMSException e ) {
      throw new RuntimeException( e );
    }
  }

}