Coverage Report - org.mule.transport.jms.JmsEndpointURIBuilder
 
Classes in this File Line Coverage Branch Coverage Complexity
JmsEndpointURIBuilder
0%
0/14
0%
0/6
0
 
 1  
 /*
 2  
  * $Id: JmsEndpointURIBuilder.java 19191 2010-08-25 21:05:23Z tcarlson $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 package org.mule.transport.jms;
 11  
 
 12  
 import org.mule.endpoint.ResourceNameEndpointURIBuilder;
 13  
 import org.mule.api.endpoint.MalformedEndpointException;
 14  
 
 15  
 import java.util.Properties;
 16  
 import java.net.URI;
 17  
 import java.net.URISyntaxException;
 18  
 
 19  
 /**
 20  
  * TODO
 21  
  */
 22  0
 public class JmsEndpointURIBuilder extends ResourceNameEndpointURIBuilder
 23  
 {
 24  
     @Override
 25  
     protected void setEndpoint(URI uri, Properties props) throws MalformedEndpointException
 26  
     {
 27  0
         super.setEndpoint(uri, props);
 28  
 
 29  0
         String newUri = null;
 30  0
         if (uri.getScheme().equals("topic"))
 31  
         {
 32  0
             props.setProperty(RESOURCE_INFO_PROPERTY, "topic");
 33  0
             newUri = uri.toString().replace("topic://", "jms://");
 34  
         }
 35  0
         else if (uri.getScheme().equals("queue"))
 36  
         {
 37  0
             newUri = uri.toString().replace("queue://", "jms://");
 38  
         }
 39  
 
 40  
         try
 41  
         {
 42  0
             if (newUri != null)
 43  
             {
 44  0
                 rewriteURI(new URI(newUri));
 45  
             }
 46  
         }
 47  0
         catch (URISyntaxException e)
 48  
         {
 49  0
             throw new MalformedEndpointException(e);
 50  0
         }
 51  
 
 52  0
     }
 53  
 }