summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn F. Cook2011-10-07 16:07:47 (EDT)
committerRoberto E. Escobar2011-10-07 16:07:47 (EDT)
commit7336e2869f37285384361636efe8b93212298397 (patch)
tree85f3dd5942142825de319b492d1d0e4c1b76a46a
parente5eb3e96b5eb2bfcdf8f8ea7c5888ce564a731f2 (diff)
downloadorg.eclipse.osee-7336e2869f37285384361636efe8b93212298397.zip
org.eclipse.osee-7336e2869f37285384361636efe8b93212298397.tar.gz
org.eclipse.osee-7336e2869f37285384361636efe8b93212298397.tar.bz2
feature[ats_Q9NLC]: Convert OseeAppData to impl HttpServletReqList
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsAppData.java17
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeAppData.java82
-rw-r--r--plugins/org.eclipse.osee.support.config/launchConfig/UI.launch2
3 files changed, 52 insertions, 49 deletions
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsAppData.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsAppData.java
index 38d0a26..6aa2823 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsAppData.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsAppData.java
@@ -27,23 +27,6 @@ public class AtsAppData extends OseeAppData {
super(app);
}
- @Override
- public void transactionStart(Application application, Object transactionData) {
- // Set this data instance of this application
- // as the one active in the current thread.
- if (this.app == application) {
- instance.set(this);
- }
- }
-
- @Override
- public void transactionEnd(Application application, Object transactionData) {
- // Clear the reference to avoid potential problems
- if (this.app == application) {
- instance.set(null);
- }
- }
-
public static AtsNavigator getAtsNavigator() {
return (AtsNavigator) OseeAppData.getNavigator();
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeAppData.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeAppData.java
index 75ba35a..8f942c6 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeAppData.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeAppData.java
@@ -11,52 +11,72 @@ he Eclipse Public License v1.0
*******************************************************************************/
package org.eclipse.osee.display.view.web;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
import org.eclipse.osee.display.api.search.SearchNavigator;
import org.eclipse.osee.display.api.search.SearchPresenter;
+
import com.vaadin.Application;
-import com.vaadin.service.ApplicationContext.TransactionListener;
+import com.vaadin.terminal.gwt.server.HttpServletRequestListener;
/**
- * @author Shawn F. Cook AppData contains thread-safe session-global data based on Vaadin demonstation:
- * https://vaadin.com/book/-/page/advanced.global.html
+ * @author Shawn F. Cook AppData contains thread-safe session-global data based
+ * on Vaadin demonstation:
+ * https://vaadin.com/book/-/page/advanced.global.html
*/
@SuppressWarnings("serial")
-public class OseeAppData implements TransactionListener {
+public class OseeAppData implements HttpServletRequestListener {
+
+ protected final Application app; // For distinguishing between apps
+ protected static ThreadLocal<OseeAppData> instance = new ThreadLocal<OseeAppData>();
+
+ private final SearchNavigator navigator = createNavigator();
+ private final SearchPresenter searchPresenter = createSearchPresenter();
+
+ public OseeAppData(Application app) {
+ this.app = app;
- protected final Application app; // For distinguishing between apps
- protected static ThreadLocal<OseeAppData> instance = new ThreadLocal<OseeAppData>();
+ // It's usable from now on in the current request
+ instance.set(this);
+ }
- private final SearchNavigator navigator = createNavigator();
- private final SearchPresenter searchPresenter = createSearchPresenter();
+ protected SearchNavigator createNavigator() {
+ return new OseeNavigator();
+ }
- public OseeAppData(Application app) {
- this.app = app;
+ protected SearchPresenter createSearchPresenter() {
+ return null;
+ }
- // It's usable from now on in the current request
- instance.set(this);
- }
+ public static SearchNavigator getNavigator() {
+ return instance.get().navigator;
+ }
- @Override
- public void transactionStart(Application application, Object transactionData) {
- }
+ public static SearchPresenter getSearchPresenter() {
+ return instance.get().searchPresenter;
+ }
- @Override
- public void transactionEnd(Application application, Object transactionData) {
- }
+ // @return the current application instance
+ public static OseeAppData getInstance() {
+ return instance.get();
+ }
- protected SearchNavigator createNavigator() {
- return new OseeNavigator();
- }
+ // Set the current application instance
+ public static void setInstance(OseeAppData appdata) {
+ instance.set(appdata);
+ }
- protected SearchPresenter createSearchPresenter() {
- return null;
- }
+ @Override
+ public void onRequestStart(HttpServletRequest request,
+ HttpServletResponse response) {
+ OseeAppData.setInstance(this);
+ }
- public static SearchNavigator getNavigator() {
- return instance.get().navigator;
- }
+ @Override
+ public void onRequestEnd(HttpServletRequest request,
+ HttpServletResponse response) {
+ instance.remove();
- public static SearchPresenter getSearchPresenter() {
- return instance.get().searchPresenter;
- }
+ }
}
diff --git a/plugins/org.eclipse.osee.support.config/launchConfig/UI.launch b/plugins/org.eclipse.osee.support.config/launchConfig/UI.launch
index 115f82c..3111495 100644
--- a/plugins/org.eclipse.osee.support.config/launchConfig/UI.launch
+++ b/plugins/org.eclipse.osee.support.config/launchConfig/UI.launch
@@ -24,5 +24,5 @@
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<stringAttribute key="workspace_bundles" value="com.vaadin@default:default,org.eclipse.osee.ats.api@default:default,org.eclipse.osee.ats.view.web@default:default,org.eclipse.osee.display.api@default:default,org.eclipse.osee.display.presenter*0.9.9.qualifier@default:default,org.eclipse.osee.display.presenter.test@default:false,org.eclipse.osee.display.view.web*0.9.9.qualifier@default:default,org.eclipse.osee.event.osgi@default:default,org.eclipse.osee.event@default:default,org.eclipse.osee.framework.core.model.test@default:false,org.eclipse.osee.framework.core.model@default:default,org.eclipse.osee.framework.core.test@default:false,org.eclipse.osee.framework.core@default:default,org.eclipse.osee.framework.jdk.core.test@default:false,org.eclipse.osee.framework.jdk.core@default:default,org.eclipse.osee.framework.logging.test@default:false,org.eclipse.osee.framework.logging@default:default,org.eclipse.osee.logback.config@default:false,org.eclipse.osee.logger.slf4j@default:default,org.eclipse.osee.logger@default:default,org.eclipse.osee.orcs@default:default,org.eclipse.osee.vaadin.themes@default:false,org.eclipse.osee.vaadin.widgets@default:default,org.eclipse.osee.vaadin@default:default"/>
+<stringAttribute key="workspace_bundles" value="com.vaadin@default:default,org.eclipse.osee.ats.api@default:default,org.eclipse.osee.ats.view.web@default:default,org.eclipse.osee.display.api@default:default,org.eclipse.osee.display.presenter.test@default:false,org.eclipse.osee.display.presenter@default:default,org.eclipse.osee.display.view.web@default:default,org.eclipse.osee.event.osgi@default:default,org.eclipse.osee.event@default:default,org.eclipse.osee.framework.core.model.test@default:false,org.eclipse.osee.framework.core.model@default:default,org.eclipse.osee.framework.core.test@default:false,org.eclipse.osee.framework.core@default:default,org.eclipse.osee.framework.jdk.core.test@default:false,org.eclipse.osee.framework.jdk.core@default:default,org.eclipse.osee.framework.logging.test@default:false,org.eclipse.osee.framework.logging@default:default,org.eclipse.osee.logback.config@default:false,org.eclipse.osee.logger.slf4j@default:default,org.eclipse.osee.logger@default:default,org.eclipse.osee.orcs@default:default,org.eclipse.osee.vaadin.themes@default:false,org.eclipse.osee.vaadin.widgets@default:default,org.eclipse.osee.vaadin@default:default"/>
</launchConfiguration>