1
2
3
4
5
6
7
8
9
10
11 package org.mule.providers.jdbc;
12
13 import org.mule.impl.endpoint.AbstractEndpointBuilder;
14 import org.mule.umo.endpoint.MalformedEndpointException;
15
16 import java.net.URI;
17 import java.util.Properties;
18
19
20
21
22 public class JdbcEndpointBuilder extends AbstractEndpointBuilder
23 {
24
25 protected void setEndpoint(URI uri, Properties props) throws MalformedEndpointException
26 {
27 if (uri.getHost() != null && !"localhost".equals(uri.getHost()))
28 {
29 endpointName = uri.getHost();
30 }
31 int i = uri.getPath().indexOf("/", 1);
32 if (i > 0)
33 {
34 endpointName = uri.getPath().substring(1, i);
35 address = uri.getPath().substring(i + 1);
36 }
37 else if (uri.getPath() != null && uri.getPath().length() != 0)
38 {
39 address = uri.getPath().substring(1);
40 }
41 else
42 {
43 address = uri.getAuthority();
44 }
45
46
47
48 if (address == null)
49 {
50 address = uri.getScheme();
51 }
52 }
53 }