Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-05-14 09:02:04 +0000
committerEike Stepper2010-05-14 09:02:04 +0000
commit660130c9b1e89ec0fa5b9316e49e0480caf42d11 (patch)
treed807630d6fd99309b82d60ef2dd8814e2f640b4e /plugins/org.eclipse.emf.cdo.examples.server
parent2f7235c404620cce7307e55ca2d2203da59e5e33 (diff)
downloadcdo-660130c9b1e89ec0fa5b9316e49e0480caf42d11.tar.gz
cdo-660130c9b1e89ec0fa5b9316e49e0480caf42d11.tar.xz
cdo-660130c9b1e89ec0fa5b9316e49e0480caf42d11.zip
vserver
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.examples.server')
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/demo-server.product3
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/ConfigOverview.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/DemoConfiguration.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/DemoServer.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/templates/configOverview.htmljet2
5 files changed, 16 insertions, 12 deletions
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/demo-server.product b/plugins/org.eclipse.emf.cdo.examples.server/demo-server.product
index ea2c6d6e32..c0320709ce 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/demo-server.product
+++ b/plugins/org.eclipse.emf.cdo.examples.server/demo-server.product
@@ -35,7 +35,6 @@
<plugin id="javax.servlet"/>
<plugin id="org.apache.commons.lang"/>
<plugin id="org.apache.commons.logging"/>
- <plugin id="org.eclipse.ant.core"/>
<plugin id="org.eclipse.core.contenttype"/>
<plugin id="org.eclipse.core.expressions"/>
<plugin id="org.eclipse.core.filesystem"/>
@@ -51,8 +50,6 @@
<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.resources"/>
- <plugin id="org.eclipse.core.resources.win32.x86" 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"/>
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
index f9db688a7c..e7e2489c46 100644
--- 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
@@ -25,8 +25,8 @@ public class ConfigOverview
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>Idle Time:</td><td>";
- protected final String TEXT_12 = "</td></tr>" + NL + "\t<tr><td>&nbsp;</td><td><a href=\"?name=";
+ 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;
@@ -60,7 +60,7 @@ public class ConfigOverview
stringBuffer.append(TEXT_10);
}
stringBuffer.append(TEXT_11);
- stringBuffer.append(AbstractTemplateServlet.html(config.formatIdleTime()));
+ stringBuffer.append(AbstractTemplateServlet.html(config.formatTimeoutMinutes()));
stringBuffer.append(TEXT_12);
stringBuffer.append(name);
stringBuffer.append(TEXT_13);
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/DemoConfiguration.java b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/DemoConfiguration.java
index e58b7208cf..71e920f666 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/DemoConfiguration.java
+++ b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/DemoConfiguration.java
@@ -124,14 +124,21 @@ public class DemoConfiguration extends Lifecycle
return userManager.getUsers();
}
- public synchronized long getIdleTime()
+ public synchronized long getTimeoutMillis()
{
- return System.currentTimeMillis() - lastAccess;
+ long idleTime = System.currentTimeMillis() - lastAccess;
+ long time = DemoServer.MAX_IDLE_TIME - idleTime;
+ if (time < 0)
+ {
+ time = 0;
+ }
+
+ return time;
}
- public String formatIdleTime()
+ public String formatTimeoutMinutes()
{
- return MessageFormat.format("{0,time,mm:ss}", getIdleTime());
+ return MessageFormat.format("{0,time,mm:ss}", getTimeoutMillis());
}
@Override
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 774a52a771..d1c09bbfea 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
@@ -139,7 +139,7 @@ public class DemoServer extends OSGiApplication
protected void cleanIfNeeded(DemoConfiguration config)
{
- if (config.getIdleTime() > MAX_IDLE_TIME)
+ if (config.getTimeoutMillis() == 0)
{
synchronized (configs)
{
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/templates/configOverview.htmljet b/plugins/org.eclipse.emf.cdo.examples.server/templates/configOverview.htmljet
index 0acd5c1c5d..1c8745aeba 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/templates/configOverview.htmljet
+++ b/plugins/org.eclipse.emf.cdo.examples.server/templates/configOverview.htmljet
@@ -34,7 +34,7 @@
<% } %>
</td></tr>
</td></tr>
- <tr><td>Idle Time:</td><td><%=AbstractTemplateServlet.html(config.formatIdleTime())%></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>

Back to the top