From 1a541a1e63d375bd75981a2730e787fd44810b75 Mon Sep 17 00:00:00 2001 From: Dan Cunningham Date: Thu, 28 Aug 2014 16:41:31 -0600 Subject: [PATCH] Using setBroadcasterCache does not seem to trigger the correct life cycle management that internal BroadcastCache classes require --- .../src/main/java/org/openhab/io/rest/RESTApplication.java | 2 +- .../io/rest/internal/listeners/ResourceStateChangeListener.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/io/org.openhab.io.rest/src/main/java/org/openhab/io/rest/RESTApplication.java b/bundles/io/org.openhab.io.rest/src/main/java/org/openhab/io/rest/RESTApplication.java index 4b71d5d0af5..b81bf9ac9ae 100644 --- a/bundles/io/org.openhab.io.rest/src/main/java/org/openhab/io/rest/RESTApplication.java +++ b/bundles/io/org.openhab.io.rest/src/main/java/org/openhab/io/rest/RESTApplication.java @@ -198,7 +198,7 @@ private Dictionary getJerseyServletParams() { jerseyServletParams.put("org.atmosphere.cpr.AtmosphereInterceptor", "org.atmosphere.interceptor.DefaultHeadersInterceptor,org.atmosphere.interceptor.AndroidAtmosphereInterceptor,org.atmosphere.interceptor.SSEAtmosphereInterceptor,org.atmosphere.interceptor.JSONPAtmosphereInterceptor,org.atmosphere.interceptor.JavaScriptProtocol,org.atmosphere.interceptor.OnDisconnectInterceptor"); // The BroadcasterCache is set in ResourceStateChangeListener.registerItems(), because otherwise // it gets somehow overridden by other registered servlets (e.g. the CV-bundle) -// jerseyServletParams.put("org.atmosphere.cpr.broadcasterCacheClass", "org.atmosphere.cache.UUIDBroadcasterCache"); + jerseyServletParams.put("org.atmosphere.cpr.broadcasterCacheClass", "org.atmosphere.cache.UUIDBroadcasterCache"); jerseyServletParams.put("org.atmosphere.cpr.broadcasterLifeCyclePolicy", "IDLE_DESTROY"); jerseyServletParams.put("org.atmosphere.cpr.CometSupport.maxInactiveActivity", "3000000"); diff --git a/bundles/io/org.openhab.io.rest/src/main/java/org/openhab/io/rest/internal/listeners/ResourceStateChangeListener.java b/bundles/io/org.openhab.io.rest/src/main/java/org/openhab/io/rest/internal/listeners/ResourceStateChangeListener.java index 589eda8be02..bc1cbbd8bf9 100644 --- a/bundles/io/org.openhab.io.rest/src/main/java/org/openhab/io/rest/internal/listeners/ResourceStateChangeListener.java +++ b/bundles/io/org.openhab.io.rest/src/main/java/org/openhab/io/rest/internal/listeners/ResourceStateChangeListener.java @@ -67,7 +67,7 @@ public static ConcurrentMap getMap() { } public void registerItems(){ - broadcaster.getBroadcasterConfig().setBroadcasterCache(new UUIDBroadcasterCache()); + //broadcaster.getBroadcasterConfig().setBroadcasterCache(new UUIDBroadcasterCache()); broadcaster.getBroadcasterConfig().addFilter(new PerRequestBroadcastFilter() {