1
2
3
4
5
6
7
8
9
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
19
20
21
22 public class SocketEndpointBuilder extends AbstractEndpointBuilder
23 {
24 protected void setEndpoint(URI uri, Properties props) throws MalformedEndpointException
25 {
26
27 if (uri.getPort() == -1)
28 {
29
30 try
31 {
32 int port = Integer.parseInt(uri.getHost());
33 this.address = uri.getScheme() + "://localhost:" + port;
34 }
35 catch (NumberFormatException e)
36 {
37
38 }
39 }
40
41 if (address == null)
42 {
43 this.address = uri.getScheme() + "://" + uri.getHost();
44 if (uri.getPort() != -1)
45 {
46 this.address += ":" + uri.getPort();
47 }
48 }
49 }
50 }