Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-05-15 08:21:03 +0000
committerEike Stepper2010-05-15 08:21:03 +0000
commitf596d3ba55a7a06184f9c70e2a699ab5b7befe28 (patch)
tree8477713e59db44edb36897737285efe6a5eec2f2 /plugins/org.eclipse.emf.cdo.examples.server
parent6a5571a189213ea6773d9f55d9b4716155c187bd (diff)
downloadcdo-f596d3ba55a7a06184f9c70e2a699ab5b7befe28.tar.gz
cdo-f596d3ba55a7a06184f9c70e2a699ab5b7befe28.tar.xz
cdo-f596d3ba55a7a06184f9c70e2a699ab5b7befe28.zip
vserver
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.examples.server')
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/.classpath1
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/.jetproperties4
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/.project6
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/Demo Server.launch34
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/META-INF/MANIFEST.MF19
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/build.properties8
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/demo-server.css17
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/demo-server.product106
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/plugin.properties4
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/plugin.xml48
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/ConfigOverview.java70
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/RequestForm.java25
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/internal/server/OM.java (renamed from plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/OM.java)16
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/AbstractTemplateServlet.java119
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/ConfigOverviewServlet.java73
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/DemoServer.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/RequestFormServlet.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/templates/configOverview.htmljet42
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/templates/requestForm.htmljet26
19 files changed, 41 insertions, 653 deletions
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/.classpath b/plugins/org.eclipse.emf.cdo.examples.server/.classpath
index 16057af74c..64c5e31b7a 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/.classpath
+++ b/plugins/org.eclipse.emf.cdo.examples.server/.classpath
@@ -3,6 +3,5 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src-gen/"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/.jetproperties b/plugins/org.eclipse.emf.cdo.examples.server/.jetproperties
deleted file mode 100644
index 7be3f57ef1..0000000000
--- a/plugins/org.eclipse.emf.cdo.examples.server/.jetproperties
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<jet-settings>
- <template-container>templates</template-container> <source-container>src-gen</source-container>
-</jet-settings>
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/.project b/plugins/org.eclipse.emf.cdo.examples.server/.project
index e29e7622e8..b39adbdc1e 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/.project
+++ b/plugins/org.eclipse.emf.cdo.examples.server/.project
@@ -6,11 +6,6 @@
</projects>
<buildSpec>
<buildCommand>
- <name>org.eclipse.emf.codegen.JETBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
@@ -27,7 +22,6 @@
</buildCommand>
</buildSpec>
<natures>
- <nature>org.eclipse.emf.codegen.jet.IJETNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/Demo Server.launch b/plugins/org.eclipse.emf.cdo.examples.server/Demo Server.launch
deleted file mode 100644
index d42a211dc6..0000000000
--- a/plugins/org.eclipse.emf.cdo.examples.server/Demo Server.launch
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
-<booleanAttribute key="append.args" value="true"/>
-<stringAttribute key="application" value="org.eclipse.emf.cdo.examples.server.app"/>
-<booleanAttribute key="askclear" value="true"/>
-<booleanAttribute key="automaticAdd" value="false"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="org.eclipse.emf.cdo.common,org.eclipse.emf.cdo.server,org.eclipse.emf.cdo.server.db,org.eclipse.emf.cdo.server.net4j,org.eclipse.net4j,org.eclipse.net4j.db,org.eclipse.net4j.db.h2,org.eclipse.net4j.jvm,org.eclipse.net4j.tcp,org.eclipse.net4j.util"/>
-<booleanAttribute key="clearConfig" value="false"/>
-<booleanAttribute key="clearws" value="false"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Demo Server"/>
-<booleanAttribute key="default" value="false"/>
-<booleanAttribute key="includeOptional" value="false"/>
-<stringAttribute key="location" value="${workspace_loc}/../runtime-org.eclipse.emf.cdo.examples.server.app"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os}&#13;&#10;-ws ${target.ws}&#13;&#10;-arch ${target.arch}&#13;&#10;-nl ${target.nl}&#13;&#10;-consoleLog&#13;&#10;-console"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-server&#13;&#10;-Xms64M&#13;&#10;-Xmx512M&#13;&#10;-Dorg.osgi.service.http.port=3002"/>
-<booleanAttribute key="pde.generated.config" value="false"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.emf.cdo.examples.server.product"/>
-<stringAttribute key="selectedPlugin" value="org.eclipse.net4j.db.h2"/>
-<stringAttribute key="selected_target_plugins" value="org.mortbay.jetty.util@default:default,org.eclipse.core.jobs@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.emf.common@default:default,org.eclipse.osgi@-1:true,org.eclipse.core.filesystem@default:default,org.apache.commons.lang@default:default,org.eclipse.core.variables@default:default,org.apache.commons.logging@default:default,org.mortbay.jetty.server@default:default,org.eclipse.equinox.http.registry@default:true,org.h2@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.app@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.equinox.common@2:true,javax.servlet@default:default,org.eclipse.osgi.services@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.http.jetty@default:true,org.eclipse.core.contenttype@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.ecore.xmi@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.cdo.common@default:default,org.eclipse.emf.cdo.server.net4j@default:default,org.eclipse.net4j.util@default:default,org.eclipse.emf.cdo.server.db@default:default,org.eclipse.net4j.tcp@default:default,org.eclipse.net4j.db@default:default,org.eclipse.net4j.db.h2@default:default,org.eclipse.emf.cdo@default:default,org.eclipse.emf.cdo.examples.server@default:default,org.eclipse.net4j@default:default,org.eclipse.emf.cdo.server@default:default,org.eclipse.net4j.jvm@default:default"/>
-<booleanAttribute key="show_selected_only" value="true"/>
-<booleanAttribute key="tracing" value="true"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<booleanAttribute key="useProduct" value="false"/>
-<booleanAttribute key="usefeatures" value="false"/>
-</launchConfiguration>
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.examples.server/META-INF/MANIFEST.MF
index 51df6fe48d..ebeb1d6030 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.examples.server/META-INF/MANIFEST.MF
@@ -8,20 +8,13 @@ Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.emf.cdo.server.db;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.emf.cdo.server.db;bundle-version="[3.0.0,4.0.0)";visibility:=reexport,
org.eclipse.emf.cdo.server.net4j;bundle-version="[3.0.0,4.0.0)",
org.eclipse.net4j.db.h2;bundle-version="[3.0.0,4.0.0)",
org.eclipse.net4j.jvm;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.net4j.tcp;bundle-version="[3.0.0,4.0.0)",
- org.apache.commons.logging;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.equinox.http.registry;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.equinox.http.servlet;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.equinox.http.jetty;bundle-version="[2.0.0,3.0.0)"
-Export-Package: org.eclipse.emf.cdo.examples.server;version="3.0.0",
- templates;version="3.0.0";x-internal:=true
-Import-Package: javax.servlet;version="[2.3.0,3.0.0)",
- javax.servlet.http;version="[2.3.0,3.0.0)",
- org.apache.commons.lang;version="[2.3.0,3.0.0)",
- org.h2.jdbcx;version="[1.1.0,1.2.0)"
-Bundle-Activator: org.eclipse.emf.cdo.examples.server.OM$Activator
+ org.eclipse.net4j.tcp;bundle-version="[3.0.0,4.0.0)"
+Import-Package: org.h2.jdbcx;version="[1.1.0,1.2.0)"
+Export-Package: org.eclipse.emf.cdo.examples.internal.server;version="3.0.0";x-internal:=true,
+ org.eclipse.emf.cdo.examples.server;version="3.0.0"
+Bundle-Activator: org.eclipse.emf.cdo.examples.internal.server.OM$Activator
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/build.properties b/plugins/org.eclipse.emf.cdo.examples.server/build.properties
index 21cf4a5c2c..a98184138b 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/build.properties
+++ b/plugins/org.eclipse.emf.cdo.examples.server/build.properties
@@ -13,13 +13,9 @@ bin.includes = .,\
META-INF/,\
plugin.properties,\
about.html,\
- copyright.txt,\
- plugin.xml,\
- demo-server.product,\
- demo-server.css
+ copyright.txt
jars.compile.order = .
-source.. = src/,\
- src-gen/
+source.. = src/
output.. = bin/
src.includes = about.html,\
copyright.txt
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/demo-server.css b/plugins/org.eclipse.emf.cdo.examples.server/demo-server.css
deleted file mode 100644
index 9a6ede452e..0000000000
--- a/plugins/org.eclipse.emf.cdo.examples.server/demo-server.css
+++ /dev/null
@@ -1,17 +0,0 @@
-body {
- background: #1c2a7e;
- color: #e2e6ff;
- font-family: Arial, sans-serif;
-}
-
-h1,h2,h3,h4 {
- margin-bottom: 2px;
-}
-
-h2 {
- margin-top: 16px;
-}
-
-h2,h4 {
- color: #b7eaef;
-}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/demo-server.product b/plugins/org.eclipse.emf.cdo.examples.server/demo-server.product
deleted file mode 100644
index 6ed9762e61..0000000000
--- a/plugins/org.eclipse.emf.cdo.examples.server/demo-server.product
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?pde version="3.5"?>
-
-<product name="Demo Server" id="org.eclipse.emf.cdo.examples.server.product" application="org.eclipse.emf.cdo.examples.server.app" useFeatures="false" includeLaunchers="true">
-
- <configIni use="default">
- </configIni>
-
- <launcherArgs>
- <programArgs>-clean
--console
---launcher.suppressErrors
---launcher.XXMaxPermSize
-128M</programArgs>
- <vmArgs>-server
--Xms64M
--Xmx512M
--Dorg.osgi.service.http.port=3002</vmArgs>
- <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
- </launcherArgs>
-
- <windowImages/>
-
- <launcher name="cdo-server">
- <solaris/>
- <win useIco="false">
- <bmp/>
- </win>
- </launcher>
-
- <vm>
- </vm>
-
- <plugins>
- <plugin id="javax.servlet"/>
- <plugin id="org.apache.commons.lang"/>
- <plugin id="org.apache.commons.logging"/>
- <plugin id="org.eclipse.core.contenttype"/>
- <plugin id="org.eclipse.core.expressions"/>
- <plugin id="org.eclipse.core.jobs"/>
- <plugin id="org.eclipse.core.net"/>
- <plugin id="org.eclipse.core.net.linux.x86" fragment="true"/>
- <plugin id="org.eclipse.core.net.linux.x86_64" fragment="true"/>
- <plugin id="org.eclipse.core.net.win32.x86" fragment="true"/>
- <plugin id="org.eclipse.core.net.win32.x86_64" fragment="true"/>
- <plugin id="org.eclipse.core.runtime"/>
- <plugin id="org.eclipse.core.runtime.compatibility.auth"/>
- <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
- <plugin id="org.eclipse.core.variables"/>
- <plugin id="org.eclipse.emf.cdo"/>
- <plugin id="org.eclipse.emf.cdo.common"/>
- <plugin id="org.eclipse.emf.cdo.examples.server"/>
- <plugin id="org.eclipse.emf.cdo.server"/>
- <plugin id="org.eclipse.emf.cdo.server.db"/>
- <plugin id="org.eclipse.emf.cdo.server.net4j"/>
- <plugin id="org.eclipse.emf.common"/>
- <plugin id="org.eclipse.emf.ecore"/>
- <plugin id="org.eclipse.emf.ecore.change"/>
- <plugin id="org.eclipse.emf.ecore.xmi"/>
- <plugin id="org.eclipse.equinox.app"/>
- <plugin id="org.eclipse.equinox.common"/>
- <plugin id="org.eclipse.equinox.http.jetty"/>
- <plugin id="org.eclipse.equinox.http.registry"/>
- <plugin id="org.eclipse.equinox.http.servlet"/>
- <plugin id="org.eclipse.equinox.launcher"/>
- <plugin id="org.eclipse.equinox.launcher.cocoa.macosx" fragment="true"/>
- <plugin id="org.eclipse.equinox.launcher.cocoa.macosx.x86_64" fragment="true"/>
- <plugin id="org.eclipse.equinox.launcher.gtk.linux.ppc" fragment="true"/>
- <plugin id="org.eclipse.equinox.launcher.gtk.linux.x86" fragment="true"/>
- <plugin id="org.eclipse.equinox.launcher.gtk.linux.x86_64" fragment="true"/>
- <plugin id="org.eclipse.equinox.launcher.win32.win32.x86" fragment="true"/>
- <plugin id="org.eclipse.equinox.launcher.win32.win32.x86_64" fragment="true"/>
- <plugin id="org.eclipse.equinox.preferences"/>
- <plugin id="org.eclipse.equinox.registry"/>
- <plugin id="org.eclipse.equinox.security"/>
- <plugin id="org.eclipse.equinox.security.macosx" fragment="true"/>
- <plugin id="org.eclipse.equinox.security.win32.x86" fragment="true"/>
- <plugin id="org.eclipse.net4j"/>
- <plugin id="org.eclipse.net4j.db"/>
- <plugin id="org.eclipse.net4j.db.h2"/>
- <plugin id="org.eclipse.net4j.http.common"/>
- <plugin id="org.eclipse.net4j.http.server"/>
- <plugin id="org.eclipse.net4j.jvm"/>
- <plugin id="org.eclipse.net4j.tcp"/>
- <plugin id="org.eclipse.net4j.util"/>
- <plugin id="org.eclipse.osgi"/>
- <plugin id="org.eclipse.osgi.services"/>
- <plugin id="org.eclipse.update.configurator"/>
- <plugin id="org.eclipse.update.core"/>
- <plugin id="org.eclipse.update.core.linux" fragment="true"/>
- <plugin id="org.eclipse.update.core.win32" fragment="true"/>
- <plugin id="org.h2"/>
- <plugin id="org.mortbay.jetty.server"/>
- <plugin id="org.mortbay.jetty.util"/>
- </plugins>
-
- <configurations>
- <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
- <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
- <plugin id="org.eclipse.equinox.http.jetty" autoStart="true" startLevel="0" />
- <plugin id="org.eclipse.equinox.http.registry" autoStart="true" startLevel="0" />
- <plugin id="org.eclipse.equinox.http.servlet" autoStart="true" startLevel="0" />
- <plugin id="org.eclipse.update.configurator" autoStart="true" startLevel="3" />
- </configurations>
-
-</product>
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/plugin.properties b/plugins/org.eclipse.emf.cdo.examples.server/plugin.properties
index e08488cd0b..d60e6e257e 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/plugin.properties
+++ b/plugins/org.eclipse.emf.cdo.examples.server/plugin.properties
@@ -19,10 +19,6 @@
pluginName = CDO Model Repository Examples Server
providerName = Eclipse Modeling Project
-extension.name = CDOServer
-product.name = CDO Server
-product.description = An example of a CDO server
-
# ==============================================================================
# %%% END OF TRANSLATED PROPERTIES %%%
# The above properties have been shipped for translation.
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/plugin.xml b/plugins/org.eclipse.emf.cdo.examples.server/plugin.xml
deleted file mode 100644
index 363d994389..0000000000
--- a/plugins/org.eclipse.emf.cdo.examples.server/plugin.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.3"?>
-<!--
-Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html
-
-Contributors:
-Eike Stepper - initial API and implementation
--->
-
-<plugin>
-
- <extension id="app" point="org.eclipse.core.runtime.applications" name="%extension.name">
- <application cardinality="1" thread="any">
- <run class="org.eclipse.emf.cdo.examples.server.DemoServer"/>
- </application>
- </extension>
-
- <extension id="product" point="org.eclipse.core.runtime.products">
- <product name="Demo Server" description="%product.description" application="org.eclipse.emf.cdo.examples.server.app">
- <property name="appName" value="Demo Server"/>
- </product>
- </extension>
-
- <extension
- point="org.eclipse.equinox.http.registry.servlets">
- <servlet
- alias="/requestForm.html"
- class="org.eclipse.emf.cdo.examples.server.RequestFormServlet"
- load-on-startup="true"/>
- <servlet
- alias="/configOverview.html"
- class="org.eclipse.emf.cdo.examples.server.ConfigOverviewServlet"
- load-on-startup="true"/>
- </extension>
-
- <extension
- point="org.eclipse.equinox.http.registry.resources">
- <resource
- alias="/demo-server.css"
- base-name="/demo-server.css">
- </resource>
- </extension>
-
-</plugin>
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/ConfigOverview.java b/plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/ConfigOverview.java
deleted file mode 100644
index e7e2489c46..0000000000
--- a/plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/ConfigOverview.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package templates;
-
-import java.util.*;
-import org.eclipse.emf.cdo.examples.server.*;
-
-public class ConfigOverview
-{
- protected static String nl;
- public static synchronized ConfigOverview create(String lineSeparator)
- {
- nl = lineSeparator;
- ConfigOverview result = new ConfigOverview();
- nl = null;
- return result;
- }
-
- public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = "";
- protected final String TEXT_2 = NL + NL + "<html>" + NL + " <header>" + NL + "\t <title>" + NL + "\t\t\tDemo Configuration ";
- protected final String TEXT_3 = NL + "\t </title>" + NL + "\t\t<link media=\"screen\" href=\"demo-server.css\" type=\"text/css\" rel=\"stylesheet\">" + NL + "\t\t<meta http-equiv=\"refresh\" content=\"5; URL=?name=";
- protected final String TEXT_4 = "\">" + NL + "\t<header>" + NL + "<body>" + NL + "" + NL + "<h1>Demo Configuration</h1>" + NL + "<hr>" + NL + "" + NL + "<table border=\"0\" width=\"400\">" + NL + "\t<tr><td>Server:</td><td><b>tcp://cdo.eclipse.org:";
- protected final String TEXT_5 = "</b></td></tr>" + NL + "\t<tr><td>Repository:</td><td><b>";
- protected final String TEXT_6 = "</b></td></tr>" + NL + "\t<tr><td>Mode:</td><td>";
- protected final String TEXT_7 = "</td></tr>" + NL + "\t<tr><td>User IDs:</td><td>" + NL + "\t";
- protected final String TEXT_8 = NL + "\t\t\t";
- protected final String TEXT_9 = ": ";
- protected final String TEXT_10 = "<br>";
- protected final String TEXT_11 = NL + "\t\t</td></tr>" + NL + "\t</td></tr>" + NL + "\t<tr><td>Timeout In:</td><td>";
- protected final String TEXT_12 = " Minutes...</td></tr>" + NL + "\t<tr><td>&nbsp;</td><td><a href=\"?name=";
- protected final String TEXT_13 = "\">Refresh Page</a></td></tr>" + NL + "</table>" + NL + "" + NL + "</body>" + NL + "</html>";
- protected final String TEXT_14 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
- stringBuffer.append(TEXT_1);
- DemoConfiguration config = (DemoConfiguration)argument;
- String name = config.getName();
- stringBuffer.append(TEXT_2);
- stringBuffer.append(name);
- stringBuffer.append(TEXT_3);
- stringBuffer.append(name);
- stringBuffer.append(TEXT_4);
- stringBuffer.append(DemoServer.PORT);
- stringBuffer.append(TEXT_5);
- stringBuffer.append(name);
- stringBuffer.append(TEXT_6);
- stringBuffer.append(AbstractTemplateServlet.html(config.getMode().toString()));
- stringBuffer.append(TEXT_7);
-
- Map<String, char[]> users = config.getUsers();
- List<String> userIDs = new ArrayList<String>(users.keySet());
- Collections.sort(userIDs);
- for (String userID : userIDs)
- {
- stringBuffer.append(TEXT_8);
- stringBuffer.append(userID);
- stringBuffer.append(TEXT_9);
- stringBuffer.append(users.get(userID));
- stringBuffer.append(TEXT_10);
- }
- stringBuffer.append(TEXT_11);
- stringBuffer.append(AbstractTemplateServlet.html(config.formatTimeoutMinutes()));
- stringBuffer.append(TEXT_12);
- stringBuffer.append(name);
- stringBuffer.append(TEXT_13);
- stringBuffer.append(TEXT_14);
- return stringBuffer.toString();
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/RequestForm.java b/plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/RequestForm.java
deleted file mode 100644
index 555b2f31e1..0000000000
--- a/plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/RequestForm.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package templates;
-
-public class RequestForm
-{
- protected static String nl;
- public static synchronized RequestForm create(String lineSeparator)
- {
- nl = lineSeparator;
- RequestForm result = new RequestForm();
- nl = null;
- return result;
- }
-
- public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = NL + "<html>" + NL + " <header>" + NL + "\t <title>" + NL + "\t\t\tDemo Request Form" + NL + "\t </title>" + NL + "\t\t<link media=\"screen\" href=\"demo-server.css\" type=\"text/css\" rel=\"stylesheet\">" + NL + "\t<header>" + NL + "<body>" + NL + "" + NL + "<h1>Demo Request Form</h1>" + NL + "<hr>" + NL + "" + NL + "<form method=\"post\" action=\"configOverview.html\">" + NL + "\t<table border=\"0\">" + NL + "\t\t<tr><td>Mode:</td><td><select name=\"mode\"><option>NORMAL</option><option>AUDITING</option><option>BRANCHING</option></select></td></tr>" + NL + "\t\t<!--<tr><td>User IDs:</td><td><input name=\"userIDs\" type=\"input\"/></td></tr>-->" + NL + "\t\t<tr><td>&nbsp;</td><td><input name=\"submit\" type=\"submit\"/></td></tr>" + NL + "\t</table>" + NL + "</form>" + NL + "" + NL + "</body>" + NL + "</html>";
- protected final String TEXT_2 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
- stringBuffer.append(TEXT_1);
- stringBuffer.append(TEXT_2);
- return stringBuffer.toString();
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/OM.java b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/internal/server/OM.java
index 1b1dce3092..63f1c6ac76 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/OM.java
+++ b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/internal/server/OM.java
@@ -8,7 +8,9 @@
* Contributors:
* Eike Stepper - initial API and implementation
*/
-package org.eclipse.emf.cdo.examples.server;
+package org.eclipse.emf.cdo.examples.internal.server;
+
+import org.eclipse.emf.cdo.examples.server.DemoServer;
import org.eclipse.net4j.util.om.OMBundle;
import org.eclipse.net4j.util.om.OMPlatform;
@@ -40,5 +42,17 @@ public abstract class OM
{
super(BUNDLE);
}
+
+ @Override
+ protected void doStart() throws Exception
+ {
+ DemoServer.INSTANCE.activate();
+ }
+
+ @Override
+ protected void doStop() throws Exception
+ {
+ DemoServer.INSTANCE.deactivate();
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/AbstractTemplateServlet.java b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/AbstractTemplateServlet.java
deleted file mode 100644
index 910ca40f43..0000000000
--- a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/AbstractTemplateServlet.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- *
- * Initial Publication:
- * Eclipse Magazin - http://www.eclipse-magazin.de
- */
-package org.eclipse.emf.cdo.examples.server;
-
-import org.eclipse.net4j.util.io.IOUtil;
-
-import org.apache.commons.lang.StringEscapeUtils;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.text.NumberFormat;
-
-/**
- * @author Eike Stepper
- */
-public abstract class AbstractTemplateServlet<ARGUMENT> extends HttpServlet
-{
- private static final long serialVersionUID = 1L;
-
- private Object template;
-
- private Method method;
-
- public AbstractTemplateServlet(Class<?> templateClass) throws InstantiationException, IllegalAccessException,
- SecurityException, NoSuchMethodException
- {
- method = templateClass.getMethod("generate", Object.class);
- template = templateClass.newInstance();
- }
-
- @Override
- public final void init() throws ServletException
- {
- System.out.println("INIT " + getClass().getSimpleName());
- doInit();
- super.init();
- }
-
- @Override
- public final void destroy()
- {
- System.out.println("DESTROY " + getClass().getSimpleName());
- doDestroy();
- super.destroy();
- }
-
- @Override
- protected final void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
- {
- doPost(req, resp);
- }
-
- @Override
- protected final void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
- {
- PrintWriter writer = resp.getWriter();
-
- try
- {
- ARGUMENT argument = createTemplateArgument(req);
- String html = (String)method.invoke(template, argument);
- writer.print(html);
- }
- catch (IllegalArgumentException ex)
- {
- throw new ServletException(ex);
- }
- catch (IllegalAccessException ex)
- {
- throw new ServletException(ex);
- }
- catch (InvocationTargetException ex)
- {
- throw new ServletException(ex);
- }
- finally
- {
- IOUtil.close(writer);
- }
- }
-
- protected void doInit()
- {
- }
-
- protected void doDestroy()
- {
- }
-
- protected abstract ARGUMENT createTemplateArgument(HttpServletRequest req);
-
- public static String html(String value)
- {
- return StringEscapeUtils.escapeHtml(value);
- }
-
- public static String html(double value)
- {
- return html(NumberFormat.getCurrencyInstance().format(value));
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/ConfigOverviewServlet.java b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/ConfigOverviewServlet.java
deleted file mode 100644
index b16daa5a0e..0000000000
--- a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/ConfigOverviewServlet.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- *
- * Initial Publication:
- * Eclipse Magazin - http://www.eclipse-magazin.de
- */
-package org.eclipse.emf.cdo.examples.server;
-
-import org.eclipse.emf.cdo.examples.server.DemoConfiguration.Mode;
-
-import templates.ConfigOverview;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * @author Eike Stepper
- */
-public class ConfigOverviewServlet extends AbstractTemplateServlet<DemoConfiguration>
-{
- private static final long serialVersionUID = 1L;
-
- public ConfigOverviewServlet() throws InstantiationException, IllegalAccessException, SecurityException,
- NoSuchMethodException
- {
- super(ConfigOverview.class);
- }
-
- @Override
- protected DemoConfiguration createTemplateArgument(HttpServletRequest req)
- {
- String name = req.getParameter("name");
- if (name != null)
- {
- return getDemoConfiguration(name);
- }
-
- String mode = req.getParameter("mode");
- String userIDs = req.getParameter("userIDs");
- return createDemoConfiguration(mode, userIDs);
- }
-
- protected DemoConfiguration createDemoConfiguration(String mode, String userIDs)
- {
- DemoConfiguration config = new DemoConfiguration();
- config.setMode(Mode.valueOf(mode));
- if (userIDs != null)
- {
- config.setUserIDs(userIDs.split(","));
- }
-
- config.activate();
- DemoServer.INSTANCE.addConfig(config);
- return config;
- }
-
- protected DemoConfiguration getDemoConfiguration(String name)
- {
- DemoConfiguration config = DemoServer.INSTANCE.getConfig(name);
- if (config == null)
- {
- throw new IllegalStateException("No demo configuration available for " + name);
- }
-
- return config;
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/DemoServer.java b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/DemoServer.java
index d1c09bbfea..8a5669613d 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/DemoServer.java
+++ b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/DemoServer.java
@@ -10,13 +10,15 @@
*/
package org.eclipse.emf.cdo.examples.server;
+import org.eclipse.emf.cdo.examples.internal.server.OM;
+
import org.eclipse.net4j.acceptor.IAcceptor;
import org.eclipse.net4j.tcp.TCPUtil;
import org.eclipse.net4j.util.concurrent.Worker;
import org.eclipse.net4j.util.container.IPluginContainer;
+import org.eclipse.net4j.util.lifecycle.Lifecycle;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.OSGiApplication;
import org.eclipse.net4j.util.om.log.EclipseLoggingBridge;
import java.util.HashMap;
@@ -25,17 +27,15 @@ import java.util.Map;
/**
* @author Eike Stepper
*/
-public class DemoServer extends OSGiApplication
+public class DemoServer extends Lifecycle
{
- public static final String ID = OM.BUNDLE_ID + ".app"; //$NON-NLS-1$
-
public static final String PROP_BROWSER_PORT = OM.BUNDLE_ID + ".browser.port"; //$NON-NLS-1$
public static final int PORT = 3003;
public static final long MAX_IDLE_TIME = 10 * 60 * 1000;
- public static DemoServer INSTANCE;
+ public static final DemoServer INSTANCE = new DemoServer();
private IAcceptor acceptor;
@@ -43,10 +43,8 @@ public class DemoServer extends OSGiApplication
private Cleaner cleaner = new Cleaner();
- public DemoServer()
+ private DemoServer()
{
- super(ID);
- INSTANCE = this;
}
public IAcceptor getAcceptor()
@@ -54,6 +52,14 @@ public class DemoServer extends OSGiApplication
return acceptor;
}
+ public DemoConfiguration[] getConfigs()
+ {
+ synchronized (configs)
+ {
+ return configs.values().toArray(new DemoConfiguration[configs.size()]);
+ }
+ }
+
public DemoConfiguration getConfig(String name)
{
synchronized (configs)
@@ -71,9 +77,9 @@ public class DemoServer extends OSGiApplication
}
@Override
- protected void doStart() throws Exception
+ protected void doActivate() throws Exception
{
- super.doStart();
+ super.doActivate();
OMPlatform.INSTANCE.removeLogHandler(EclipseLoggingBridge.INSTANCE);
OM.LOG.info("Demo server starting");
@@ -91,7 +97,7 @@ public class DemoServer extends OSGiApplication
}
@Override
- protected void doStop() throws Exception
+ protected void doDeactivate() throws Exception
{
OM.LOG.info("Demo server stopping");
cleaner.deactivate();
@@ -110,15 +116,7 @@ public class DemoServer extends OSGiApplication
}
OM.LOG.info("Demo server stopped");
- super.doStop();
- }
-
- protected DemoConfiguration[] getConfigs()
- {
- synchronized (configs)
- {
- return configs.values().toArray(new DemoConfiguration[configs.size()]);
- }
+ super.doDeactivate();
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/RequestFormServlet.java b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/RequestFormServlet.java
deleted file mode 100644
index ba8eed811c..0000000000
--- a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/RequestFormServlet.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- *
- * Initial Publication:
- * Eclipse Magazin - http://www.eclipse-magazin.de
- */
-package org.eclipse.emf.cdo.examples.server;
-
-import templates.RequestForm;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * @author Eike Stepper
- */
-public class RequestFormServlet extends AbstractTemplateServlet<Object>
-{
- private static final long serialVersionUID = 1L;
-
- public RequestFormServlet() throws InstantiationException, IllegalAccessException, SecurityException,
- NoSuchMethodException
- {
- super(RequestForm.class);
- }
-
- @Override
- protected Object createTemplateArgument(HttpServletRequest req)
- {
- return null;
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/templates/configOverview.htmljet b/plugins/org.eclipse.emf.cdo.examples.server/templates/configOverview.htmljet
deleted file mode 100644
index 1c8745aeba..0000000000
--- a/plugins/org.eclipse.emf.cdo.examples.server/templates/configOverview.htmljet
+++ /dev/null
@@ -1,42 +0,0 @@
-<%@ jet
- class="ConfigOverview"
- package="templates"
- imports="java.util.* org.eclipse.emf.cdo.examples.server.*" %>
-
-<% DemoConfiguration config = (DemoConfiguration)argument; %>
-<% String name = config.getName(); %>
-
-<html>
- <header>
- <title>
- Demo Configuration <%=name%>
- </title>
- <link media="screen" href="demo-server.css" type="text/css" rel="stylesheet">
- <meta http-equiv="refresh" content="5; URL=?name=<%=name%>">
- <header>
-<body>
-
-<h1>Demo Configuration</h1>
-<hr>
-
-<table border="0" width="400">
- <tr><td>Server:</td><td><b>tcp://cdo.eclipse.org:<%=DemoServer.PORT%></b></td></tr>
- <tr><td>Repository:</td><td><b><%=name%></b></td></tr>
- <tr><td>Mode:</td><td><%=AbstractTemplateServlet.html(config.getMode().toString())%></td></tr>
- <tr><td>User IDs:</td><td>
- <%
- Map<String, char[]> users = config.getUsers();
- List<String> userIDs = new ArrayList<String>(users.keySet());
- Collections.sort(userIDs);
- for (String userID : userIDs)
- { %>
- <%=userID%>: <%=users.get(userID)%><br>
- <% } %>
- </td></tr>
- </td></tr>
- <tr><td>Timeout In:</td><td><%=AbstractTemplateServlet.html(config.formatTimeoutMinutes())%> Minutes...</td></tr>
- <tr><td>&nbsp;</td><td><a href="?name=<%=name%>">Refresh Page</a></td></tr>
-</table>
-
-</body>
-</html>
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/templates/requestForm.htmljet b/plugins/org.eclipse.emf.cdo.examples.server/templates/requestForm.htmljet
deleted file mode 100644
index f773f1469b..0000000000
--- a/plugins/org.eclipse.emf.cdo.examples.server/templates/requestForm.htmljet
+++ /dev/null
@@ -1,26 +0,0 @@
-<%@ jet
- class="RequestForm"
- package="templates" %>
-
-<html>
- <header>
- <title>
- Demo Request Form
- </title>
- <link media="screen" href="demo-server.css" type="text/css" rel="stylesheet">
- <header>
-<body>
-
-<h1>Demo Request Form</h1>
-<hr>
-
-<form method="post" action="configOverview.html">
- <table border="0">
- <tr><td>Mode:</td><td><select name="mode"><option>NORMAL</option><option>AUDITING</option><option>BRANCHING</option></select></td></tr>
- <!--<tr><td>User IDs:</td><td><input name="userIDs" type="input"/></td></tr>-->
- <tr><td>&nbsp;</td><td><input name="submit" type="submit"/></td></tr>
- </table>
-</form>
-
-</body>
-</html>

Back to the top