diff options
author | Eike Stepper | 2012-01-14 10:27:01 +0000 |
---|---|---|
committer | Eike Stepper | 2012-01-14 10:27:01 +0000 |
commit | 0266166cb9ff9535c150250073ea1e57b42d2693 (patch) | |
tree | c006a3bc0ba1f6e1d8a2bc032eedc346f71eab0d /plugins/org.eclipse.emf.cdo.examples.server | |
parent | 7416443692cdda72d1f704ea4fc5ececcc669df7 (diff) | |
download | cdo-0266166cb9ff9535c150250073ea1e57b42d2693.tar.gz cdo-0266166cb9ff9535c150250073ea1e57b42d2693.tar.xz cdo-0266166cb9ff9535c150250073ea1e57b42d2693.zip |
Adjusted copyrights to 2012
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.examples.server')
7 files changed, 667 insertions, 667 deletions
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.emf.cdo.examples.server/.settings/org.eclipse.jdt.ui.prefs index aaef0ccba1..6726e7034a 100644 --- a/plugins/org.eclipse.emf.cdo.examples.server/.settings/org.eclipse.jdt.ui.prefs +++ b/plugins/org.eclipse.emf.cdo.examples.server/.settings/org.eclipse.jdt.ui.prefs @@ -1,120 +1,120 @@ -#Thu Feb 04 09:44:24 CET 2010 -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=true -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=true -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=true -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=false -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_parentheses_in_expressions=true -cleanup.use_this_for_non_static_field_access=true -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=true -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup_profile=_EMFT -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_EMFT -formatter_settings_version=11 -org.eclipse.jdt.ui.exception.name=ex -org.eclipse.jdt.ui.gettersetter.use.is=true -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment"/><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Eike Stepper - initial API and implementation\r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author Eike Stepper\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment"/><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=false -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=true -sp_cleanup.format_source_code=true -sp_cleanup.format_source_code_changes_only=false -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=true -sp_cleanup.remove_unused_imports=true -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=true -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=true -sp_cleanup.use_this_for_non_static_field_access=true -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=true -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true +#Thu Feb 04 09:44:24 CET 2010
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=true
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=false
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=true
+cleanup.use_this_for_non_static_field_access=true
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=true
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_EMFT
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_EMFT
+formatter_settings_version=11
+org.eclipse.jdt.ui.exception.name=ex
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment"/><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Eike Stepper - initial API and implementation\r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author Eike Stepper\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment"/><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=false
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=true
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=true
+sp_cleanup.use_this_for_non_static_field_access=true
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=true
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/build.properties b/plugins/org.eclipse.emf.cdo.examples.server/build.properties index 09edc9df23..f965c1742a 100644 --- a/plugins/org.eclipse.emf.cdo.examples.server/build.properties +++ b/plugins/org.eclipse.emf.cdo.examples.server/build.properties @@ -1,21 +1,21 @@ -# Copyright (c) 2004 - 2011 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 - -bin.includes = .,\ - META-INF/,\ - plugin.properties,\ - about.html,\ - copyright.txt -jars.compile.order = . -source.. = src/ -output.. = bin/ -src.includes = about.html,\ - copyright.txt +# 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
+
+bin.includes = .,\
+ META-INF/,\
+ plugin.properties,\
+ about.html,\
+ copyright.txt
+jars.compile.order = .
+source.. = src/
+output.. = bin/
+src.includes = about.html,\
+ copyright.txt
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/copyright.txt b/plugins/org.eclipse.emf.cdo.examples.server/copyright.txt index e921242cf0..8f6328980e 100644 --- a/plugins/org.eclipse.emf.cdo.examples.server/copyright.txt +++ b/plugins/org.eclipse.emf.cdo.examples.server/copyright.txt @@ -1,8 +1,8 @@ -Copyright (c) 2004 - 2011 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.server/plugin.properties b/plugins/org.eclipse.emf.cdo.examples.server/plugin.properties index 98d2b65a32..1521ad266f 100644 --- a/plugins/org.eclipse.emf.cdo.examples.server/plugin.properties +++ b/plugins/org.eclipse.emf.cdo.examples.server/plugin.properties @@ -1,11 +1,11 @@ -# Copyright (c) 2004 - 2011 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 Server -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 Server
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/internal/server/OM.java b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/internal/server/OM.java index 8024620c41..595ee47a41 100644 --- a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/internal/server/OM.java +++ b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/internal/server/OM.java @@ -1,58 +1,58 @@ -/* - * Copyright (c) 2004 - 2011 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.internal.server; - -import org.eclipse.emf.cdo.examples.server.DemoServer; - -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.server"; //$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); - } - - @Override - protected void doStart() throws Exception - { - DemoServer.INSTANCE.activate(); - } - - @Override - protected void doStop() throws Exception - { - DemoServer.INSTANCE.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.internal.server;
+
+import org.eclipse.emf.cdo.examples.server.DemoServer;
+
+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.server"; //$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);
+ }
+
+ @Override
+ protected void doStart() throws Exception
+ {
+ DemoServer.INSTANCE.activate();
+ }
+
+ @Override
+ protected void doStop() throws Exception
+ {
+ DemoServer.INSTANCE.deactivate();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/DemoConfiguration.java b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/DemoConfiguration.java index 6be5c954d2..3064f68e75 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 @@ -1,291 +1,291 @@ -/* - * Copyright (c) 2004 - 2011 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.ISession; -import org.eclipse.emf.cdo.server.db.CDODBUtil; -import org.eclipse.emf.cdo.server.db.IDBStore; -import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy; -import org.eclipse.emf.cdo.spi.server.InternalRepository; -import org.eclipse.emf.cdo.spi.server.InternalSessionManager; - -import org.eclipse.net4j.db.DBUtil; -import org.eclipse.net4j.db.IDBAdapter; -import org.eclipse.net4j.db.IDBConnectionProvider; -import org.eclipse.net4j.signal.ISignalProtocol; -import org.eclipse.net4j.util.StringUtil; -import org.eclipse.net4j.util.container.ContainerEventAdapter; -import org.eclipse.net4j.util.container.IContainer; -import org.eclipse.net4j.util.container.IPluginContainer; -import org.eclipse.net4j.util.event.IEvent; -import org.eclipse.net4j.util.event.IListener; -import org.eclipse.net4j.util.io.IOUtil; -import org.eclipse.net4j.util.lifecycle.Lifecycle; -import org.eclipse.net4j.util.lifecycle.LifecycleUtil; -import org.eclipse.net4j.util.security.IUserManager; -import org.eclipse.net4j.util.security.UserManager; - -import org.h2.jdbcx.JdbcDataSource; - -import javax.sql.DataSource; - -import java.io.File; -import java.text.MessageFormat; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Random; - -/** - * @author Eike Stepper - */ -public class DemoConfiguration extends Lifecycle -{ - public static final int NAME_LENGTH = 10; - - private static final String NAME_ALPHABET = "abcdefghijklmnopqrstuvwxyz"; - - private Mode mode = Mode.NORMAL; - - private String[] userIDs; - - private transient String name; - - private transient InternalRepository repository; - - private DemoUserManager userManager; - - private transient long lastAccess = System.currentTimeMillis(); - - DemoConfiguration(Mode mode, String[] userIDs) - { - this.mode = mode; - if (userIDs != null) - { - if (userIDs.length != 0) - { - if (StringUtil.isEmpty(userIDs[0])) - { - userIDs = null; - } - } - } - - this.userIDs = userIDs; - } - - public Mode getMode() - { - return mode; - } - - public String[] getUserIDs() - { - return userIDs; - } - - public String getName() - { - return name; - } - - public IRepository getRepository() - { - return repository; - } - - public Map<String, char[]> getUsers() - { - if (userManager == null) - { - return Collections.emptyMap(); - } - - return userManager.getUsers(); - } - - public synchronized long getTimeoutMillis() - { - long idleTime = System.currentTimeMillis() - lastAccess; - long time = DemoServer.MAX_IDLE_MILLIS - idleTime; - if (time < 0) - { - time = 0; - } - - return time; - } - - public String formatTimeoutMinutes() - { - return MessageFormat.format("{0,time,mm:ss}", getTimeoutMillis()); - } - - @Override - protected void doActivate() throws Exception - { - name = createRandomName(); - - IDBStore store = createStore(); - - Map<String, String> props = new HashMap<String, String>(); - props.put(IRepository.Props.OVERRIDE_UUID, ""); // Use repo name - props.put(IRepository.Props.SUPPORTING_AUDITS, mode == Mode.NORMAL ? "false" : "true"); - props.put(IRepository.Props.SUPPORTING_BRANCHES, mode == Mode.BRANCHING ? "true" : "false"); - - repository = (InternalRepository)CDOServerUtil.createRepository(name, store, props); - - InternalSessionManager sessionManager = createSessionManager(); - - if (userIDs != null) - { - IUserManager userManager = createUserManager(); - sessionManager.setUserManager(userManager); - } - - CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository); - } - - @Override - protected void doDeactivate() throws Exception - { - if (repository != null) - { - File folder = new File(new File("databases"), repository.getName()); - - LifecycleUtil.deactivate(repository); - repository = null; - - IOUtil.delete(folder); - } - } - - protected String createRandomName() - { - return createRandomString(NAME_LENGTH, NAME_ALPHABET); - } - - protected IDBStore createStore() - { - IMappingStrategy mappingStrategy = createMappingStrategy(); - IDBAdapter dbAdapter = DBUtil.getDBAdapter("h2"); - IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(createDataSource()); - IDBStore store = CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider); - return store; - } - - protected IMappingStrategy createMappingStrategy() - { - switch (mode) - { - case NORMAL: - return CDODBUtil.createHorizontalMappingStrategy(false, false); - case AUDITING: - return CDODBUtil.createHorizontalMappingStrategy(true, false); - case BRANCHING: - return CDODBUtil.createHorizontalMappingStrategy(true, true); - default: - throw new IllegalStateException("Invalid mode: " + mode); - } - } - - protected DataSource createDataSource() - { - JdbcDataSource dataSource = new JdbcDataSource(); - dataSource.setURL("jdbc:h2:databases/" + name + "/h2test"); - return dataSource; - } - - protected InternalSessionManager createSessionManager() - { - InternalSessionManager sessionManager = (InternalSessionManager)CDOServerUtil.createSessionManager(); - repository.setSessionManager(sessionManager); - sessionManager.addListener(new ContainerEventAdapter<ISession>() - { - @Override - protected void onAdded(IContainer<ISession> container, ISession session) - { - ISignalProtocol<?> protocol = (ISignalProtocol<?>)session.getProtocol(); - if (protocol != null) - { - protocol.addListener(new IListener() - { - public void notifyEvent(IEvent event) - { - synchronized (DemoConfiguration.this) - { - lastAccess = System.currentTimeMillis(); - } - } - }); - } - } - }); - - return sessionManager; - } - - protected IUserManager createUserManager() - { - userManager = new DemoUserManager(); - for (int i = 0; i < userIDs.length; i++) - { - String userID = userIDs[i]; - userManager.addUser(userID, ("pw" + (i + 1)).toCharArray()); - } - - userManager.activate(); - return userManager; - } - - public static String createRandomString(int length, String alphabet) - { - Random random = new Random(System.currentTimeMillis()); - StringBuilder builder = new StringBuilder(); - for (int i = 0; i < length; i++) - { - int pos = random.nextInt(alphabet.length()); - builder.append(alphabet.charAt(pos)); - } - - return builder.toString(); - } - - public static String createRandomString(int length) - { - return createRandomString(length, NAME_ALPHABET); - } - - /** - * @author Eike Stepper - */ - private static final class DemoUserManager extends UserManager - { - public DemoUserManager() - { - } - - public Map<String, char[]> getUsers() - { - return users; - } - } - - /** - * @author Eike Stepper - */ - public enum Mode - { - NORMAL, AUDITING, BRANCHING - } -} +/*
+ * 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.ISession;
+import org.eclipse.emf.cdo.server.db.CDODBUtil;
+import org.eclipse.emf.cdo.server.db.IDBStore;
+import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy;
+import org.eclipse.emf.cdo.spi.server.InternalRepository;
+import org.eclipse.emf.cdo.spi.server.InternalSessionManager;
+
+import org.eclipse.net4j.db.DBUtil;
+import org.eclipse.net4j.db.IDBAdapter;
+import org.eclipse.net4j.db.IDBConnectionProvider;
+import org.eclipse.net4j.signal.ISignalProtocol;
+import org.eclipse.net4j.util.StringUtil;
+import org.eclipse.net4j.util.container.ContainerEventAdapter;
+import org.eclipse.net4j.util.container.IContainer;
+import org.eclipse.net4j.util.container.IPluginContainer;
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.io.IOUtil;
+import org.eclipse.net4j.util.lifecycle.Lifecycle;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.eclipse.net4j.util.security.IUserManager;
+import org.eclipse.net4j.util.security.UserManager;
+
+import org.h2.jdbcx.JdbcDataSource;
+
+import javax.sql.DataSource;
+
+import java.io.File;
+import java.text.MessageFormat;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+
+/**
+ * @author Eike Stepper
+ */
+public class DemoConfiguration extends Lifecycle
+{
+ public static final int NAME_LENGTH = 10;
+
+ private static final String NAME_ALPHABET = "abcdefghijklmnopqrstuvwxyz";
+
+ private Mode mode = Mode.NORMAL;
+
+ private String[] userIDs;
+
+ private transient String name;
+
+ private transient InternalRepository repository;
+
+ private DemoUserManager userManager;
+
+ private transient long lastAccess = System.currentTimeMillis();
+
+ DemoConfiguration(Mode mode, String[] userIDs)
+ {
+ this.mode = mode;
+ if (userIDs != null)
+ {
+ if (userIDs.length != 0)
+ {
+ if (StringUtil.isEmpty(userIDs[0]))
+ {
+ userIDs = null;
+ }
+ }
+ }
+
+ this.userIDs = userIDs;
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public String[] getUserIDs()
+ {
+ return userIDs;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public IRepository getRepository()
+ {
+ return repository;
+ }
+
+ public Map<String, char[]> getUsers()
+ {
+ if (userManager == null)
+ {
+ return Collections.emptyMap();
+ }
+
+ return userManager.getUsers();
+ }
+
+ public synchronized long getTimeoutMillis()
+ {
+ long idleTime = System.currentTimeMillis() - lastAccess;
+ long time = DemoServer.MAX_IDLE_MILLIS - idleTime;
+ if (time < 0)
+ {
+ time = 0;
+ }
+
+ return time;
+ }
+
+ public String formatTimeoutMinutes()
+ {
+ return MessageFormat.format("{0,time,mm:ss}", getTimeoutMillis());
+ }
+
+ @Override
+ protected void doActivate() throws Exception
+ {
+ name = createRandomName();
+
+ IDBStore store = createStore();
+
+ Map<String, String> props = new HashMap<String, String>();
+ props.put(IRepository.Props.OVERRIDE_UUID, ""); // Use repo name
+ props.put(IRepository.Props.SUPPORTING_AUDITS, mode == Mode.NORMAL ? "false" : "true");
+ props.put(IRepository.Props.SUPPORTING_BRANCHES, mode == Mode.BRANCHING ? "true" : "false");
+
+ repository = (InternalRepository)CDOServerUtil.createRepository(name, store, props);
+
+ InternalSessionManager sessionManager = createSessionManager();
+
+ if (userIDs != null)
+ {
+ IUserManager userManager = createUserManager();
+ sessionManager.setUserManager(userManager);
+ }
+
+ CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
+ }
+
+ @Override
+ protected void doDeactivate() throws Exception
+ {
+ if (repository != null)
+ {
+ File folder = new File(new File("databases"), repository.getName());
+
+ LifecycleUtil.deactivate(repository);
+ repository = null;
+
+ IOUtil.delete(folder);
+ }
+ }
+
+ protected String createRandomName()
+ {
+ return createRandomString(NAME_LENGTH, NAME_ALPHABET);
+ }
+
+ protected IDBStore createStore()
+ {
+ IMappingStrategy mappingStrategy = createMappingStrategy();
+ IDBAdapter dbAdapter = DBUtil.getDBAdapter("h2");
+ IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(createDataSource());
+ IDBStore store = CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
+ return store;
+ }
+
+ protected IMappingStrategy createMappingStrategy()
+ {
+ switch (mode)
+ {
+ case NORMAL:
+ return CDODBUtil.createHorizontalMappingStrategy(false, false);
+ case AUDITING:
+ return CDODBUtil.createHorizontalMappingStrategy(true, false);
+ case BRANCHING:
+ return CDODBUtil.createHorizontalMappingStrategy(true, true);
+ default:
+ throw new IllegalStateException("Invalid mode: " + mode);
+ }
+ }
+
+ protected DataSource createDataSource()
+ {
+ JdbcDataSource dataSource = new JdbcDataSource();
+ dataSource.setURL("jdbc:h2:databases/" + name + "/h2test");
+ return dataSource;
+ }
+
+ protected InternalSessionManager createSessionManager()
+ {
+ InternalSessionManager sessionManager = (InternalSessionManager)CDOServerUtil.createSessionManager();
+ repository.setSessionManager(sessionManager);
+ sessionManager.addListener(new ContainerEventAdapter<ISession>()
+ {
+ @Override
+ protected void onAdded(IContainer<ISession> container, ISession session)
+ {
+ ISignalProtocol<?> protocol = (ISignalProtocol<?>)session.getProtocol();
+ if (protocol != null)
+ {
+ protocol.addListener(new IListener()
+ {
+ public void notifyEvent(IEvent event)
+ {
+ synchronized (DemoConfiguration.this)
+ {
+ lastAccess = System.currentTimeMillis();
+ }
+ }
+ });
+ }
+ }
+ });
+
+ return sessionManager;
+ }
+
+ protected IUserManager createUserManager()
+ {
+ userManager = new DemoUserManager();
+ for (int i = 0; i < userIDs.length; i++)
+ {
+ String userID = userIDs[i];
+ userManager.addUser(userID, ("pw" + (i + 1)).toCharArray());
+ }
+
+ userManager.activate();
+ return userManager;
+ }
+
+ public static String createRandomString(int length, String alphabet)
+ {
+ Random random = new Random(System.currentTimeMillis());
+ StringBuilder builder = new StringBuilder();
+ for (int i = 0; i < length; i++)
+ {
+ int pos = random.nextInt(alphabet.length());
+ builder.append(alphabet.charAt(pos));
+ }
+
+ return builder.toString();
+ }
+
+ public static String createRandomString(int length)
+ {
+ return createRandomString(length, NAME_ALPHABET);
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class DemoUserManager extends UserManager
+ {
+ public DemoUserManager()
+ {
+ }
+
+ public Map<String, char[]> getUsers()
+ {
+ return users;
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public enum Mode
+ {
+ NORMAL, AUDITING, BRANCHING
+ }
+}
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 83de081bec..955efb05e9 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 @@ -1,159 +1,159 @@ -/* - * Copyright (c) 2004 - 2011 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.examples.internal.server.OM; -import org.eclipse.emf.cdo.examples.server.DemoConfiguration.Mode; - -import org.eclipse.net4j.acceptor.IAcceptor; -import org.eclipse.net4j.tcp.TCPUtil; -import org.eclipse.net4j.util.concurrent.Worker; -import org.eclipse.net4j.util.container.IPluginContainer; -import org.eclipse.net4j.util.lifecycle.Lifecycle; -import org.eclipse.net4j.util.lifecycle.LifecycleUtil; -import org.eclipse.net4j.util.om.OMPlatform; -import org.eclipse.net4j.util.om.log.EclipseLoggingBridge; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author Eike Stepper - */ -public class DemoServer extends Lifecycle -{ - public static final String PROP_BROWSER_PORT = OM.BUNDLE_ID + ".browser.port"; //$NON-NLS-1$ - - public static final int PORT = 3003; - - public static final int MAX_IDLE_MINUTES = 15; - - public static final long MAX_IDLE_MILLIS = MAX_IDLE_MINUTES * 60 * 1000; - - public static final DemoServer INSTANCE = new DemoServer(); - - private IAcceptor acceptor; - - private Map<String, DemoConfiguration> configs = new HashMap<String, DemoConfiguration>(); - - private Cleaner cleaner = new Cleaner(); - - private DemoServer() - { - } - - public IAcceptor getAcceptor() - { - return acceptor; - } - - public DemoConfiguration[] getConfigs() - { - synchronized (configs) - { - return configs.values().toArray(new DemoConfiguration[configs.size()]); - } - } - - public DemoConfiguration getConfig(String name) - { - synchronized (configs) - { - return configs.get(name); - } - } - - public DemoConfiguration addConfig(Mode mode) - { - DemoConfiguration config = new DemoConfiguration(mode, null); - config.activate(); - - synchronized (configs) - { - configs.put(config.getName(), config); - } - - return config; - } - - @Override - protected void doActivate() throws Exception - { - super.doActivate(); - OMPlatform.INSTANCE.removeLogHandler(EclipseLoggingBridge.INSTANCE); - OM.LOG.info("Demo server starting"); - - IPluginContainer container = IPluginContainer.INSTANCE; - acceptor = TCPUtil.getAcceptor(container, "0.0.0.0:" + PORT); - - String port = OMPlatform.INSTANCE.getProperty(PROP_BROWSER_PORT); - if (port != null) - { - container.getElement("org.eclipse.emf.cdo.server.db.browsers", "default", port); //$NON-NLS-1$ //$NON-NLS-2$ - } - - cleaner.activate(); - OM.LOG.info("Demo server started"); - } - - @Override - protected void doDeactivate() throws Exception - { - OM.LOG.info("Demo server stopping"); - cleaner.deactivate(); - - for (DemoConfiguration config : getConfigs()) - { - config.deactivate(); - } - - configs.clear(); - - if (acceptor != null) - { - LifecycleUtil.deactivate(acceptor); - acceptor = null; - } - - OM.LOG.info("Demo server stopped"); - super.doDeactivate(); - } - - /** - * @author Eike Stepper - */ - private final class Cleaner extends Worker - { - @Override - protected void work(WorkContext context) throws Exception - { - for (DemoConfiguration config : getConfigs()) - { - cleanIfNeeded(config); - } - - context.nextWork(2000L); - } - - protected void cleanIfNeeded(DemoConfiguration config) - { - if (config.getTimeoutMillis() == 0) - { - synchronized (configs) - { - configs.remove(config.getName()); - } - - config.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.server;
+
+import org.eclipse.emf.cdo.examples.internal.server.OM;
+import org.eclipse.emf.cdo.examples.server.DemoConfiguration.Mode;
+
+import org.eclipse.net4j.acceptor.IAcceptor;
+import org.eclipse.net4j.tcp.TCPUtil;
+import org.eclipse.net4j.util.concurrent.Worker;
+import org.eclipse.net4j.util.container.IPluginContainer;
+import org.eclipse.net4j.util.lifecycle.Lifecycle;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.util.om.log.EclipseLoggingBridge;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Eike Stepper
+ */
+public class DemoServer extends Lifecycle
+{
+ public static final String PROP_BROWSER_PORT = OM.BUNDLE_ID + ".browser.port"; //$NON-NLS-1$
+
+ public static final int PORT = 3003;
+
+ public static final int MAX_IDLE_MINUTES = 15;
+
+ public static final long MAX_IDLE_MILLIS = MAX_IDLE_MINUTES * 60 * 1000;
+
+ public static final DemoServer INSTANCE = new DemoServer();
+
+ private IAcceptor acceptor;
+
+ private Map<String, DemoConfiguration> configs = new HashMap<String, DemoConfiguration>();
+
+ private Cleaner cleaner = new Cleaner();
+
+ private DemoServer()
+ {
+ }
+
+ public IAcceptor getAcceptor()
+ {
+ return acceptor;
+ }
+
+ public DemoConfiguration[] getConfigs()
+ {
+ synchronized (configs)
+ {
+ return configs.values().toArray(new DemoConfiguration[configs.size()]);
+ }
+ }
+
+ public DemoConfiguration getConfig(String name)
+ {
+ synchronized (configs)
+ {
+ return configs.get(name);
+ }
+ }
+
+ public DemoConfiguration addConfig(Mode mode)
+ {
+ DemoConfiguration config = new DemoConfiguration(mode, null);
+ config.activate();
+
+ synchronized (configs)
+ {
+ configs.put(config.getName(), config);
+ }
+
+ return config;
+ }
+
+ @Override
+ protected void doActivate() throws Exception
+ {
+ super.doActivate();
+ OMPlatform.INSTANCE.removeLogHandler(EclipseLoggingBridge.INSTANCE);
+ OM.LOG.info("Demo server starting");
+
+ IPluginContainer container = IPluginContainer.INSTANCE;
+ acceptor = TCPUtil.getAcceptor(container, "0.0.0.0:" + PORT);
+
+ String port = OMPlatform.INSTANCE.getProperty(PROP_BROWSER_PORT);
+ if (port != null)
+ {
+ container.getElement("org.eclipse.emf.cdo.server.db.browsers", "default", port); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ cleaner.activate();
+ OM.LOG.info("Demo server started");
+ }
+
+ @Override
+ protected void doDeactivate() throws Exception
+ {
+ OM.LOG.info("Demo server stopping");
+ cleaner.deactivate();
+
+ for (DemoConfiguration config : getConfigs())
+ {
+ config.deactivate();
+ }
+
+ configs.clear();
+
+ if (acceptor != null)
+ {
+ LifecycleUtil.deactivate(acceptor);
+ acceptor = null;
+ }
+
+ OM.LOG.info("Demo server stopped");
+ super.doDeactivate();
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private final class Cleaner extends Worker
+ {
+ @Override
+ protected void work(WorkContext context) throws Exception
+ {
+ for (DemoConfiguration config : getConfigs())
+ {
+ cleanIfNeeded(config);
+ }
+
+ context.nextWork(2000L);
+ }
+
+ protected void cleanIfNeeded(DemoConfiguration config)
+ {
+ if (config.getTimeoutMillis() == 0)
+ {
+ synchronized (configs)
+ {
+ configs.remove(config.getName());
+ }
+
+ config.deactivate();
+ }
+ }
+ }
+}
|