Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2018-03-13 18:24:46 +0000
committerslewis2018-03-13 18:24:46 +0000
commit753d3e198879042afa1be6547dee5f557c22b36c (patch)
tree1879802cef9bfa97a06258da0bdf88592c9fc0f6 /protocols/bundles
parenteb1a4ff73d8860fb04ff5051ffb178cb6bc5d926 (diff)
downloadorg.eclipse.ecf-753d3e198879042afa1be6547dee5f557c22b36c.tar.gz
org.eclipse.ecf-753d3e198879042afa1be6547dee5f557c22b36c.tar.xz
org.eclipse.ecf-753d3e198879042afa1be6547dee5f557c22b36c.zip
Additional fixes for bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=532205 Fixes use of osgi.basic.timeout Change-Id: Iee55df4b03974544de4f0ed4c350a601ccf12aba
Diffstat (limited to 'protocols/bundles')
-rw-r--r--protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/RemoteServiceRegistration.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/RemoteServiceRegistration.java b/protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/RemoteServiceRegistration.java
index 947f154b6..f4e98167f 100644
--- a/protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/RemoteServiceRegistration.java
+++ b/protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/RemoteServiceRegistration.java
@@ -51,6 +51,7 @@ final class RemoteServiceRegistration {
public static final String OSGI_ASYNC = "osgi.async";
public static final String OSGI_BASIC_TIMEOUT = "osgi.basic.timeout";
+ public static final long DEFAULT_TIMEOUT = Long.valueOf(System.getProperty("ch.ethz.iks.r_osgi.remoteservice.timeout","30000"));
/**
* the local service reference.
*/
@@ -163,16 +164,13 @@ final class RemoteServiceRegistration {
}
long getOSGiTimeout() {
- long timeout = 30000;
+ long timeout = DEFAULT_TIMEOUT;
Object timeoutval = reference.getProperty(OSGI_BASIC_TIMEOUT);
if (timeoutval != null) {
- if (timeoutval instanceof Long) {
- timeout = ((Long) timeoutval).longValue();
- } else if (timeoutval instanceof Integer) {
- timeout = ((Integer) timeoutval).longValue();
- } else if (timeoutval instanceof String) {
+ if (timeoutval instanceof Number)
+ timeout = ((Number) timeoutval).longValue();
+ else if (timeoutval instanceof String)
timeout = Long.valueOf((String) timeoutval).longValue();
- }
}
return timeout;
}

Back to the top