Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2018-03-13 14:24:46 -0400
committerslewis2018-03-13 14:24:46 -0400
commit753d3e198879042afa1be6547dee5f557c22b36c (patch)
tree1879802cef9bfa97a06258da0bdf88592c9fc0f6
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
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRemoteService.java6
-rw-r--r--protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/RemoteServiceRegistration.java12
2 files changed, 7 insertions, 11 deletions
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRemoteService.java b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRemoteService.java
index 30803d6f1..4c87e71cc 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRemoteService.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRemoteService.java
@@ -124,10 +124,8 @@ public abstract class AbstractRemoteService extends AbstractAsyncProxyRemoteServ
if (defaultTimeout == null) {
Object o = getRemoteServiceReference().getProperty(Constants.OSGI_BASIC_TIMEOUT_INTENT);
if (o != null) {
- if (o instanceof Long)
- defaultTimeout = (Long) o;
- else if (o instanceof Integer)
- defaultTimeout = ((Integer) o).longValue();
+ if (o instanceof Number)
+ defaultTimeout = ((Number) o).longValue();
else if (o instanceof String)
defaultTimeout = Long.valueOf((String) o);
} else
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