diff options
author | Eike Stepper | 2012-07-19 08:22:04 +0000 |
---|---|---|
committer | Eike Stepper | 2012-07-19 08:22:04 +0000 |
commit | 1460904fd3c193ffaf809913b2983a400fce9d94 (patch) | |
tree | 72f3a17b75fedba3ae1060df1d32c9c7889be954 /plugins/org.eclipse.emf.cdo.examples | |
parent | 5f360965ae87478e0681899bf310a210cafc2c44 (diff) | |
download | cdo-1460904fd3c193ffaf809913b2983a400fce9d94.tar.gz cdo-1460904fd3c193ffaf809913b2983a400fce9d94.tar.xz cdo-1460904fd3c193ffaf809913b2983a400fce9d94.zip |
Fix line endings in master (dos2unix)
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.examples')
14 files changed, 962 insertions, 962 deletions
diff --git a/plugins/org.eclipse.emf.cdo.examples/.settings/.api_filters b/plugins/org.eclipse.emf.cdo.examples/.settings/.api_filters index 297694f3c8..6326aba979 100644 --- a/plugins/org.eclipse.emf.cdo.examples/.settings/.api_filters +++ b/plugins/org.eclipse.emf.cdo.examples/.settings/.api_filters @@ -1,199 +1,199 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<component id="org.eclipse.emf.cdo.examples" version="2">
- <resource path="src/org/eclipse/emf/cdo/examples/ImportXML.java" type="org.eclipse.emf.cdo.examples.ImportXML">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.ImportXML"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.ImportXML"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/examples/StandaloneContainerExample.java" type="org.eclipse.emf.cdo.examples.StandaloneContainerExample">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.StandaloneContainerExample"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.StandaloneContainerExample"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/examples/StandaloneContainerExampleSSL.java" type="org.eclipse.emf.cdo.examples.StandaloneContainerExampleSSL">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.StandaloneContainerExampleSSL"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.StandaloneContainerExampleSSL"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java" type="org.eclipse.emf.cdo.examples.StandaloneManualExample">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.StandaloneManualExample"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.StandaloneManualExample"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/examples/TransactionMonitoring.java" type="org.eclipse.emf.cdo.examples.TransactionMonitoring">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.TransactionMonitoring"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.TransactionMonitoring"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/examples/VariousExamples.java" type="org.eclipse.emf.cdo.examples.VariousExamples">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.VariousExamples"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.VariousExamples"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/examples/Webinar20090129.java" type="org.eclipse.emf.cdo.examples.Webinar20090129">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.Webinar20090129"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.Webinar20090129"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/examples/server/FailoverExample.java" type="org.eclipse.emf.cdo.examples.server.FailoverExample">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.FailoverExample"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.FailoverExample"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/examples/server/Server.java" type="org.eclipse.emf.cdo.examples.server.Server">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.Server"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.Server"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/examples/server/offline/AbstractOfflineExampleServer.java" type="org.eclipse.emf.cdo.examples.server.offline.AbstractOfflineExampleServer">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.offline.AbstractOfflineExampleServer"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.offline.AbstractOfflineExampleServer"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/examples/server/offline/OfflineExampleClient.java" type="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleClient">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleClient"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleClient"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/examples/server/offline/OfflineExampleClone.java" type="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleClone">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleClone"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleClone"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/examples/server/offline/OfflineExampleMaster.java" type="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleMaster">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleMaster"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleMaster"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/examples/server/offline/OfflineExampleUtil.java" type="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleUtil">
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleUtil"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/>
- </message_arguments>
- </filter>
- <filter id="305365105">
- <message_arguments>
- <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleUtil"/>
- <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/>
- </message_arguments>
- </filter>
- </resource>
-</component>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<component id="org.eclipse.emf.cdo.examples" version="2"> + <resource path="src/org/eclipse/emf/cdo/examples/ImportXML.java" type="org.eclipse.emf.cdo.examples.ImportXML"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.ImportXML"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.ImportXML"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/emf/cdo/examples/StandaloneContainerExample.java" type="org.eclipse.emf.cdo.examples.StandaloneContainerExample"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.StandaloneContainerExample"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.StandaloneContainerExample"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/emf/cdo/examples/StandaloneContainerExampleSSL.java" type="org.eclipse.emf.cdo.examples.StandaloneContainerExampleSSL"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.StandaloneContainerExampleSSL"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.StandaloneContainerExampleSSL"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java" type="org.eclipse.emf.cdo.examples.StandaloneManualExample"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.StandaloneManualExample"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.StandaloneManualExample"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/emf/cdo/examples/TransactionMonitoring.java" type="org.eclipse.emf.cdo.examples.TransactionMonitoring"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.TransactionMonitoring"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.TransactionMonitoring"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/emf/cdo/examples/VariousExamples.java" type="org.eclipse.emf.cdo.examples.VariousExamples"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.VariousExamples"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.VariousExamples"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/emf/cdo/examples/Webinar20090129.java" type="org.eclipse.emf.cdo.examples.Webinar20090129"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.Webinar20090129"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.Webinar20090129"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/emf/cdo/examples/server/FailoverExample.java" type="org.eclipse.emf.cdo.examples.server.FailoverExample"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.FailoverExample"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.FailoverExample"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/emf/cdo/examples/server/Server.java" type="org.eclipse.emf.cdo.examples.server.Server"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.Server"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.Server"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/emf/cdo/examples/server/offline/AbstractOfflineExampleServer.java" type="org.eclipse.emf.cdo.examples.server.offline.AbstractOfflineExampleServer"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.offline.AbstractOfflineExampleServer"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.offline.AbstractOfflineExampleServer"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/emf/cdo/examples/server/offline/OfflineExampleClient.java" type="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleClient"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleClient"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleClient"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/emf/cdo/examples/server/offline/OfflineExampleClone.java" type="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleClone"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleClone"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleClone"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/emf/cdo/examples/server/offline/OfflineExampleMaster.java" type="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleMaster"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleMaster"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleMaster"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/emf/cdo/examples/server/offline/OfflineExampleUtil.java" type="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleUtil"> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleUtil"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.0"/> + </message_arguments> + </filter> + <filter id="305365105"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.examples.server.offline.OfflineExampleUtil"/> + <message_argument value="org.eclipse.emf.cdo.examples_4.0.100"/> + </message_arguments> + </filter> + </resource> +</component> diff --git a/plugins/org.eclipse.emf.cdo.examples/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.emf.cdo.examples/.settings/org.eclipse.core.resources.prefs index 7c467b701d..90b20414ac 100644 --- a/plugins/org.eclipse.emf.cdo.examples/.settings/org.eclipse.core.resources.prefs +++ b/plugins/org.eclipse.emf.cdo.examples/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,3 @@ -#Mon Jul 04 12:57:50 CEST 2011
-eclipse.preferences.version=1
-encoding//model/org.eclipse.emf.cdo.defs.ecorediag=UTF-8
+#Mon Jul 04 12:57:50 CEST 2011 +eclipse.preferences.version=1 +encoding//model/org.eclipse.emf.cdo.defs.ecorediag=UTF-8 diff --git a/plugins/org.eclipse.emf.cdo.examples/about.properties b/plugins/org.eclipse.emf.cdo.examples/about.properties index 48672211ca..19059e3c6d 100644 --- a/plugins/org.eclipse.emf.cdo.examples/about.properties +++ b/plugins/org.eclipse.emf.cdo.examples/about.properties @@ -1,31 +1,31 @@ -# Copyright (c) 2004 - 2012 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
-
-# NLS_MESSAGEFORMAT_VAR
-
-# ==============================================================================
-# Do not change the properties between this line and the last line containing:
-# %%% END OF TRANSLATED PROPERTIES %%%
-# Instead, either redefine an existing property, or create a new property,
-# append it to the end of the file, and change the code to use the new name.
-# ==============================================================================
-
-featureName = CDO Model Repository Examples
-featureText = CDO Model Repository Examples\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others. All rights reserved.\n\
-\n\
-Visit http://www.eclipse.org/cdo
-
-# ==============================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# The above properties have been shipped for translation.
-# ==============================================================================
+# Copyright (c) 2004 - 2012 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 + +# NLS_MESSAGEFORMAT_VAR + +# ============================================================================== +# Do not change the properties between this line and the last line containing: +# %%% END OF TRANSLATED PROPERTIES %%% +# Instead, either redefine an existing property, or create a new property, +# append it to the end of the file, and change the code to use the new name. +# ============================================================================== + +featureName = CDO Model Repository Examples +featureText = CDO Model Repository Examples\n\ +Version: {featureVersion}\n\ +Build id: {0}\n\ +\n\ +Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others. All rights reserved.\n\ +\n\ +Visit http://www.eclipse.org/cdo + +# ============================================================================== +# %%% END OF TRANSLATED PROPERTIES %%% +# The above properties have been shipped for translation. +# ============================================================================== diff --git a/plugins/org.eclipse.emf.cdo.examples/copyright.txt b/plugins/org.eclipse.emf.cdo.examples/copyright.txt index 8f6328980e..0a0f67e6d7 100644 --- a/plugins/org.eclipse.emf.cdo.examples/copyright.txt +++ b/plugins/org.eclipse.emf.cdo.examples/copyright.txt @@ -1,8 +1,8 @@ -Copyright (c) 2004 - 2012 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:
+Copyright (c) 2004 - 2012 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
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.examples/plugin.properties b/plugins/org.eclipse.emf.cdo.examples/plugin.properties index 262488c712..d1fa69fba2 100644 --- a/plugins/org.eclipse.emf.cdo.examples/plugin.properties +++ b/plugins/org.eclipse.emf.cdo.examples/plugin.properties @@ -1,11 +1,11 @@ -# Copyright (c) 2004 - 2012 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
-
-pluginName = CDO Model Repository Examples
-providerName = Eclipse Modeling Project
+# Copyright (c) 2004 - 2012 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 + +pluginName = CDO Model Repository Examples +providerName = Eclipse Modeling Project diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/ImportXML.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/ImportXML.java index 9b21aff15b..b4b74d511d 100644 --- a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/ImportXML.java +++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/ImportXML.java @@ -1,118 +1,118 @@ -/*
- * Copyright (c) 2004 - 2012 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
- */
-package org.eclipse.emf.cdo.examples;
-
-import org.eclipse.emf.cdo.examples.company.Category;
-import org.eclipse.emf.cdo.examples.company.CompanyFactory;
-import org.eclipse.emf.cdo.examples.company.Product;
-import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration;
-import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
-import org.eclipse.emf.cdo.server.CDOServerUtil;
-import org.eclipse.emf.cdo.server.IRepository;
-import org.eclipse.emf.cdo.server.IStore;
-import org.eclipse.emf.cdo.server.mem.MEMStoreUtil;
-import org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil;
-import org.eclipse.emf.cdo.session.CDOSession;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.util.CommitException;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.connector.IConnector;
-import org.eclipse.net4j.jvm.JVMUtil;
-import org.eclipse.net4j.util.container.ContainerUtil;
-import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.net4j.util.om.OMPlatform;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Eike Stepper
- * @since 4.0
- */
-public class ImportXML
-{
- private static final String REPOSITORY_NAME = "repo1";
-
- public static void main(String[] args) throws CommitException
- {
- // Turn on tracing
- OMPlatform.INSTANCE.setDebugging(true);
-
- // Prepare the standalone infra structure (not needed when running inside Eclipse)
- IManagedContainer container = ContainerUtil.createContainer(); // Create a wiring container
- Net4jUtil.prepareContainer(container); // Prepare the Net4j kernel
- JVMUtil.prepareContainer(container); // Prepare the JVM transport
- CDONet4jServerUtil.prepareContainer(container); // Prepare the CDO server
- CDONet4jUtil.prepareContainer(container); // Prepare the CDO client
- container.activate();
-
- // Start the transport and create a repository
- JVMUtil.getAcceptor(container, "default"); // Start the JVM transport
- CDOServerUtil.addRepository(container, createRepository()); // Start a CDO repository
-
- // Establish a communications connection and open a session with the repository
- IConnector connector = JVMUtil.getConnector(container, "default"); // Open a JVM connection
- CDOSession session = openSession(connector);// Open a CDO session
-
- CDOTransaction transaction = session.openTransaction();// Open a CDO transaction
- Resource resource = transaction.createResource("/my/big/resource");// Create a new EMF resource
-
- // Work normally with the EMF resource
- EObject inputModel = getInputModel();
- resource.getContents().add(inputModel);
- transaction.commit();
- session.close();
- connector.close();
- }
-
- private static IRepository createRepository()
- {
- Map<String, String> props = new HashMap<String, String>();
- return CDOServerUtil.createRepository(REPOSITORY_NAME, createStore(), props);
- }
-
- private static IStore createStore()
- {
- // You might want to create an IDBStore here instead if memory is an issue!
- return MEMStoreUtil.createMEMStore();
- }
-
- private static EObject getInputModel()
- {
- Category cat1 = CompanyFactory.eINSTANCE.createCategory();
- cat1.setName("CAT1");
- Category cat2 = CompanyFactory.eINSTANCE.createCategory();
- cat2.setName("CAT2");
- cat1.getCategories().add(cat2);
- Product p1 = CompanyFactory.eINSTANCE.createProduct();
- p1.setName("P1");
- cat1.getProducts().add(p1);
- Product p2 = CompanyFactory.eINSTANCE.createProduct();
- p2.setName("P2");
- cat1.getProducts().add(p2);
- Product p3 = CompanyFactory.eINSTANCE.createProduct();
- p3.setName("P3");
- cat2.getProducts().add(p3);
- return cat1;
- }
-
- protected static CDOSession openSession(IConnector connector)
- {
- CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration();
- configuration.setConnector(connector);
- configuration.setRepositoryName(REPOSITORY_NAME);
- return configuration.openNet4jSession();
- }
-}
+/* + * Copyright (c) 2004 - 2012 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 + */ +package org.eclipse.emf.cdo.examples; + +import org.eclipse.emf.cdo.examples.company.Category; +import org.eclipse.emf.cdo.examples.company.CompanyFactory; +import org.eclipse.emf.cdo.examples.company.Product; +import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; +import org.eclipse.emf.cdo.net4j.CDONet4jUtil; +import org.eclipse.emf.cdo.server.CDOServerUtil; +import org.eclipse.emf.cdo.server.IRepository; +import org.eclipse.emf.cdo.server.IStore; +import org.eclipse.emf.cdo.server.mem.MEMStoreUtil; +import org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil; +import org.eclipse.emf.cdo.session.CDOSession; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.util.CommitException; + +import org.eclipse.net4j.Net4jUtil; +import org.eclipse.net4j.connector.IConnector; +import org.eclipse.net4j.jvm.JVMUtil; +import org.eclipse.net4j.util.container.ContainerUtil; +import org.eclipse.net4j.util.container.IManagedContainer; +import org.eclipse.net4j.util.om.OMPlatform; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Eike Stepper + * @since 4.0 + */ +public class ImportXML +{ + private static final String REPOSITORY_NAME = "repo1"; + + public static void main(String[] args) throws CommitException + { + // Turn on tracing + OMPlatform.INSTANCE.setDebugging(true); + + // Prepare the standalone infra structure (not needed when running inside Eclipse) + IManagedContainer container = ContainerUtil.createContainer(); // Create a wiring container + Net4jUtil.prepareContainer(container); // Prepare the Net4j kernel + JVMUtil.prepareContainer(container); // Prepare the JVM transport + CDONet4jServerUtil.prepareContainer(container); // Prepare the CDO server + CDONet4jUtil.prepareContainer(container); // Prepare the CDO client + container.activate(); + + // Start the transport and create a repository + JVMUtil.getAcceptor(container, "default"); // Start the JVM transport + CDOServerUtil.addRepository(container, createRepository()); // Start a CDO repository + + // Establish a communications connection and open a session with the repository + IConnector connector = JVMUtil.getConnector(container, "default"); // Open a JVM connection + CDOSession session = openSession(connector);// Open a CDO session + + CDOTransaction transaction = session.openTransaction();// Open a CDO transaction + Resource resource = transaction.createResource("/my/big/resource");// Create a new EMF resource + + // Work normally with the EMF resource + EObject inputModel = getInputModel(); + resource.getContents().add(inputModel); + transaction.commit(); + session.close(); + connector.close(); + } + + private static IRepository createRepository() + { + Map<String, String> props = new HashMap<String, String>(); + return CDOServerUtil.createRepository(REPOSITORY_NAME, createStore(), props); + } + + private static IStore createStore() + { + // You might want to create an IDBStore here instead if memory is an issue! + return MEMStoreUtil.createMEMStore(); + } + + private static EObject getInputModel() + { + Category cat1 = CompanyFactory.eINSTANCE.createCategory(); + cat1.setName("CAT1"); + Category cat2 = CompanyFactory.eINSTANCE.createCategory(); + cat2.setName("CAT2"); + cat1.getCategories().add(cat2); + Product p1 = CompanyFactory.eINSTANCE.createProduct(); + p1.setName("P1"); + cat1.getProducts().add(p1); + Product p2 = CompanyFactory.eINSTANCE.createProduct(); + p2.setName("P2"); + cat1.getProducts().add(p2); + Product p3 = CompanyFactory.eINSTANCE.createProduct(); + p3.setName("P3"); + cat2.getProducts().add(p3); + return cat1; + } + + protected static CDOSession openSession(IConnector connector) + { + CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration(); + configuration.setConnector(connector); + configuration.setRepositoryName(REPOSITORY_NAME); + return configuration.openNet4jSession(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneContainerExample.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneContainerExample.java index 612ec5a4a6..c1e0735216 100644 --- a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneContainerExample.java +++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneContainerExample.java @@ -1,80 +1,80 @@ -/*
- * Copyright (c) 2004 - 2012 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
- */
-package org.eclipse.emf.cdo.examples;
-
-import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.examples.company.CompanyFactory;
-import org.eclipse.emf.cdo.examples.company.CompanyPackage;
-import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration;
-import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
-import org.eclipse.emf.cdo.session.CDOSession;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.util.CommitException;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.connector.IConnector;
-import org.eclipse.net4j.tcp.TCPUtil;
-import org.eclipse.net4j.util.container.ContainerUtil;
-import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.log.PrintLogHandler;
-import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * @author Eike Stepper
- */
-public class StandaloneContainerExample
-{
- public static void main(String[] args) throws CommitException
- {
- // Enable logging and tracing
- OMPlatform.INSTANCE.setDebugging(true);
- OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
- OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
-
- // Prepare container
- IManagedContainer container = ContainerUtil.createContainer();
- Net4jUtil.prepareContainer(container); // Register Net4j factories
- TCPUtil.prepareContainer(container); // Register TCP factories
- CDONet4jUtil.prepareContainer(container); // Register CDO factories
- container.activate();
-
- // Create connector
- IConnector connector = TCPUtil.getConnector(container, "localhost:2036"); //$NON-NLS-1$
-
- // Create configuration
- CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration();
- configuration.setConnector(connector);
- configuration.setRepositoryName("repo1"); //$NON-NLS-1$
-
- // Open session
- CDOSession session = configuration.openNet4jSession();
- session.getPackageRegistry().putEPackage(CompanyPackage.eINSTANCE);
-
- // Open transaction
- CDOTransaction transaction = session.openTransaction();
-
- // Get or create resource
- CDOResource resource = transaction.getOrCreateResource("/path/to/my/resource"); //$NON-NLS-1$
-
- // Work with the resource and commit the transaction
- EObject object = CompanyFactory.eINSTANCE.createCompany();
- resource.getContents().add(object);
- transaction.commit();
-
- // Cleanup
- session.close();
- connector.close();
- container.deactivate();
- }
-}
+/* + * Copyright (c) 2004 - 2012 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 + */ +package org.eclipse.emf.cdo.examples; + +import org.eclipse.emf.cdo.eresource.CDOResource; +import org.eclipse.emf.cdo.examples.company.CompanyFactory; +import org.eclipse.emf.cdo.examples.company.CompanyPackage; +import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; +import org.eclipse.emf.cdo.net4j.CDONet4jUtil; +import org.eclipse.emf.cdo.session.CDOSession; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.util.CommitException; + +import org.eclipse.net4j.Net4jUtil; +import org.eclipse.net4j.connector.IConnector; +import org.eclipse.net4j.tcp.TCPUtil; +import org.eclipse.net4j.util.container.ContainerUtil; +import org.eclipse.net4j.util.container.IManagedContainer; +import org.eclipse.net4j.util.om.OMPlatform; +import org.eclipse.net4j.util.om.log.PrintLogHandler; +import org.eclipse.net4j.util.om.trace.PrintTraceHandler; + +import org.eclipse.emf.ecore.EObject; + +/** + * @author Eike Stepper + */ +public class StandaloneContainerExample +{ + public static void main(String[] args) throws CommitException + { + // Enable logging and tracing + OMPlatform.INSTANCE.setDebugging(true); + OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE); + OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE); + + // Prepare container + IManagedContainer container = ContainerUtil.createContainer(); + Net4jUtil.prepareContainer(container); // Register Net4j factories + TCPUtil.prepareContainer(container); // Register TCP factories + CDONet4jUtil.prepareContainer(container); // Register CDO factories + container.activate(); + + // Create connector + IConnector connector = TCPUtil.getConnector(container, "localhost:2036"); //$NON-NLS-1$ + + // Create configuration + CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration(); + configuration.setConnector(connector); + configuration.setRepositoryName("repo1"); //$NON-NLS-1$ + + // Open session + CDOSession session = configuration.openNet4jSession(); + session.getPackageRegistry().putEPackage(CompanyPackage.eINSTANCE); + + // Open transaction + CDOTransaction transaction = session.openTransaction(); + + // Get or create resource + CDOResource resource = transaction.getOrCreateResource("/path/to/my/resource"); //$NON-NLS-1$ + + // Work with the resource and commit the transaction + EObject object = CompanyFactory.eINSTANCE.createCompany(); + resource.getContents().add(object); + transaction.commit(); + + // Cleanup + session.close(); + connector.close(); + container.deactivate(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneContainerExampleSSL.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneContainerExampleSSL.java index e84e5a4559..6dbee4f32c 100644 --- a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneContainerExampleSSL.java +++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneContainerExampleSSL.java @@ -1,91 +1,91 @@ -/*
- * Copyright (c) 2004 - 2012 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
- */
-package org.eclipse.emf.cdo.examples;
-
-import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.examples.company.CompanyFactory;
-import org.eclipse.emf.cdo.examples.company.CompanyPackage;
-import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration;
-import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
-import org.eclipse.emf.cdo.session.CDOSession;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.util.CommitException;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.connector.IConnector;
-import org.eclipse.net4j.tcp.ssl.SSLUtil;
-import org.eclipse.net4j.util.container.ContainerUtil;
-import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.log.PrintLogHandler;
-import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
-
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * @author Eike Stepper
- * @since 4.0
- */
-public class StandaloneContainerExampleSSL
-{
- public static void main(String[] args) throws CommitException
- {
- // Enable logging and tracing
- OMPlatform.INSTANCE.setDebugging(true);
- OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
- OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
-
- // Prepare container
- IManagedContainer container = ContainerUtil.createContainer();
- Net4jUtil.prepareContainer(container); // Register Net4j factories
- SSLUtil.prepareContainer(container);
- CDONet4jUtil.prepareContainer(container); // Register CDO factories
- container.activate();
-
- // Create connector
- IConnector connector = SSLUtil.getConnector(container, "localhost:2036");
-
- // Create configuration
- CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration();
- configuration.setConnector(connector);
- configuration.setRepositoryName("repo1"); //$NON-NLS-1$
-
- // Open session
- CDOSession session = configuration.openNet4jSession();
- session.options().setGeneratedPackageEmulationEnabled(true);
-
- session.getPackageRegistry().putEPackage(CompanyPackage.eINSTANCE);
-
- // Open transaction
- CDOTransaction transaction = session.openTransaction();
-
- // Read whatetever is there
- TreeIterator<EObject> iter = transaction.getRootResource().getAllContents();
- while (iter.hasNext())
- {
- System.out.println("---> It's a " + iter.next().eClass().getName());
- }
-
- // Get or create resource
- CDOResource resource = transaction.getOrCreateResource("/path/to/my/resource"); //$NON-NLS-1$
-
- // Work with the resource and commit the transaction
- EObject object = CompanyFactory.eINSTANCE.createCompany();
- resource.getContents().add(object);
- transaction.commit();
-
- // Cleanup
- session.close();
- connector.close();
- container.deactivate();
- }
-}
+/* + * Copyright (c) 2004 - 2012 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 + */ +package org.eclipse.emf.cdo.examples; + +import org.eclipse.emf.cdo.eresource.CDOResource; +import org.eclipse.emf.cdo.examples.company.CompanyFactory; +import org.eclipse.emf.cdo.examples.company.CompanyPackage; +import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; +import org.eclipse.emf.cdo.net4j.CDONet4jUtil; +import org.eclipse.emf.cdo.session.CDOSession; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.util.CommitException; + +import org.eclipse.net4j.Net4jUtil; +import org.eclipse.net4j.connector.IConnector; +import org.eclipse.net4j.tcp.ssl.SSLUtil; +import org.eclipse.net4j.util.container.ContainerUtil; +import org.eclipse.net4j.util.container.IManagedContainer; +import org.eclipse.net4j.util.om.OMPlatform; +import org.eclipse.net4j.util.om.log.PrintLogHandler; +import org.eclipse.net4j.util.om.trace.PrintTraceHandler; + +import org.eclipse.emf.common.util.TreeIterator; +import org.eclipse.emf.ecore.EObject; + +/** + * @author Eike Stepper + * @since 4.0 + */ +public class StandaloneContainerExampleSSL +{ + public static void main(String[] args) throws CommitException + { + // Enable logging and tracing + OMPlatform.INSTANCE.setDebugging(true); + OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE); + OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE); + + // Prepare container + IManagedContainer container = ContainerUtil.createContainer(); + Net4jUtil.prepareContainer(container); // Register Net4j factories + SSLUtil.prepareContainer(container); + CDONet4jUtil.prepareContainer(container); // Register CDO factories + container.activate(); + + // Create connector + IConnector connector = SSLUtil.getConnector(container, "localhost:2036"); + + // Create configuration + CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration(); + configuration.setConnector(connector); + configuration.setRepositoryName("repo1"); //$NON-NLS-1$ + + // Open session + CDOSession session = configuration.openNet4jSession(); + session.options().setGeneratedPackageEmulationEnabled(true); + + session.getPackageRegistry().putEPackage(CompanyPackage.eINSTANCE); + + // Open transaction + CDOTransaction transaction = session.openTransaction(); + + // Read whatetever is there + TreeIterator<EObject> iter = transaction.getRootResource().getAllContents(); + while (iter.hasNext()) + { + System.out.println("---> It's a " + iter.next().eClass().getName()); + } + + // Get or create resource + CDOResource resource = transaction.getOrCreateResource("/path/to/my/resource"); //$NON-NLS-1$ + + // Work with the resource and commit the transaction + EObject object = CompanyFactory.eINSTANCE.createCompany(); + resource.getContents().add(object); + transaction.commit(); + + // Cleanup + session.close(); + connector.close(); + container.deactivate(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java index 7b3b983a8d..83742689cd 100644 --- a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java +++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java @@ -1,107 +1,107 @@ -/*
- * Copyright (c) 2004 - 2012 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
- */
-package org.eclipse.emf.cdo.examples;
-
-import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.examples.company.CompanyFactory;
-import org.eclipse.emf.cdo.examples.company.CompanyPackage;
-import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration;
-import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
-import org.eclipse.emf.cdo.session.CDOSession;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.util.CommitException;
-
-import org.eclipse.net4j.FactoriesProtocolProvider;
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.buffer.IBufferProvider;
-import org.eclipse.net4j.protocol.IProtocolProvider;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.log.PrintLogHandler;
-import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
-
-import org.eclipse.emf.ecore.EObject;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
-
-/**
- * @author Eike Stepper
- */
-public class StandaloneManualExample
-{
- public static void main(String[] args) throws CommitException
- {
- // Enable logging and tracing
- OMPlatform.INSTANCE.setDebugging(true);
- OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
- OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
-
- // Prepare receiveExecutor
- final ThreadGroup threadGroup = new ThreadGroup("net4j"); //$NON-NLS-1$
- ExecutorService receiveExecutor = Executors.newCachedThreadPool(new ThreadFactory()
- {
- public Thread newThread(Runnable r)
- {
- Thread thread = new Thread(threadGroup, r);
- thread.setDaemon(true);
- return thread;
- }
- });
-
- // Prepare bufferProvider
- IBufferProvider bufferProvider = Net4jUtil.createBufferPool();
- LifecycleUtil.activate(bufferProvider);
-
- IProtocolProvider protocolProvider = new FactoriesProtocolProvider(
- new org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocolFactory());
-
- // Prepare selector
- org.eclipse.net4j.internal.tcp.TCPSelector selector = new org.eclipse.net4j.internal.tcp.TCPSelector();
- selector.activate();
-
- // Prepare connector
- org.eclipse.net4j.internal.tcp.TCPClientConnector connector = new org.eclipse.net4j.internal.tcp.TCPClientConnector();
- connector.getConfig().setBufferProvider(bufferProvider);
- connector.getConfig().setReceiveExecutor(receiveExecutor);
- connector.getConfig().setProtocolProvider(protocolProvider);
- connector.getConfig().setNegotiator(null);
- connector.setSelector(selector);
- connector.setHost("localhost"); //$NON-NLS-1$
- connector.setPort(2036);
- connector.activate();
-
- // Create configuration
- CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration();
- configuration.setConnector(connector);
- configuration.setRepositoryName("repo1"); //$NON-NLS-1$
-
- // Open session
- CDOSession session = configuration.openNet4jSession();
- session.getPackageRegistry().putEPackage(CompanyPackage.eINSTANCE);
-
- // Open transaction
- CDOTransaction transaction = session.openTransaction();
-
- // Get or create resource
- CDOResource resource = transaction.getOrCreateResource("/path/to/my/resource"); //$NON-NLS-1$
-
- // Work with the resource and commit the transaction
- EObject object = CompanyFactory.eINSTANCE.createCompany();
- resource.getContents().add(object);
- transaction.commit();
-
- // Cleanup
- session.close();
- connector.deactivate();
- }
-}
+/* + * Copyright (c) 2004 - 2012 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 + */ +package org.eclipse.emf.cdo.examples; + +import org.eclipse.emf.cdo.eresource.CDOResource; +import org.eclipse.emf.cdo.examples.company.CompanyFactory; +import org.eclipse.emf.cdo.examples.company.CompanyPackage; +import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; +import org.eclipse.emf.cdo.net4j.CDONet4jUtil; +import org.eclipse.emf.cdo.session.CDOSession; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.util.CommitException; + +import org.eclipse.net4j.FactoriesProtocolProvider; +import org.eclipse.net4j.Net4jUtil; +import org.eclipse.net4j.buffer.IBufferProvider; +import org.eclipse.net4j.protocol.IProtocolProvider; +import org.eclipse.net4j.util.lifecycle.LifecycleUtil; +import org.eclipse.net4j.util.om.OMPlatform; +import org.eclipse.net4j.util.om.log.PrintLogHandler; +import org.eclipse.net4j.util.om.trace.PrintTraceHandler; + +import org.eclipse.emf.ecore.EObject; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; + +/** + * @author Eike Stepper + */ +public class StandaloneManualExample +{ + public static void main(String[] args) throws CommitException + { + // Enable logging and tracing + OMPlatform.INSTANCE.setDebugging(true); + OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE); + OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE); + + // Prepare receiveExecutor + final ThreadGroup threadGroup = new ThreadGroup("net4j"); //$NON-NLS-1$ + ExecutorService receiveExecutor = Executors.newCachedThreadPool(new ThreadFactory() + { + public Thread newThread(Runnable r) + { + Thread thread = new Thread(threadGroup, r); + thread.setDaemon(true); + return thread; + } + }); + + // Prepare bufferProvider + IBufferProvider bufferProvider = Net4jUtil.createBufferPool(); + LifecycleUtil.activate(bufferProvider); + + IProtocolProvider protocolProvider = new FactoriesProtocolProvider( + new org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocolFactory()); + + // Prepare selector + org.eclipse.net4j.internal.tcp.TCPSelector selector = new org.eclipse.net4j.internal.tcp.TCPSelector(); + selector.activate(); + + // Prepare connector + org.eclipse.net4j.internal.tcp.TCPClientConnector connector = new org.eclipse.net4j.internal.tcp.TCPClientConnector(); + connector.getConfig().setBufferProvider(bufferProvider); + connector.getConfig().setReceiveExecutor(receiveExecutor); + connector.getConfig().setProtocolProvider(protocolProvider); + connector.getConfig().setNegotiator(null); + connector.setSelector(selector); + connector.setHost("localhost"); //$NON-NLS-1$ + connector.setPort(2036); + connector.activate(); + + // Create configuration + CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration(); + configuration.setConnector(connector); + configuration.setRepositoryName("repo1"); //$NON-NLS-1$ + + // Open session + CDOSession session = configuration.openNet4jSession(); + session.getPackageRegistry().putEPackage(CompanyPackage.eINSTANCE); + + // Open transaction + CDOTransaction transaction = session.openTransaction(); + + // Get or create resource + CDOResource resource = transaction.getOrCreateResource("/path/to/my/resource"); //$NON-NLS-1$ + + // Work with the resource and commit the transaction + EObject object = CompanyFactory.eINSTANCE.createCompany(); + resource.getContents().add(object); + transaction.commit(); + + // Cleanup + session.close(); + connector.deactivate(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/TransactionMonitoring.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/TransactionMonitoring.java index 532f6232dd..6c6336aa0b 100644 --- a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/TransactionMonitoring.java +++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/TransactionMonitoring.java @@ -1,68 +1,68 @@ -/*
- * Copyright (c) 2004 - 2012 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
- */
-package org.eclipse.emf.cdo.examples;
-
-import org.eclipse.emf.cdo.examples.company.CompanyFactory;
-import org.eclipse.emf.cdo.examples.company.CompanyPackage;
-import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration;
-import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
-import org.eclipse.emf.cdo.session.CDOSession;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.util.CommitException;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.tcp.TCPUtil;
-import org.eclipse.net4j.util.container.ContainerUtil;
-import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.log.PrintLogHandler;
-import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
-
-import org.eclipse.emf.ecore.resource.Resource;
-
-/**
- * @author Eike Stepper
- * @since 4.0
- */
-public class TransactionMonitoring
-{
- public static void main(String[] args) throws CommitException
- {
- OMPlatform.INSTANCE.setDebugging(true);
- OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
- OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
-
- IManagedContainer container = ContainerUtil.createContainer();
- Net4jUtil.prepareContainer(container);
- TCPUtil.prepareContainer(container);
- CDONet4jUtil.prepareContainer(container);
- container.activate();
-
- CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration();
- configuration.setConnector(TCPUtil.getConnector(container, "localhost"));
- configuration.setRepositoryName("repo1");
-
- CDOSession session = configuration.openNet4jSession();
- session.getPackageRegistry().putEPackage(CompanyPackage.eINSTANCE);
-
- CDOTransaction transaction = session.openTransaction();
- Resource resource = transaction.createResource("/my/big/resource");
- resource.getContents().add(CompanyFactory.eINSTANCE.createCompany());
- transaction.commit();
-
- System.out.println();
- System.out.println("FINISHED");
- System.out.println();
-
- session.close();
- container.deactivate();
- }
-}
+/* + * Copyright (c) 2004 - 2012 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 + */ +package org.eclipse.emf.cdo.examples; + +import org.eclipse.emf.cdo.examples.company.CompanyFactory; +import org.eclipse.emf.cdo.examples.company.CompanyPackage; +import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; +import org.eclipse.emf.cdo.net4j.CDONet4jUtil; +import org.eclipse.emf.cdo.session.CDOSession; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.util.CommitException; + +import org.eclipse.net4j.Net4jUtil; +import org.eclipse.net4j.tcp.TCPUtil; +import org.eclipse.net4j.util.container.ContainerUtil; +import org.eclipse.net4j.util.container.IManagedContainer; +import org.eclipse.net4j.util.om.OMPlatform; +import org.eclipse.net4j.util.om.log.PrintLogHandler; +import org.eclipse.net4j.util.om.trace.PrintTraceHandler; + +import org.eclipse.emf.ecore.resource.Resource; + +/** + * @author Eike Stepper + * @since 4.0 + */ +public class TransactionMonitoring +{ + public static void main(String[] args) throws CommitException + { + OMPlatform.INSTANCE.setDebugging(true); + OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE); + OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE); + + IManagedContainer container = ContainerUtil.createContainer(); + Net4jUtil.prepareContainer(container); + TCPUtil.prepareContainer(container); + CDONet4jUtil.prepareContainer(container); + container.activate(); + + CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration(); + configuration.setConnector(TCPUtil.getConnector(container, "localhost")); + configuration.setRepositoryName("repo1"); + + CDOSession session = configuration.openNet4jSession(); + session.getPackageRegistry().putEPackage(CompanyPackage.eINSTANCE); + + CDOTransaction transaction = session.openTransaction(); + Resource resource = transaction.createResource("/my/big/resource"); + resource.getContents().add(CompanyFactory.eINSTANCE.createCompany()); + transaction.commit(); + + System.out.println(); + System.out.println("FINISHED"); + System.out.println(); + + session.close(); + container.deactivate(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/VariousExamples.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/VariousExamples.java index dc5d4d52a3..738371300d 100644 --- a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/VariousExamples.java +++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/VariousExamples.java @@ -1,57 +1,57 @@ -/*
- * Copyright (c) 2004 - 2012 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
- */
-package org.eclipse.emf.cdo.examples;
-
-import org.eclipse.emf.cdo.net4j.CDONet4jSession;
-import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration;
-import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.util.CommitException;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.connector.IConnector;
-import org.eclipse.net4j.util.container.IPluginContainer;
-
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-
-/**
- * @author Eike Stepper
- * @since 3.0
- */
-public class VariousExamples
-{
- public static void openSessionAndUseTransaction() throws CommitException
- {
- ResourceSet resourceSet = new ResourceSetImpl();
- IConnector connector = Net4jUtil.getConnector(IPluginContainer.INSTANCE, "tcp", "repos.foo.org:2036");
-
- CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration();
- configuration.setConnector(connector);
- configuration.setRepositoryName("MyRepo");
-
- CDONet4jSession session = configuration.openNet4jSession();
- CDOTransaction transaction = session.openTransaction(resourceSet);
-
- // Work with the resource set....
- transaction.commit();
- session.close();
- }
-
- public static void registerSessionWithPluginContainer() throws CommitException
- {
- CDONet4jSession session = (CDONet4jSession)IPluginContainer.INSTANCE.getElement("org.eclipse.emf.cdo.sessions",
- "cdo", "tcp://repos.foo.org:2036/MyRepo");
- CDOTransaction transaction = session.openTransaction();
- // ...
- transaction.commit();
- }
-}
+/* + * Copyright (c) 2004 - 2012 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 + */ +package org.eclipse.emf.cdo.examples; + +import org.eclipse.emf.cdo.net4j.CDONet4jSession; +import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; +import org.eclipse.emf.cdo.net4j.CDONet4jUtil; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.util.CommitException; + +import org.eclipse.net4j.Net4jUtil; +import org.eclipse.net4j.connector.IConnector; +import org.eclipse.net4j.util.container.IPluginContainer; + +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +/** + * @author Eike Stepper + * @since 3.0 + */ +public class VariousExamples +{ + public static void openSessionAndUseTransaction() throws CommitException + { + ResourceSet resourceSet = new ResourceSetImpl(); + IConnector connector = Net4jUtil.getConnector(IPluginContainer.INSTANCE, "tcp", "repos.foo.org:2036"); + + CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration(); + configuration.setConnector(connector); + configuration.setRepositoryName("MyRepo"); + + CDONet4jSession session = configuration.openNet4jSession(); + CDOTransaction transaction = session.openTransaction(resourceSet); + + // Work with the resource set.... + transaction.commit(); + session.close(); + } + + public static void registerSessionWithPluginContainer() throws CommitException + { + CDONet4jSession session = (CDONet4jSession)IPluginContainer.INSTANCE.getElement("org.eclipse.emf.cdo.sessions", + "cdo", "tcp://repos.foo.org:2036/MyRepo"); + CDOTransaction transaction = session.openTransaction(); + // ... + transaction.commit(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/Webinar20090129.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/Webinar20090129.java index 526cf8831c..dfffcf0c98 100644 --- a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/Webinar20090129.java +++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/Webinar20090129.java @@ -1,56 +1,56 @@ -/*
- * Copyright (c) 2004 - 2012 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
- */
-package org.eclipse.emf.cdo.examples;
-
-import org.eclipse.emf.cdo.examples.company.Company;
-import org.eclipse.emf.cdo.examples.company.CompanyPackage;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl;
-
-import java.io.IOException;
-
-/**
- * @author Eike Stepper
- * @since 2.0
- */
-public class Webinar20090129
-{
- private static final EPackage MODEL = CompanyPackage.eINSTANCE;
-
- public static void xmlSetup() throws IOException
- {
- ResourceSet rs = new ResourceSetImpl();
- rs.getResourceFactoryRegistry().getExtensionToFactoryMap() //
- .put("xml", new XMLResourceFactoryImpl()); //$NON-NLS-1$
- rs.getPackageRegistry().put(MODEL.getNsURI(), MODEL);
-
- URI uri = URI.createFileURI("C:/business/company.xml"); //$NON-NLS-1$
- Resource resource = rs.getResource(uri, true);
- resource.setTrackingModification(true);
-
- Company company = (Company)resource.getContents().get(0);
- executeBusinessLogic(company);
-
- if (resource.isModified())
- {
- resource.save(null);
- }
- }
-
- private static void executeBusinessLogic(Company company)
- {
- }
-}
+/* + * Copyright (c) 2004 - 2012 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 + */ +package org.eclipse.emf.cdo.examples; + +import org.eclipse.emf.cdo.examples.company.Company; +import org.eclipse.emf.cdo.examples.company.CompanyPackage; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl; + +import java.io.IOException; + +/** + * @author Eike Stepper + * @since 2.0 + */ +public class Webinar20090129 +{ + private static final EPackage MODEL = CompanyPackage.eINSTANCE; + + public static void xmlSetup() throws IOException + { + ResourceSet rs = new ResourceSetImpl(); + rs.getResourceFactoryRegistry().getExtensionToFactoryMap() // + .put("xml", new XMLResourceFactoryImpl()); //$NON-NLS-1$ + rs.getPackageRegistry().put(MODEL.getNsURI(), MODEL); + + URI uri = URI.createFileURI("C:/business/company.xml"); //$NON-NLS-1$ + Resource resource = rs.getResource(uri, true); + resource.setTrackingModification(true); + + Company company = (Company)resource.getContents().get(0); + executeBusinessLogic(company); + + if (resource.isModified()) + { + resource.save(null); + } + } + + private static void executeBusinessLogic(Company company) + { + } +} diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/Server.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/Server.java index a6afa863d5..b1cd965878 100644 --- a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/Server.java +++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/Server.java @@ -1,90 +1,90 @@ -/*
- * Copyright (c) 2004 - 2012 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
- */
-package org.eclipse.emf.cdo.examples.server;
-
-import org.eclipse.emf.cdo.server.CDOServerUtil;
-import org.eclipse.emf.cdo.server.IRepository;
-import org.eclipse.emf.cdo.server.IStore;
-import org.eclipse.emf.cdo.server.db.CDODBUtil;
-import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy;
-import org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.db.DBUtil;
-import org.eclipse.net4j.db.IDBAdapter;
-import org.eclipse.net4j.db.IDBConnectionProvider;
-import org.eclipse.net4j.db.h2.H2Adapter;
-import org.eclipse.net4j.tcp.TCPUtil;
-import org.eclipse.net4j.util.container.IPluginContainer;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.log.PrintLogHandler;
-import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
-
-import org.h2.jdbcx.JdbcDataSource;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Eike Stepper
- * @since 4.0
- */
-public class Server
-{
- public static void main(String[] args) throws Exception
- {
- OMPlatform.INSTANCE.setDebugging(true);
- OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
- OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
-
- Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
- TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
- CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
-
- String name = "demo";
- IStore store = createStore(name);
- Map<String, String> properties = createProperties(name);
-
- IRepository repository = CDOServerUtil.createRepository(name, store, properties);
- CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
-
- Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
-
- while (System.in.available() == 0)
- {
- Thread.sleep(100);
- }
-
- LifecycleUtil.deactivate(repository);
- LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
- }
-
- private static IStore createStore(String name)
- {
- JdbcDataSource dataSource = new JdbcDataSource();
- dataSource.setURL("jdbc:h2:database/" + name);
-
- IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
- IDBAdapter dbAdapter = new H2Adapter();
- IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
- return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
- }
-
- private static Map<String, String> createProperties(String name)
- {
- Map<String, String> props = new HashMap<String, String>();
- props.put(IRepository.Props.OVERRIDE_UUID, name);
- props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
- props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
- return props;
- }
-}
+/* + * Copyright (c) 2004 - 2012 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 + */ +package org.eclipse.emf.cdo.examples.server; + +import org.eclipse.emf.cdo.server.CDOServerUtil; +import org.eclipse.emf.cdo.server.IRepository; +import org.eclipse.emf.cdo.server.IStore; +import org.eclipse.emf.cdo.server.db.CDODBUtil; +import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy; +import org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil; + +import org.eclipse.net4j.Net4jUtil; +import org.eclipse.net4j.db.DBUtil; +import org.eclipse.net4j.db.IDBAdapter; +import org.eclipse.net4j.db.IDBConnectionProvider; +import org.eclipse.net4j.db.h2.H2Adapter; +import org.eclipse.net4j.tcp.TCPUtil; +import org.eclipse.net4j.util.container.IPluginContainer; +import org.eclipse.net4j.util.lifecycle.LifecycleUtil; +import org.eclipse.net4j.util.om.OMPlatform; +import org.eclipse.net4j.util.om.log.PrintLogHandler; +import org.eclipse.net4j.util.om.trace.PrintTraceHandler; + +import org.h2.jdbcx.JdbcDataSource; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Eike Stepper + * @since 4.0 + */ +public class Server +{ + public static void main(String[] args) throws Exception + { + OMPlatform.INSTANCE.setDebugging(true); + OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE); + OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE); + + Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel + TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support + CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server + + String name = "demo"; + IStore store = createStore(name); + Map<String, String> properties = createProperties(name); + + IRepository repository = CDOServerUtil.createRepository(name, store, properties); + CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository); + + Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036"); + + while (System.in.available() == 0) + { + Thread.sleep(100); + } + + LifecycleUtil.deactivate(repository); + LifecycleUtil.deactivate(IPluginContainer.INSTANCE); + } + + private static IStore createStore(String name) + { + JdbcDataSource dataSource = new JdbcDataSource(); + dataSource.setURL("jdbc:h2:database/" + name); + + IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true); + IDBAdapter dbAdapter = new H2Adapter(); + IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource); + return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider); + } + + private static Map<String, String> createProperties(String name) + { + Map<String, String> props = new HashMap<String, String>(); + props.put(IRepository.Props.OVERRIDE_UUID, name); + props.put(IRepository.Props.SUPPORTING_AUDITS, "true"); + props.put(IRepository.Props.SUPPORTING_BRANCHES, "true"); + return props; + } +} diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/internal/examples/bundle/OM.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/internal/examples/bundle/OM.java index 734f6913bf..a1309d4884 100644 --- a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/internal/examples/bundle/OM.java +++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/internal/examples/bundle/OM.java @@ -1,44 +1,44 @@ -/*
- * Copyright (c) 2004 - 2012 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
- */
-package org.eclipse.emf.cdo.internal.examples.bundle;
-
-import org.eclipse.net4j.util.om.OMBundle;
-import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.OSGiActivator;
-import org.eclipse.net4j.util.om.log.OMLogger;
-import org.eclipse.net4j.util.om.trace.OMTracer;
-
-/**
- * The <em>Operations & Maintenance</em> class of this bundle.
- *
- * @author Eike Stepper
- */
-public abstract class OM
-{
- public static final String BUNDLE_ID = "org.eclipse.emf.cdo.examples"; //$NON-NLS-1$
-
- public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class);
-
- public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
-
- public static final OMLogger LOG = BUNDLE.logger();
-
- /**
- * @author Eike Stepper
- */
- public static final class Activator extends OSGiActivator
- {
- public Activator()
- {
- super(BUNDLE);
- }
- }
-}
+/* + * Copyright (c) 2004 - 2012 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 + */ +package org.eclipse.emf.cdo.internal.examples.bundle; + +import org.eclipse.net4j.util.om.OMBundle; +import org.eclipse.net4j.util.om.OMPlatform; +import org.eclipse.net4j.util.om.OSGiActivator; +import org.eclipse.net4j.util.om.log.OMLogger; +import org.eclipse.net4j.util.om.trace.OMTracer; + +/** + * The <em>Operations & Maintenance</em> class of this bundle. + * + * @author Eike Stepper + */ +public abstract class OM +{ + public static final String BUNDLE_ID = "org.eclipse.emf.cdo.examples"; //$NON-NLS-1$ + + public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class); + + public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$ + + public static final OMLogger LOG = BUNDLE.logger(); + + /** + * @author Eike Stepper + */ + public static final class Activator extends OSGiActivator + { + public Activator() + { + super(BUNDLE); + } + } +} |