1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.transport.soap.axis; |
8 | |
|
9 | |
import org.mule.api.registry.ServiceDescriptor; |
10 | |
import org.mule.api.registry.ServiceException; |
11 | |
import org.mule.api.registry.ServiceFinder; |
12 | |
import org.mule.transport.soap.axis.i18n.AxisMessages; |
13 | |
import org.mule.util.ClassUtils; |
14 | |
import org.mule.util.PropertiesUtils; |
15 | |
|
16 | |
import java.util.Iterator; |
17 | |
import java.util.Map; |
18 | |
import java.util.Properties; |
19 | |
import java.util.TreeMap; |
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | 0 | public class SoapServiceFinder implements ServiceFinder |
26 | |
{ |
27 | |
|
28 | |
|
29 | |
|
30 | |
@Deprecated |
31 | |
public String findService(String service, ServiceDescriptor descriptor, Properties props) throws ServiceException |
32 | |
{ |
33 | 0 | Map finders = new TreeMap(); |
34 | 0 | PropertiesUtils.getPropertiesWithPrefix(props, "finder.class", finders); |
35 | |
|
36 | 0 | StringBuffer buf = new StringBuffer(); |
37 | 0 | for (Iterator iterator = finders.entrySet().iterator(); iterator.hasNext();) |
38 | |
{ |
39 | 0 | Map.Entry entry = (Map.Entry)iterator.next(); |
40 | |
try |
41 | |
{ |
42 | 0 | ClassUtils.loadClass(entry.getValue().toString(), getClass()); |
43 | 0 | return getProtocolFromKey(entry.getKey().toString()); |
44 | |
} |
45 | 0 | catch (ClassNotFoundException e1) |
46 | |
{ |
47 | 0 | buf.append(entry.getValue().toString()).append("(").append(entry.getKey().toString()).append( |
48 | |
")").append(", "); |
49 | |
} |
50 | 0 | } |
51 | 0 | throw new ServiceException(AxisMessages.couldNotFindSoapProvider(buf.toString())); |
52 | |
} |
53 | |
|
54 | |
protected String getProtocolFromKey(String key) |
55 | |
{ |
56 | 0 | return key.substring(key.lastIndexOf('.') + 1); |
57 | |
} |
58 | |
} |