1 10 11 package org.mule.impl.endpoint; 12 13 import org.mule.umo.endpoint.MalformedEndpointException; 14 15 import java.net.URI ; 16 import java.util.Properties ; 17 18 25 public class SocketEndpointBuilder extends AbstractEndpointBuilder 26 { 27 protected void setEndpoint(URI uri, Properties props) throws MalformedEndpointException 28 { 29 if (uri.getPort() == -1) 31 { 32 try 34 { 35 int port = Integer.parseInt(uri.getHost()); 36 this.address = uri.getScheme() + "://localhost:" + port; 37 } 38 catch (NumberFormatException e) 39 { 40 } 42 } 43 44 if (address == null) 45 { 46 this.address = uri.getScheme() + "://" + uri.getHost(); 47 if (uri.getPort() != -1) 48 { 49 this.address += ":" + uri.getPort(); 50 } 51 } 52 } 53 } 54 | Popular Tags |