Author: dkulp
Date: Fri Sep 28 20:54:19 2012
New Revision: 1391652
URL: http://svn.apache.org/viewvc?rev=1391652&view=rev
Log:
Ability to configure the probe timeout
Modified:
cxf/trunk/distribution/src/main/release/samples/ws-discovery/src/main/java/org/apache/cxf/samples/discovery/Client.java
cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/WSDiscoveryClient.java
Modified:
cxf/trunk/distribution/src/main/release/samples/ws-discovery/src/main/java/org/apache/cxf/samples/discovery/Client.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws-discovery/src/main/java/org/apache/cxf/samples/discovery/Client.java?rev=1391652&r1=1391651&r2=1391652&view=diff
==============================================================================
---
cxf/trunk/distribution/src/main/release/samples/ws-discovery/src/main/java/org/apache/cxf/samples/discovery/Client.java
(original)
+++
cxf/trunk/distribution/src/main/release/samples/ws-discovery/src/main/java/org/apache/cxf/samples/discovery/Client.java
Fri Sep 28 20:54:19 2012
@@ -35,7 +35,7 @@ public final class Client {
public static void main(String[] args) throws Exception {
- //USe ws-discovery to find references to services that implement the
Greeter portType
+ //Use WS-Discovery to find references to services that implement the
Greeter portType
WSDiscoveryClient client = new WSDiscoveryClient();
List<EndpointReference> references
= client.probe(new
QName("http://cxf.apache.org/hello_world/discovery", "Greeter"));
Modified:
cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/WSDiscoveryClient.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/WSDiscoveryClient.java?rev=1391652&r1=1391651&r2=1391652&view=diff
==============================================================================
---
cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/WSDiscoveryClient.java
(original)
+++
cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/WSDiscoveryClient.java
Fri Sep 28 20:54:19 2012
@@ -83,6 +83,7 @@ public class WSDiscoveryClient implement
Dispatch<Object> dispatch;
ObjectFactory factory = new ObjectFactory();
Bus bus;
+ int defaultProbeTimeout = 1000;
public WSDiscoveryClient() {
}
@@ -93,6 +94,13 @@ public class WSDiscoveryClient implement
resetDispatch(address);
}
+ public void setDefaultProbeTimeout(int i) {
+ defaultProbeTimeout = i;
+ }
+ public int getDefaultProbeTimeout() {
+ return defaultProbeTimeout;
+ }
+
public String getAddress() {
return address;
}
@@ -244,7 +252,7 @@ public class WSDiscoveryClient implement
if (type != null) {
p.getTypes().add(type);
}
- ProbeMatchesType pmt = probe(p, 1000);
+ ProbeMatchesType pmt = probe(p, defaultProbeTimeout);
List<EndpointReference> er = new ArrayList<EndpointReference>();
for (ProbeMatchType pm : pmt.getProbeMatch()) {
for (String add : pm.getXAddrs()) {
@@ -262,7 +270,7 @@ public class WSDiscoveryClient implement
public ProbeMatchesType probe(ProbeType params) {
- return probe(params, 1000);
+ return probe(params, defaultProbeTimeout);
}
public ProbeMatchesType probe(ProbeType params, int timeout) {
Dispatch<Object> disp = this.getDispatchInternal(false);
@@ -287,11 +295,9 @@ public class WSDiscoveryClient implement
}
}
} catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ // ?
} catch (ExecutionException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ // ?
}
}
};