KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > bus > management > TransportInstrumentation


1 package org.objectweb.celtix.bus.management;
2
3 import javax.wsdl.Port;
4 import javax.wsdl.WSDLException;
5
6 import org.objectweb.celtix.Bus;
7 import org.objectweb.celtix.ws.addressing.EndpointReferenceType;
8 import org.objectweb.celtix.wsdl.EndpointReferenceUtils;
9
10 public class TransportInstrumentation {
11     protected Bus bus;
12     protected String JavaDoc objectName;
13     protected String JavaDoc serviceName;
14     protected String JavaDoc portName;
15     
16     public TransportInstrumentation(Bus b) {
17         bus = b;
18     }
19
20     protected String JavaDoc findServiceName(EndpointReferenceType reference) {
21         return EndpointReferenceUtils.getServiceName(
22              reference).toString();
23     }
24     
25     protected String JavaDoc findPortName(EndpointReferenceType reference) {
26         Port port = null;
27         String JavaDoc name = " ";
28         try {
29             port = EndpointReferenceUtils.getPort(bus.getWSDLManager(), reference);
30             name = port.getName();
31         } catch (WSDLException e) {
32             // wsdlexception
33
}
34         return name;
35     }
36     
37     protected String JavaDoc getPortObjectName() {
38         return ",Bus.Service=\"" + serviceName + "\"" + ",Bus.Service.Port=" + portName;
39     }
40
41 }
42
Popular Tags