Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-06-17 15:18:52 +0000
committerEike Stepper2012-06-17 15:18:52 +0000
commite0d5c5e96b18887e686fc6530bbcf0afb426bfc9 (patch)
treeb013208ed89ed8c57471a41667c4f969ae0e4934 /plugins
parent131736aef1b315f5a796375fe0ac5e33793d80d6 (diff)
downloadcdo-e0d5c5e96b18887e686fc6530bbcf0afb426bfc9.tar.gz
cdo-e0d5c5e96b18887e686fc6530bbcf0afb426bfc9.tar.xz
cdo-e0d5c5e96b18887e686fc6530bbcf0afb426bfc9.zip
[382225] Provide CDO example installers
https://bugs.eclipse.org/bugs/show_bug.cgi?id=382225
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/gastro.server/GastroServer.launch2
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/gastro.server/src/org/gastro/internal/server/OM.java18
-rw-r--r--plugins/org.gastro.server/GastroServer.launch2
-rw-r--r--plugins/org.gastro.server/src/org/gastro/internal/server/OM.java18
4 files changed, 34 insertions, 6 deletions
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/gastro.server/GastroServer.launch b/plugins/org.eclipse.emf.cdo.examples.installer/examples/gastro.server/GastroServer.launch
index c887148bbf..15b5ebf05c 100644
--- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/gastro.server/GastroServer.launch
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/gastro.server/GastroServer.launch
@@ -23,7 +23,7 @@
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}&#13;&#10;-debug&#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="-Xms40m&#13;&#10;-Xmx1024m&#13;&#10;-Ddebug=true&#13;&#10;-Dorg.osgi.service.http.port=9090&#13;&#10;-Dservlet.config=${workspace_loc:/org.gastro.server.web/config/gastro.properties}"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx1024m&#13;&#10;-Ddebug=true&#13;&#10;-Dorg.osgi.service.http.port=9090&#13;&#10;-Dorg.gastro.server.port=2036&#13;&#10;-Dservlet.config=${workspace_loc:/org.gastro.server.web/config/gastro.properties}"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/org.gastro.server}"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/gastro.server/src/org/gastro/internal/server/OM.java b/plugins/org.eclipse.emf.cdo.examples.installer/examples/gastro.server/src/org/gastro/internal/server/OM.java
index 33e7e40b88..31cfc12f73 100644
--- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/gastro.server/src/org/gastro/internal/server/OM.java
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/gastro.server/src/org/gastro/internal/server/OM.java
@@ -40,7 +40,7 @@ import java.util.Map;
/**
* The <em>Operations & Maintenance</em> class of this bundle.
- *
+ *
* @author Eike Stepper
*/
public abstract class OM
@@ -62,6 +62,8 @@ public abstract class OM
*/
public static final class Activator extends OSGiActivator
{
+ private String serverPort;
+
public Activator()
{
super(BUNDLE);
@@ -70,6 +72,12 @@ public abstract class OM
@Override
protected void doStart() throws Exception
{
+ serverPort = System.getProperty("org.gastro.server.port");
+ if (serverPort == null)
+ {
+ return;
+ }
+
OM.LOG.info("Gastro server starting");
JdbcDataSource dataSource = new JdbcDataSource();
dataSource.setURL("jdbc:h2:database/gastro");
@@ -88,13 +96,19 @@ public abstract class OM
CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE);
- acceptor = (IAcceptor)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.acceptors", "tcp", "0.0.0.0:2036");
+ String description = "0.0.0.0:" + serverPort;
+ acceptor = (IAcceptor)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.acceptors", "tcp", description);
OM.LOG.info("Gastro server started");
}
@Override
protected void doStop() throws Exception
{
+ if (serverPort == null)
+ {
+ return;
+ }
+
OM.LOG.info("Gastro server stopping");
LifecycleUtil.deactivate(acceptor);
LifecycleUtil.deactivate(repository);
diff --git a/plugins/org.gastro.server/GastroServer.launch b/plugins/org.gastro.server/GastroServer.launch
index c887148bbf..15b5ebf05c 100644
--- a/plugins/org.gastro.server/GastroServer.launch
+++ b/plugins/org.gastro.server/GastroServer.launch
@@ -23,7 +23,7 @@
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}&#13;&#10;-debug&#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="-Xms40m&#13;&#10;-Xmx1024m&#13;&#10;-Ddebug=true&#13;&#10;-Dorg.osgi.service.http.port=9090&#13;&#10;-Dservlet.config=${workspace_loc:/org.gastro.server.web/config/gastro.properties}"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx1024m&#13;&#10;-Ddebug=true&#13;&#10;-Dorg.osgi.service.http.port=9090&#13;&#10;-Dorg.gastro.server.port=2036&#13;&#10;-Dservlet.config=${workspace_loc:/org.gastro.server.web/config/gastro.properties}"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/org.gastro.server}"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
diff --git a/plugins/org.gastro.server/src/org/gastro/internal/server/OM.java b/plugins/org.gastro.server/src/org/gastro/internal/server/OM.java
index 33e7e40b88..31cfc12f73 100644
--- a/plugins/org.gastro.server/src/org/gastro/internal/server/OM.java
+++ b/plugins/org.gastro.server/src/org/gastro/internal/server/OM.java
@@ -40,7 +40,7 @@ import java.util.Map;
/**
* The <em>Operations & Maintenance</em> class of this bundle.
- *
+ *
* @author Eike Stepper
*/
public abstract class OM
@@ -62,6 +62,8 @@ public abstract class OM
*/
public static final class Activator extends OSGiActivator
{
+ private String serverPort;
+
public Activator()
{
super(BUNDLE);
@@ -70,6 +72,12 @@ public abstract class OM
@Override
protected void doStart() throws Exception
{
+ serverPort = System.getProperty("org.gastro.server.port");
+ if (serverPort == null)
+ {
+ return;
+ }
+
OM.LOG.info("Gastro server starting");
JdbcDataSource dataSource = new JdbcDataSource();
dataSource.setURL("jdbc:h2:database/gastro");
@@ -88,13 +96,19 @@ public abstract class OM
CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE);
- acceptor = (IAcceptor)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.acceptors", "tcp", "0.0.0.0:2036");
+ String description = "0.0.0.0:" + serverPort;
+ acceptor = (IAcceptor)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.acceptors", "tcp", description);
OM.LOG.info("Gastro server started");
}
@Override
protected void doStop() throws Exception
{
+ if (serverPort == null)
+ {
+ return;
+ }
+
OM.LOG.info("Gastro server stopping");
LifecycleUtil.deactivate(acceptor);
LifecycleUtil.deactivate(repository);

Back to the top