diff options
author | Eike Stepper | 2012-06-11 17:26:02 +0000 |
---|---|---|
committer | Eike Stepper | 2012-06-11 17:26:02 +0000 |
commit | db5ea347d0c2daa6751393da9f005531845b86ce (patch) | |
tree | bc11470480dbdc31ab5b6a7fd2b6947d11ba9df8 /plugins/org.eclipse.net4j.examples.installer/examples/jms.server | |
parent | e14126c827d9333146f95b039e05b345c7dfca74 (diff) | |
download | cdo-db5ea347d0c2daa6751393da9f005531845b86ce.tar.gz cdo-db5ea347d0c2daa6751393da9f005531845b86ce.tar.xz cdo-db5ea347d0c2daa6751393da9f005531845b86ce.zip |
[382278] Provide Net4j example installers
https://bugs.eclipse.org/bugs/show_bug.cgi?id=382278
Diffstat (limited to 'plugins/org.eclipse.net4j.examples.installer/examples/jms.server')
52 files changed, 3128 insertions, 0 deletions
diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.classpath b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.classpath new file mode 100644 index 0000000000..64c5e31b7a --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.options b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.options new file mode 100644 index 0000000000..1fd37aa77e --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.options @@ -0,0 +1,6 @@ +# Debugging and tracing options + +org.eclipse.net4j.jms.server/debug = true + +org.eclipse.net4j.jms.server/debug.protocol = true +org.eclipse.net4j.jms.server/debug.store = true diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.project b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.project new file mode 100644 index 0000000000..1038549765 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.project @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.net4j.jms.server</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.emf.cdo.releng.version.VersionBuilder</name> + <arguments> + <dictionary> + <key>release.path</key> + <value>/org.eclipse.emf.cdo.releng/release.xml</value> + </dictionary> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> + <nature>org.eclipse.emf.cdo.releng.version.VersionNature</nature> + </natures> +</projectDescription> diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..08d1ab430d --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Mon Jul 04 12:57:30 CEST 2011 +eclipse.preferences.version=1 +encoding//model/org.eclipse.emf.cdo.defs.ecorediag=UTF-8 diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..b28293508e --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,382 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled +org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,HIGH,LOW,LOW,LOW,LOW,LOW +org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,PERF,MEM,POLISH,@generated NOT,@ADDED +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=120 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=2 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=2 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4343e2f963 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,119 @@ +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=12 +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.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.ltk.core.refactoring.prefs b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 0000000000..864e30fe5d --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,3 @@ +#Thu Feb 04 09:44:24 CET 2010 +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.mylyn.tasks.ui.prefs b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 0000000000..b050639a54 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +#Thu Feb 04 09:44:24 CET 2010 +eclipse.preferences.version=1 +project.repository.kind=bugzilla +project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.mylyn.team.ui.prefs b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.mylyn.team.ui.prefs new file mode 100644 index 0000000000..2f50f36c0c --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.mylyn.team.ui.prefs @@ -0,0 +1,3 @@ +#Thu Feb 04 09:44:24 CET 2010 +commit.comment.template=[${task.id}] ${task.description} \r\n${task.url} +eclipse.preferences.version=1 diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.pde.api.tools.prefs b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..f8d0a0660e --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,94 @@ +#Thu Feb 04 09:44:24 CET 2010 +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_JAVADOC_TAG=Ignore +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Ignore +automatically_removed_unused_problem_filters=Disabled +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.pde.prefs b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..c6b96bb45e --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/.settings/org.eclipse.pde.prefs @@ -0,0 +1,31 @@ +#Thu Feb 04 09:44:24 CET 2010 +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=1 +compilers.p.missing-version-export-package=1 +compilers.p.missing-version-import-package=1 +compilers.p.missing-version-require-bundle=1 +compilers.p.no-required-att=0 +compilers.p.not-externalized-att=2 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +eclipse.preferences.version=1 diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..396f50b675 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.net4j.jms.server +Bundle-Version: 4.0.100.qualifier +Bundle-Name: %pluginName +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-ActivationPolicy: lazy +Bundle-Activator: org.eclipse.net4j.jms.internal.server.bundle.OM +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-ClassPath: . +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)", + org.eclipse.net4j.jms;bundle-version="[4.0.0,5.0.0)";visibility:=reexport +Import-Package: javax.jms;version="[1.1.0,2.0.0)" +Export-Package: org.eclipse.net4j.jms.internal.server;version="4.0.100";x-friends:="org.eclipse.net4j.jms.server.jdbc,org.eclipse.net4j.jms.tests", + org.eclipse.net4j.jms.internal.server.bundle;version="4.0.100";x-internal:=true, + org.eclipse.net4j.jms.internal.server.messages;version="4.0.100";x-internal:=true, + org.eclipse.net4j.jms.internal.server.protocol;version="4.0.100";x-friends:="org.eclipse.net4j.jms.server.jdbc,org.eclipse.net4j.jms.tests", + org.eclipse.net4j.jms.internal.server.protocol.admin;version="4.0.100";x-friends:="org.eclipse.net4j.jms.server.jdbc,org.eclipse.net4j.jms.tests", + org.eclipse.net4j.jms.internal.server.store;version="4.0.100";x-friends:="org.eclipse.net4j.jms.server.jdbc,org.eclipse.net4j.jms.tests", + org.eclipse.net4j.jms.server;version="4.0.100" diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/about.html b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/about.html new file mode 100644 index 0000000000..d35d5aed64 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/build.properties b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/build.properties new file mode 100644 index 0000000000..152299f8f0 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/build.properties @@ -0,0 +1,23 @@ +# 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 + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + .options,\ + about.html,\ + copyright.txt,\ + plugin.properties +src.includes = about.html,\ + copyright.txt + +generateSourceReferences = true diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/copyright.txt b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/copyright.txt new file mode 100644 index 0000000000..0a0f67e6d7 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/copyright.txt @@ -0,0 +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: + Eike Stepper - initial API and implementation
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/plugin.properties b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/plugin.properties new file mode 100644 index 0000000000..e5bdacfa85 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/plugin.properties @@ -0,0 +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 = Net4j JMS Provider Server +providerName = Eclipse Modeling Project diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/Server.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/Server.java new file mode 100644 index 0000000000..4e95accebc --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/Server.java @@ -0,0 +1,235 @@ +/* + * 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.net4j.jms.internal.server; + +import org.eclipse.net4j.internal.jms.ConnectionFactoryImpl; +import org.eclipse.net4j.internal.jms.JMSDestination; +import org.eclipse.net4j.internal.jms.MessageImpl; +import org.eclipse.net4j.jms.internal.server.bundle.OM; +import org.eclipse.net4j.jms.internal.server.messages.Messages; +import org.eclipse.net4j.jms.server.IDestination; +import org.eclipse.net4j.jms.server.IServer; +import org.eclipse.net4j.jms.server.IStore; +import org.eclipse.net4j.jms.server.IStoreTransaction; +import org.eclipse.net4j.util.HexUtil; +import org.eclipse.net4j.util.concurrent.NonBlockingLongCounter; +import org.eclipse.net4j.util.concurrent.QueueWorker; +import org.eclipse.net4j.util.om.OMPlatform; + +import javax.jms.Destination; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; + +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +/** + * @author Eike Stepper + */ +public class Server extends QueueWorker<MessageImpl> implements IServer +{ + public static final Server INSTANCE = new Server(); + + private static final boolean REBIND_DESTINATIONS = true; + + private NonBlockingLongCounter messageIDCounter = new NonBlockingLongCounter(); + + private NonBlockingLongCounter consumerIDCounter = new NonBlockingLongCounter(); + + private IStore store = null; + + private Context jndiContext; + + private ConcurrentMap<String, ServerDestination> destinations = new ConcurrentHashMap<String, ServerDestination>(); + + private Set<ServerConnection> connections = new HashSet<ServerConnection>(); + + private ConcurrentMap<Long, ServerConsumer> consumers = new ConcurrentHashMap<Long, ServerConsumer>(); + + public Server() + { + } + + public IStore getStore() + { + return store; + } + + public void setStore(IStore store) + { + this.store = store; + } + + public IDestination createDestination(String name, IDestination.Type type) + { + ServerDestination destination = new ServerDestination(name, type); + ServerDestination existing = destinations.putIfAbsent(name, destination); + if (existing != null) + { + throw new IllegalStateException("Destination " + type + " " + name + " does already exist"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } + + IStoreTransaction transaction = store.startTransaction(); + transaction.destinationAdded(destination); + store.commitTransaction(transaction); + + try + { + destination.bind(jndiContext, REBIND_DESTINATIONS); + } + catch (NamingException ex) + { + OM.LOG.error(ex); + destinations.remove(name); + destination = null; + } + + return destination; + } + + public ServerDestination getDestination(String name) + { + return destinations.get(name); + } + + public ServerDestination getServerDestination(Destination jmsDestination) + { + String name = ((JMSDestination)jmsDestination).getName(); + ServerDestination destination = destinations.get(name); + if (destination == null) + { + OM.LOG.error(Messages.getString("Server.3") + name); //$NON-NLS-1$ + return null; + } + + return destination; + } + + public ServerConnection logon(String userName, String password) + { + ServerConnection connection = new ServerConnection(this, userName); + synchronized (connections) + { + connections.add(connection); + } + + return connection; + } + + public ServerConsumer createConsumer(ServerDestination destination, String messageSelector, boolean noLocal, + boolean durable) + { + long consumerID = consumerIDCounter.increment(); + ServerConsumer consumer = new ServerConsumer(consumerID, destination, messageSelector, noLocal, durable); + consumers.put(consumer.getID(), consumer); + return consumer; + } + + public ServerConsumer getConsumer(long consumerID) + { + return consumers.get(consumerID); + } + + public String[] handleClientMessages(MessageImpl[] messages) + { + IStoreTransaction transaction = store.startTransaction(); + String[] messageIDs = handleClientMessagesInTransaction(transaction, messages); + store.commitTransaction(transaction); + return messageIDs; + } + + public String[] handleClientMessagesInTransaction(IStoreTransaction transaction, MessageImpl[] messages) + { + String[] messageIDs = new String[messages.length]; + for (int i = 0; i < messages.length; i++) + { + MessageImpl message = messages[i]; + if (getServerDestination(message.getJMSDestination()) == null) + { + return null; + } + + messageIDs[i] = "ID:NET4J:" + HexUtil.longToHex(messageIDCounter.increment()); //$NON-NLS-1$ + message.setJMSMessageID(messageIDs[i]); + } + + for (MessageImpl message : messages) + { + transaction.messageReceived(message); + addWork(message); + } + + return messageIDs; + } + + @Override + protected String getThreadName() + { + return "jms-server"; //$NON-NLS-1$ + } + + @Override + protected void work(WorkContext context, MessageImpl message) + { + ServerDestination destination = getServerDestination(message.getJMSDestination()); + IStoreTransaction transaction = store.startTransaction(); + destination.handleClientMessage(transaction, message); + store.commitTransaction(transaction); + } + + @Override + protected void doBeforeActivate() throws Exception + { + super.doBeforeActivate(); + if (store == null) + { + throw new IllegalStateException("store == null"); //$NON-NLS-1$ + } + } + + @Override + protected void doActivate() throws Exception + { + super.doActivate(); + String name = OMPlatform.INSTANCE.getProperty("net4j.jms.connection.factory.name", "net4j.jms.ConnectionFactory"); //$NON-NLS-1$ //$NON-NLS-2$ + String type = OMPlatform.INSTANCE.getProperty("net4j.jms.connector.type", "tcp"); //$NON-NLS-1$ //$NON-NLS-2$ + String desc = OMPlatform.INSTANCE.getProperty("net4j.jms.connector.description", "localhost"); //$NON-NLS-1$ //$NON-NLS-2$ + + jndiContext = new InitialContext(); + jndiContext.rebind(name, new ConnectionFactoryImpl(type, desc)); + } + + @Override + protected void doDeactivate() throws Exception + { + synchronized (connections) + { + for (ServerConnection connection : connections) + { + try + { + connection.close(); + } + catch (Exception ex) + { + OM.LOG.error(ex); + } + } + } + + jndiContext.close(); + jndiContext = null; + super.doDeactivate(); + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/ServerConnection.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/ServerConnection.java new file mode 100644 index 0000000000..b073bb1d68 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/ServerConnection.java @@ -0,0 +1,115 @@ +/* + * 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.net4j.jms.internal.server; + +import org.eclipse.net4j.jms.internal.server.protocol.JMSServerProtocol; +import org.eclipse.net4j.jms.server.IConnection; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Eike Stepper + */ +public class ServerConnection implements IConnection +{ + private Server server; + + private String userName; + + private List<ServerSession> sessions = new ArrayList<ServerSession>(0); + + private JMSServerProtocol protocol; + + public ServerConnection(Server server, String userName) + { + this.server = server; + this.userName = userName; + } + + public Server getServer() + { + return server; + } + + public String getUserName() + { + return userName; + } + + public JMSServerProtocol getProtocol() + { + return protocol; + } + + public void setProtocol(JMSServerProtocol protocol) + { + this.protocol = protocol; + } + + public ServerSession openSession(int sessionID) + { + ServerSession session = new ServerSession(this, sessionID); + synchronized (sessions) + { + while (sessionID >= sessions.size()) + { + sessions.add(null); + } + + sessions.set(sessionID, session); + } + + return session; + } + + public ServerSession getSession(int sessionID) + { + return sessions.get(sessionID); + } + + public ServerSession[] getSessions() + { + List<ServerSession> result = new ArrayList<ServerSession>(sessions.size()); + synchronized (sessions) + { + for (ServerSession session : sessions) + { + if (session != null) + { + result.add(session); + } + } + } + + return result.toArray(new ServerSession[result.size()]); + } + + public void close() + { + protocol.getChannel().close(); + } + + protected boolean removeSession(ServerSession session) + { + synchronized (sessions) + { + int sessionID = session.getID(); + if (sessions.get(sessionID) == session) + { + sessions.set(sessionID, null); + return true; + } + + return false; + } + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/ServerConsumer.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/ServerConsumer.java new file mode 100644 index 0000000000..fd84f292cd --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/ServerConsumer.java @@ -0,0 +1,148 @@ +/* + * 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.net4j.jms.internal.server; + +import org.eclipse.net4j.internal.jms.MessageImpl; +import org.eclipse.net4j.jms.internal.server.bundle.OM; +import org.eclipse.net4j.jms.internal.server.protocol.JMSServerMessageRequest; +import org.eclipse.net4j.jms.internal.server.protocol.JMSServerProtocol; +import org.eclipse.net4j.jms.server.IServerConsumer; +import org.eclipse.net4j.jms.server.IStoreTransaction; +import org.eclipse.net4j.util.io.IOUtil; + +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +/** + * @author Eike Stepper + */ +public class ServerConsumer implements IServerConsumer +{ + private ServerSession session; + + private long id; + + private ServerDestination destination; + + private String messageSelector; + + private boolean noLocal; + + private boolean durable; + + private ConcurrentMap<String, MessageImpl> messages = new ConcurrentHashMap<String, MessageImpl>(); + + public ServerConsumer(long id, ServerDestination destination, String messageSelector, boolean noLocal, boolean durable) + { + this.id = id; + this.destination = destination; + this.messageSelector = messageSelector; + this.noLocal = noLocal; + this.durable = durable; + } + + public ServerSession getSession() + { + return session; + } + + public void setSession(ServerSession session) + { + this.session = session; + } + + public long getID() + { + return id; + } + + public ServerDestination getDestination() + { + return destination; + } + + public String getMessageSelector() + { + return messageSelector; + } + + public boolean isNoLocal() + { + return noLocal; + } + + public JMSServerProtocol getProtocol() + { + return session.getConnection().getProtocol(); + } + + public boolean isDurable() + { + return durable; + } + + public boolean handleClientMessage(IStoreTransaction transaction, MessageImpl message) + { + try + { + String messageID = message.getJMSMessageID(); + synchronized (messages) + { + messages.put(messageID, message); + } + + new JMSServerMessageRequest(getProtocol(), session.getID(), id, message).sendAsync(); + transaction.messageSent(message, id); + return true; + } + catch (Exception ex) + { + OM.LOG.error(ex); + return false; + } + } + + public void handleAcknowledge(IStoreTransaction transaction) + { + synchronized (messages) + { + if (messages.isEmpty()) + { + return; + } + + for (MessageImpl message : messages.values()) + { + transaction.messageAcknowledged(message, id); + IOUtil.OUT().println("\nMessage acknowledged: " + message.getJMSMessageID() + " (consumer=" + id + ")\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } + + messages.clear(); + } + } + + public void handleRecover(IStoreTransaction transaction) + { + synchronized (messages) + { + if (messages.isEmpty()) + { + return; + } + + for (MessageImpl message : messages.values()) + { + IOUtil.OUT().println("\nRecovering message: " + message.getJMSMessageID() + " (consumer=" + id + ")\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + session.getConnection().getServer().addWork(message); + } + } + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/ServerDestination.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/ServerDestination.java new file mode 100644 index 0000000000..4ea2d66dab --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/ServerDestination.java @@ -0,0 +1,127 @@ +/* + * 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.net4j.jms.internal.server; + +import org.eclipse.net4j.internal.jms.DestinationImpl; +import org.eclipse.net4j.internal.jms.MessageImpl; +import org.eclipse.net4j.internal.jms.QueueImpl; +import org.eclipse.net4j.internal.jms.TopicImpl; +import org.eclipse.net4j.jms.server.IDestination; +import org.eclipse.net4j.jms.server.IStore; +import org.eclipse.net4j.jms.server.IStoreTransaction; +import org.eclipse.net4j.util.concurrent.RoundRobinList; + +import javax.naming.Context; +import javax.naming.NamingException; + +import java.util.Iterator; + +/** + * @author Eike Stepper + */ +public class ServerDestination implements IDestination +{ + private String name; + + private Type type; + + private RoundRobinList<ServerConsumer> consumers = new RoundRobinList<ServerConsumer>(); + + public ServerDestination(String name, Type type) + { + this.name = name; + this.type = type; + } + + public String getName() + { + return name; + } + + public Type getType() + { + return type; + } + + public DestinationImpl bind(Context context, boolean rebind) throws NamingException + { + DestinationImpl destination = type == Type.QUEUE ? new QueueImpl(name) : new TopicImpl(name); + if (rebind) + { + context.rebind(name, destination); + } + else + { + context.bind(name, destination); + } + + return destination; + } + + public boolean addConsumer(ServerConsumer consumer) + { + if (consumer.isDurable()) + { + IStore store = Server.INSTANCE.getStore(); + IStoreTransaction transaction = store.startTransaction(); + transaction.consumerAdded(consumer); + store.commitTransaction(transaction); + } + + return consumers.add(consumer); + } + + public boolean removeConsumer(final long consumerID) + { + final boolean[] modified = { false }; + consumers.executeWrites(new Runnable() + { + public void run() + { + for (Iterator<ServerConsumer> it = consumers.iterator(); it.hasNext();) + { + ServerConsumer consumer = it.next(); + if (consumer.getID() == consumerID) + { + it.remove(); + modified[0] = true; + return; + } + } + } + }); + + return modified[0]; + } + + /** + * Called by worker thread of the server + */ + public void handleClientMessage(IStoreTransaction transaction, MessageImpl message) + { + if (type == Type.QUEUE) + { + ServerConsumer consumer = consumers.element(); + if (consumer != null) + { + consumer.handleClientMessage(transaction, message); + } + } + else + { + ServerConsumer[] consumers = this.consumers.toArray(new ServerConsumer[0]); + for (ServerConsumer consumer : consumers) + { + consumer.handleClientMessage(transaction, message); + } + } + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/ServerSession.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/ServerSession.java new file mode 100644 index 0000000000..255c03ff26 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/ServerSession.java @@ -0,0 +1,113 @@ +/* + * 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.net4j.jms.internal.server; + +import org.eclipse.net4j.internal.jms.DestinationImpl; +import org.eclipse.net4j.internal.jms.MessageImpl; +import org.eclipse.net4j.jms.internal.server.bundle.OM; +import org.eclipse.net4j.jms.internal.server.messages.Messages; +import org.eclipse.net4j.jms.server.ISession; +import org.eclipse.net4j.jms.server.IStore; +import org.eclipse.net4j.jms.server.IStoreTransaction; +import org.eclipse.net4j.util.lifecycle.Lifecycle; + +import java.text.MessageFormat; +import java.util.Collection; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +/** + * @author Eike Stepper + */ +public class ServerSession extends Lifecycle implements ISession +{ + private ServerConnection connection; + + private int id; + + private ConcurrentMap<Long, ServerConsumer> consumers = new ConcurrentHashMap<Long, ServerConsumer>(); + + public ServerSession(ServerConnection connection, int id) + { + this.connection = connection; + this.id = id; + } + + public ServerConnection getConnection() + { + return connection; + } + + public int getID() + { + return id; + } + + public long registerConsumer(DestinationImpl dest, String messageSelector, boolean noLocal, boolean durable) + { + Server server = connection.getServer(); + String name = dest.getName(); + ServerDestination destination = server.getDestination(name); + if (destination == null) + { + OM.LOG.error(MessageFormat.format(Messages.getString("ServerSession_0"), name)); //$NON-NLS-1$ + return -1; + } + + ServerConsumer consumer = server.createConsumer(destination, messageSelector, noLocal, durable); + consumer.setSession(this); + consumers.put(consumer.getID(), consumer); + destination.addConsumer(consumer); + return consumer.getID(); + } + + public void handleAcknowledge() + { + IStore store = connection.getServer().getStore(); + IStoreTransaction transaction = store.startTransaction(); + handleAcknowledgeInTransaction(transaction); + store.commitTransaction(transaction); + } + + public void handleAcknowledgeInTransaction(IStoreTransaction transaction) + { + for (ServerConsumer consumer : consumers.values()) + { + consumer.handleAcknowledge(transaction); + } + } + + public void handleRecover() + { + IStore store = connection.getServer().getStore(); + IStoreTransaction transaction = store.startTransaction(); + Collection<ServerConsumer> values = consumers.values(); + for (ServerConsumer consumer : values) + { + consumer.handleRecover(transaction); + } + + store.commitTransaction(transaction); + } + + public String[] handleCommit(MessageImpl[] messages) + { + Server server = connection.getServer(); + IStore store = server.getStore(); + + IStoreTransaction transaction = store.startTransaction(); + handleAcknowledgeInTransaction(transaction); + String[] messageIDs = server.handleClientMessagesInTransaction(transaction, messages); + store.commitTransaction(transaction); + + return messageIDs; + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/bundle/OM.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/bundle/OM.java new file mode 100644 index 0000000000..0dc7a59890 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/bundle/OM.java @@ -0,0 +1,59 @@ +/* + * 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.net4j.jms.internal.server.bundle; + +import org.eclipse.net4j.jms.internal.server.Server; +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.net4j.jms.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 OMTracer DEBUG_PROTOCOL = DEBUG.tracer("protocol"); //$NON-NLS-1$ + + public static final OMTracer DEBUG_STORE = DEBUG.tracer("store"); //$NON-NLS-1$ + + public static final OMLogger LOG = BUNDLE.logger(); + + static void start() throws Exception + { + Server.INSTANCE.activate(); + } + + static void stop() throws Exception + { + Server.INSTANCE.deactivate(); + } + + /** + * @author Eike Stepper + */ + public static final class Activator extends OSGiActivator + { + public Activator() + { + super(BUNDLE); + } + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/messages/Messages.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/messages/Messages.java new file mode 100644 index 0000000000..9dc5329eb5 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/messages/Messages.java @@ -0,0 +1,41 @@ +/* + * 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: + * Victor Roldan Betancort - initial API and implementation + * Eike Stepper - maintenance + */ +package org.eclipse.net4j.jms.internal.server.messages; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * @author Victor Roldan Betancort + */ +public class Messages +{ + private static final String BUNDLE_NAME = "org.eclipse.net4j.jms.internal.server.messages.messages"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); + + private Messages() + { + } + + public static String getString(String key) + { + try + { + return RESOURCE_BUNDLE.getString(key); + } + catch (MissingResourceException e) + { + return '!' + key + '!'; + } + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/messages/messages.properties b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/messages/messages.properties new file mode 100644 index 0000000000..0755149def --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/messages/messages.properties @@ -0,0 +1,17 @@ +# 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: +# Victor Roldan Betancort - initial API and implementation +# Eike Stepper - maintenance + +JMSAcknowledgeIndication_0=Session {0} not found. Acknowledgement discarded. +JMSCommitIndication_0=Session {0} not found +JMSLogonIndication_0=Access to JMS server denied +JMSRecoverIndication_0=Session {0} not found +JMSRollbackIndication_0=Session {0} not found +Server.3=Invalid destination: +ServerSession_0=Destination not found: {0} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSAcknowledgeIndication.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSAcknowledgeIndication.java new file mode 100644 index 0000000000..d79d8ed15c --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSAcknowledgeIndication.java @@ -0,0 +1,49 @@ +/* + * 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.net4j.jms.internal.server.protocol; + +import org.eclipse.net4j.jms.JMSProtocolConstants; +import org.eclipse.net4j.jms.internal.server.ServerConnection; +import org.eclipse.net4j.jms.internal.server.ServerSession; +import org.eclipse.net4j.jms.internal.server.bundle.OM; +import org.eclipse.net4j.jms.internal.server.messages.Messages; +import org.eclipse.net4j.signal.Indication; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; + +import java.text.MessageFormat; + +/** + * @author Eike Stepper + */ +public class JMSAcknowledgeIndication extends Indication +{ + public JMSAcknowledgeIndication(JMSServerProtocol protocol) + { + super(protocol, JMSProtocolConstants.SIGNAL_ACKNOWLEDGE); + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws Exception + { + int sessionID = in.readInt(); + + JMSServerProtocol protocol = (JMSServerProtocol)getProtocol(); + ServerConnection connection = protocol.getInfraStructure(); + ServerSession session = connection.getSession(sessionID); + if (session == null) + { + OM.LOG.info(MessageFormat.format(Messages.getString("JMSAcknowledgeIndication_0"), sessionID)); //$NON-NLS-1$ + return; + } + + session.handleAcknowledge(); + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSClientMessageIndication.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSClientMessageIndication.java new file mode 100644 index 0000000000..e31cd262d2 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSClientMessageIndication.java @@ -0,0 +1,53 @@ +/* + * 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.net4j.jms.internal.server.protocol; + +import org.eclipse.net4j.internal.jms.MessageImpl; +import org.eclipse.net4j.internal.jms.util.MessageUtil; +import org.eclipse.net4j.jms.JMSProtocolConstants; +import org.eclipse.net4j.jms.internal.server.Server; +import org.eclipse.net4j.jms.internal.server.ServerConnection; +import org.eclipse.net4j.signal.IndicationWithResponse; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +/** + * @author Eike Stepper + */ +public class JMSClientMessageIndication extends IndicationWithResponse +{ + private String messageID; + + public JMSClientMessageIndication(JMSServerProtocol protocol) + { + super(protocol, JMSProtocolConstants.SIGNAL_CLIENT_MESSAGE); + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws Exception + { + MessageImpl[] messages = { MessageUtil.read(in) }; + JMSServerProtocol protocol = (JMSServerProtocol)getProtocol(); + ServerConnection connection = protocol.getInfraStructure(); + Server server = connection.getServer(); + String[] ids = server.handleClientMessages(messages); + if (ids != null && ids.length != 0) + { + messageID = ids[0]; + } + } + + @Override + protected void responding(ExtendedDataOutputStream out) throws Exception + { + out.writeString(messageID); + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSCommitIndication.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSCommitIndication.java new file mode 100644 index 0000000000..6c11c01189 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSCommitIndication.java @@ -0,0 +1,77 @@ +/* + * 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.net4j.jms.internal.server.protocol; + +import org.eclipse.net4j.internal.jms.MessageImpl; +import org.eclipse.net4j.internal.jms.util.MessageUtil; +import org.eclipse.net4j.jms.JMSProtocolConstants; +import org.eclipse.net4j.jms.internal.server.ServerConnection; +import org.eclipse.net4j.jms.internal.server.ServerSession; +import org.eclipse.net4j.jms.internal.server.bundle.OM; +import org.eclipse.net4j.jms.internal.server.messages.Messages; +import org.eclipse.net4j.signal.IndicationWithResponse; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +import java.text.MessageFormat; + +/** + * @author Eike Stepper + */ +public class JMSCommitIndication extends IndicationWithResponse +{ + private String[] messageIDs; + + public JMSCommitIndication(JMSServerProtocol protocol) + { + super(protocol, JMSProtocolConstants.SIGNAL_COMMIT); + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws Exception + { + int sessionID = in.readInt(); + int size = in.readInt(); + MessageImpl[] messages = new MessageImpl[size]; + for (int i = 0; i < messages.length; i++) + { + messages[i] = MessageUtil.read(in); + } + + JMSServerProtocol protocol = (JMSServerProtocol)getProtocol(); + ServerConnection connection = protocol.getInfraStructure(); + ServerSession session = connection.getSession(sessionID); + if (session == null) + { + OM.LOG.warn(MessageFormat.format(Messages.getString("JMSCommitIndication_0"), sessionID)); //$NON-NLS-1$ + return; + } + + messageIDs = session.handleCommit(messages); + } + + @Override + protected void responding(ExtendedDataOutputStream out) throws Exception + { + if (messageIDs == null) + { + out.writeInt(-1); + } + else + { + out.writeInt(messageIDs.length); + for (String messageID : messageIDs) + { + out.writeString(messageID); + } + } + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSLogonIndication.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSLogonIndication.java new file mode 100644 index 0000000000..849b7efa83 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSLogonIndication.java @@ -0,0 +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.net4j.jms.internal.server.protocol; + +import org.eclipse.net4j.jms.JMSProtocolConstants; +import org.eclipse.net4j.jms.internal.server.Server; +import org.eclipse.net4j.jms.internal.server.ServerConnection; +import org.eclipse.net4j.jms.internal.server.bundle.OM; +import org.eclipse.net4j.jms.internal.server.messages.Messages; +import org.eclipse.net4j.signal.IndicationWithResponse; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +/** + * @author Eike Stepper + */ +public class JMSLogonIndication extends IndicationWithResponse +{ + private boolean ok; + + public JMSLogonIndication(JMSServerProtocol protocol) + { + super(protocol, JMSProtocolConstants.SIGNAL_LOGON); + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws Exception + { + String userName = in.readString(); + String password = in.readString(); + ServerConnection connection = Server.INSTANCE.logon(userName, password); + if (connection == null) + { + OM.LOG.error(Messages.getString("JMSLogonIndication_0")); //$NON-NLS-1$ + return; + } + + JMSServerProtocol protocol = (JMSServerProtocol)getProtocol(); + connection.setProtocol(protocol); + protocol.setInfraStructure(connection); + ok = true; + } + + @Override + protected void responding(ExtendedDataOutputStream out) throws Exception + { + out.writeBoolean(ok); + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSOpenSessionIndication.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSOpenSessionIndication.java new file mode 100644 index 0000000000..080d003211 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSOpenSessionIndication.java @@ -0,0 +1,50 @@ +/* + * 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.net4j.jms.internal.server.protocol; + +import org.eclipse.net4j.jms.JMSProtocolConstants; +import org.eclipse.net4j.jms.internal.server.ServerConnection; +import org.eclipse.net4j.jms.internal.server.ServerSession; +import org.eclipse.net4j.signal.IndicationWithResponse; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +/** + * @author Eike Stepper + */ +public class JMSOpenSessionIndication extends IndicationWithResponse +{ + private boolean ok; + + public JMSOpenSessionIndication(JMSServerProtocol protocol) + { + super(protocol, JMSProtocolConstants.SIGNAL_OPEN_SESSION); + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws Exception + { + int sessionID = in.readInt(); + JMSServerProtocol protocol = (JMSServerProtocol)getProtocol(); + ServerConnection connection = protocol.getInfraStructure(); + ServerSession session = connection.openSession(sessionID); + if (session != null) + { + ok = true; + } + } + + @Override + protected void responding(ExtendedDataOutputStream out) throws Exception + { + out.writeBoolean(ok); + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSRecoverIndication.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSRecoverIndication.java new file mode 100644 index 0000000000..8b4ec05341 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSRecoverIndication.java @@ -0,0 +1,54 @@ +/* + * 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.net4j.jms.internal.server.protocol; + +import org.eclipse.net4j.jms.JMSProtocolConstants; +import org.eclipse.net4j.jms.internal.server.ServerConnection; +import org.eclipse.net4j.jms.internal.server.ServerSession; +import org.eclipse.net4j.jms.internal.server.bundle.OM; +import org.eclipse.net4j.jms.internal.server.messages.Messages; +import org.eclipse.net4j.signal.IndicationWithResponse; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +import java.text.MessageFormat; + +/** + * @author Eike Stepper + */ +public class JMSRecoverIndication extends IndicationWithResponse +{ + public JMSRecoverIndication(JMSServerProtocol protocol) + { + super(protocol, JMSProtocolConstants.SIGNAL_RECOVER); + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws Exception + { + int sessionID = in.readInt(); + JMSServerProtocol protocol = (JMSServerProtocol)getProtocol(); + ServerConnection connection = protocol.getInfraStructure(); + ServerSession session = connection.getSession(sessionID); + if (session == null) + { + OM.LOG.warn(MessageFormat.format(Messages.getString("JMSRecoverIndication_0"), sessionID)); //$NON-NLS-1$ + return; + } + + session.handleRecover(); + } + + @Override + protected void responding(ExtendedDataOutputStream out) throws Exception + { + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSRegisterConsumerIndication.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSRegisterConsumerIndication.java new file mode 100644 index 0000000000..658aaec0f9 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSRegisterConsumerIndication.java @@ -0,0 +1,53 @@ +/* + * 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.net4j.jms.internal.server.protocol; + +import org.eclipse.net4j.internal.jms.DestinationImpl; +import org.eclipse.net4j.internal.jms.util.DestinationUtil; +import org.eclipse.net4j.jms.JMSProtocolConstants; +import org.eclipse.net4j.jms.internal.server.ServerConnection; +import org.eclipse.net4j.jms.internal.server.ServerSession; +import org.eclipse.net4j.signal.IndicationWithResponse; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +/** + * @author Eike Stepper + */ +public class JMSRegisterConsumerIndication extends IndicationWithResponse +{ + private long consumerID; + + public JMSRegisterConsumerIndication(JMSServerProtocol protocol) + { + super(protocol, JMSProtocolConstants.SIGNAL_REGISTER_CONSUMER); + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws Exception + { + int sessionID = in.readInt(); + DestinationImpl destination = DestinationUtil.read(in); + String messageSelector = in.readString(); + boolean noLocal = in.readBoolean(); + boolean durable = in.readBoolean(); + JMSServerProtocol protocol = (JMSServerProtocol)getProtocol(); + ServerConnection connection = protocol.getInfraStructure(); + ServerSession session = connection.getSession(sessionID); + consumerID = session.registerConsumer(destination, messageSelector, noLocal, durable); + } + + @Override + protected void responding(ExtendedDataOutputStream out) throws Exception + { + out.writeLong(consumerID); + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSRollbackIndication.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSRollbackIndication.java new file mode 100644 index 0000000000..f801774ac1 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSRollbackIndication.java @@ -0,0 +1,55 @@ +/* + * 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.net4j.jms.internal.server.protocol; + +import org.eclipse.net4j.jms.JMSProtocolConstants; +import org.eclipse.net4j.jms.internal.server.ServerConnection; +import org.eclipse.net4j.jms.internal.server.ServerSession; +import org.eclipse.net4j.jms.internal.server.bundle.OM; +import org.eclipse.net4j.jms.internal.server.messages.Messages; +import org.eclipse.net4j.signal.IndicationWithResponse; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +import java.text.MessageFormat; + +/** + * @author Eike Stepper + */ +public class JMSRollbackIndication extends IndicationWithResponse +{ + public JMSRollbackIndication(JMSServerProtocol protocol) + { + super(protocol, JMSProtocolConstants.SIGNAL_ROLLBACK); + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws Exception + { + int sessionID = in.readInt(); + JMSServerProtocol protocol = (JMSServerProtocol)getProtocol(); + ServerConnection connection = protocol.getInfraStructure(); + ServerSession session = connection.getSession(sessionID); + if (session == null) + { + OM.LOG.warn(MessageFormat.format(Messages.getString("JMSRollbackIndication_0"), sessionID)); //$NON-NLS-1$ + return; + } + + session.handleRecover(); + } + + @Override + protected void responding(ExtendedDataOutputStream out) throws Exception + { + out.writeBoolean(true); + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerMessageRequest.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerMessageRequest.java new file mode 100644 index 0000000000..24f50d231b --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerMessageRequest.java @@ -0,0 +1,45 @@ +/* + * 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.net4j.jms.internal.server.protocol; + +import org.eclipse.net4j.internal.jms.MessageImpl; +import org.eclipse.net4j.internal.jms.util.MessageUtil; +import org.eclipse.net4j.jms.JMSProtocolConstants; +import org.eclipse.net4j.signal.Request; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +/** + * @author Eike Stepper + */ +public class JMSServerMessageRequest extends Request +{ + private int sessionID; + + private long consumerID; + + private MessageImpl message; + + public JMSServerMessageRequest(JMSServerProtocol protocol, int sessionID, long consumerID, MessageImpl message) + { + super(protocol, JMSProtocolConstants.SIGNAL_SERVER_MESSAGE); + this.sessionID = sessionID; + this.consumerID = consumerID; + this.message = message; + } + + @Override + protected void requesting(ExtendedDataOutputStream out) throws Exception + { + out.writeInt(sessionID); + out.writeLong(consumerID); + MessageUtil.write(out, message); + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerProtocol.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerProtocol.java new file mode 100644 index 0000000000..2f5f9be1e2 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerProtocol.java @@ -0,0 +1,64 @@ +/* + * 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.net4j.jms.internal.server.protocol; + +import org.eclipse.net4j.jms.JMSProtocolConstants; +import org.eclipse.net4j.jms.internal.server.ServerConnection; +import org.eclipse.net4j.signal.SignalProtocol; +import org.eclipse.net4j.signal.SignalReactor; + +/** + * @author Eike Stepper + */ +public class JMSServerProtocol extends SignalProtocol<ServerConnection> +{ + public JMSServerProtocol() + { + super(JMSProtocolConstants.PROTOCOL_NAME); + } + + @Override + protected SignalReactor createSignalReactor(short signalID) + { + switch (signalID) + { + case JMSProtocolConstants.SIGNAL_SYNC: + return new JMSSyncIndication(this); + + case JMSProtocolConstants.SIGNAL_LOGON: + return new JMSLogonIndication(this); + + case JMSProtocolConstants.SIGNAL_OPEN_SESSION: + return new JMSOpenSessionIndication(this); + + case JMSProtocolConstants.SIGNAL_REGISTER_CONSUMER: + return new JMSRegisterConsumerIndication(this); + + case JMSProtocolConstants.SIGNAL_CLIENT_MESSAGE: + return new JMSClientMessageIndication(this); + + case JMSProtocolConstants.SIGNAL_ACKNOWLEDGE: + return new JMSAcknowledgeIndication(this); + + case JMSProtocolConstants.SIGNAL_RECOVER: + return new JMSRecoverIndication(this); + + case JMSProtocolConstants.SIGNAL_COMMIT: + return new JMSCommitIndication(this); + + case JMSProtocolConstants.SIGNAL_ROLLBACK: + return new JMSRollbackIndication(this); + + default: + return super.createSignalReactor(signalID); + } + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerProtocolFactory.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerProtocolFactory.java new file mode 100644 index 0000000000..068a09211f --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerProtocolFactory.java @@ -0,0 +1,39 @@ +/* + * 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.net4j.jms.internal.server.protocol; + +import org.eclipse.net4j.jms.JMSProtocolConstants; +import org.eclipse.net4j.util.container.IManagedContainer; + +import org.eclipse.spi.net4j.ServerProtocolFactory; + +/** + * @author Eike Stepper + */ +public final class JMSServerProtocolFactory extends ServerProtocolFactory +{ + public static final String TYPE = JMSProtocolConstants.PROTOCOL_NAME; + + public JMSServerProtocolFactory() + { + super(TYPE); + } + + public JMSServerProtocol create(String description) + { + return new JMSServerProtocol(); + } + + public static JMSServerProtocol get(IManagedContainer container, String description) + { + return (JMSServerProtocol)container.getElement(PRODUCT_GROUP, TYPE, description); + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSSyncIndication.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSSyncIndication.java new file mode 100644 index 0000000000..9260ed6381 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSSyncIndication.java @@ -0,0 +1,38 @@ +/* + * 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.net4j.jms.internal.server.protocol; + +import org.eclipse.net4j.jms.JMSProtocolConstants; +import org.eclipse.net4j.signal.IndicationWithResponse; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +/** + * @author Eike Stepper + */ +public class JMSSyncIndication extends IndicationWithResponse +{ + public JMSSyncIndication(JMSServerProtocol protocol) + { + super(protocol, JMSProtocolConstants.SIGNAL_SYNC); + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws Exception + { + } + + @Override + protected void responding(ExtendedDataOutputStream out) throws Exception + { + out.writeLong(System.currentTimeMillis()); + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSAdminServerProtocol.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSAdminServerProtocol.java new file mode 100644 index 0000000000..7fbeccd8dd --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSAdminServerProtocol.java @@ -0,0 +1,45 @@ +/* + * 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.net4j.jms.internal.server.protocol.admin; + +import org.eclipse.net4j.jms.JMSAdminProtocolConstants; +import org.eclipse.net4j.jms.server.IServer; +import org.eclipse.net4j.signal.SignalProtocol; +import org.eclipse.net4j.signal.SignalReactor; + +/** + * @author Eike Stepper + */ +public class JMSAdminServerProtocol extends SignalProtocol<Object> +{ + public JMSAdminServerProtocol() + { + super(JMSAdminProtocolConstants.PROTOCOL_NAME); + } + + @Override + protected SignalReactor createSignalReactor(short signalID) + { + switch (signalID) + { + case JMSAdminProtocolConstants.SIGNAL_CREATE_DESTINATION: + return new JMSCreateDestinationIndication(this); + + default: + return super.createSignalReactor(signalID); + } + } + + public IServer getServer() + { + return IServer.INSTANCE; + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSAdminServerProtocolFactory.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSAdminServerProtocolFactory.java new file mode 100644 index 0000000000..1351ac0793 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSAdminServerProtocolFactory.java @@ -0,0 +1,39 @@ +/* + * 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.net4j.jms.internal.server.protocol.admin; + +import org.eclipse.net4j.jms.JMSAdminProtocolConstants; +import org.eclipse.net4j.util.container.IManagedContainer; + +import org.eclipse.spi.net4j.ServerProtocolFactory; + +/** + * @author Eike Stepper + */ +public final class JMSAdminServerProtocolFactory extends ServerProtocolFactory +{ + public static final String TYPE = JMSAdminProtocolConstants.PROTOCOL_NAME; + + public JMSAdminServerProtocolFactory() + { + super(TYPE); + } + + public JMSAdminServerProtocol create(String description) + { + return new JMSAdminServerProtocol(); + } + + public static JMSAdminServerProtocol get(IManagedContainer container, String description) + { + return (JMSAdminServerProtocol)container.getElement(PRODUCT_GROUP, TYPE, description); + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSCreateDestinationIndication.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSCreateDestinationIndication.java new file mode 100644 index 0000000000..89bbd3539e --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSCreateDestinationIndication.java @@ -0,0 +1,65 @@ +/* + * 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.net4j.jms.internal.server.protocol.admin; + +import org.eclipse.net4j.jms.JMSAdminProtocolConstants; +import org.eclipse.net4j.jms.server.IDestination; +import org.eclipse.net4j.jms.server.IDestination.Type; +import org.eclipse.net4j.jms.server.IServer; +import org.eclipse.net4j.signal.IndicationWithResponse; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +/** + * @author Eike Stepper + */ +public class JMSCreateDestinationIndication extends IndicationWithResponse +{ + private boolean ok; + + public JMSCreateDestinationIndication(JMSAdminServerProtocol protocol) + { + super(protocol, JMSAdminProtocolConstants.SIGNAL_CREATE_DESTINATION); + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws Exception + { + byte type = in.readByte(); + String name = in.readString(); + JMSAdminServerProtocol protocol = (JMSAdminServerProtocol)getProtocol(); + IServer server = protocol.getServer(); + IDestination destination = server.createDestination(name, getDestinationType(type)); + if (destination != null) + { + ok = true; + } + } + + @Override + protected void responding(ExtendedDataOutputStream out) throws Exception + { + out.writeBoolean(ok); + } + + private Type getDestinationType(byte type) + { + switch (type) + { + case JMSAdminProtocolConstants.DESTINATION_TYPE_QUEUE: + return IDestination.Type.QUEUE; + case JMSAdminProtocolConstants.DESTINATION_TYPE_TOPIC: + return IDestination.Type.TOPIC; + } + + throw new IllegalArgumentException("type: " + type); //$NON-NLS-1$ + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/AbstractStore.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/AbstractStore.java new file mode 100644 index 0000000000..49fc030b0f --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/AbstractStore.java @@ -0,0 +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.net4j.jms.internal.server.store; + +import org.eclipse.net4j.jms.server.IStore; +import org.eclipse.net4j.util.lifecycle.Lifecycle; + +/** + * @author Eike Stepper + */ +public abstract class AbstractStore extends Lifecycle implements IStore +{ + private String storeType; + + private String instanceID; + + public AbstractStore(String storeType) + { + this.storeType = storeType; + } + + public String getStoreType() + { + return storeType; + } + + public String getInstanceID() + { + return instanceID; + } + + public void setInstanceID(String instanceID) + { + this.instanceID = instanceID; + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/AbstractTransaction.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/AbstractTransaction.java new file mode 100644 index 0000000000..cf4c883e4e --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/AbstractTransaction.java @@ -0,0 +1,230 @@ +/* + * 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.net4j.jms.internal.server.store; + +import org.eclipse.net4j.internal.jms.MessageImpl; +import org.eclipse.net4j.jms.internal.server.ServerConsumer; +import org.eclipse.net4j.jms.internal.server.ServerDestination; +import org.eclipse.net4j.jms.internal.server.bundle.OM; +import org.eclipse.net4j.jms.server.IDestination; +import org.eclipse.net4j.jms.server.IServerConsumer; +import org.eclipse.net4j.jms.server.IStoreTransaction; +import org.eclipse.net4j.util.om.trace.ContextTracer; + +import javax.jms.Message; + +/** + * @author Eike Stepper + */ +public abstract class AbstractTransaction implements IStoreTransaction +{ + public static final String[] NO_DESTINATION_NAMES = new String[0]; + + public static final long[] NO_CONSUMER_IDS = new long[0]; + + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_STORE, AbstractTransaction.class); + + private AbstractStore store; + + public AbstractTransaction(AbstractStore store) + { + this.store = store; + } + + public AbstractStore getStore() + { + return store; + } + + public String[] getDestinationNames() + { + if (TRACER.isEnabled()) + { + TRACER.trace("Getting destination names"); //$NON-NLS-1$ + } + + String[] names = doGetDestinationNames(); + if (TRACER.isEnabled()) + { + TRACER.trace("Got destination names " + names); //$NON-NLS-1$ + } + + return names; + } + + public ServerDestination getDestination(String name) + { + if (TRACER.isEnabled()) + { + TRACER.trace("Getting destination " + name); //$NON-NLS-1$ + } + + ServerDestination destination = doGetDestination(name); + if (TRACER.isEnabled()) + { + TRACER.trace("Got destination " + destination); //$NON-NLS-1$ + } + + return destination; + } + + public long[] getConsumerIDs() + { + if (TRACER.isEnabled()) + { + TRACER.trace("Getting consumer IDs"); //$NON-NLS-1$ + } + + long[] ids = doGetConsumerIDs(); + if (TRACER.isEnabled()) + { + TRACER.trace("Got consumer IDs " + ids); //$NON-NLS-1$ + } + + return ids; + } + + public ServerConsumer getConsumer(long id) + { + if (TRACER.isEnabled()) + { + TRACER.trace("Getting consumer " + id); //$NON-NLS-1$ + } + + ServerConsumer consumer = doGetConsumer(id); + if (TRACER.isEnabled()) + { + TRACER.trace("Got consumer " + consumer); //$NON-NLS-1$ + } + + return consumer; + } + + public void destinationAdded(IDestination destination) + { + if (TRACER.isEnabled()) + { + TRACER.trace("Adding destination " + destination); //$NON-NLS-1$ + } + + doDestinationAdded((ServerDestination)destination); + if (TRACER.isEnabled()) + { + TRACER.trace("Added destination " + destination); //$NON-NLS-1$ + } + } + + public void destinationRemoved(IDestination destination) + { + if (TRACER.isEnabled()) + { + TRACER.trace("Removing destination " + destination); //$NON-NLS-1$ + } + + doDestinationRemoved((ServerDestination)destination); + if (TRACER.isEnabled()) + { + TRACER.trace("Removed destination " + destination); //$NON-NLS-1$ + } + } + + public void consumerAdded(IServerConsumer consumer) + { + if (TRACER.isEnabled()) + { + TRACER.trace("Adding consumer " + consumer); //$NON-NLS-1$ + } + + doConsumerAdded((ServerConsumer)consumer); + if (TRACER.isEnabled()) + { + TRACER.trace("Added consumer " + consumer); //$NON-NLS-1$ + } + } + + public void consumerRemoved(IServerConsumer consumer) + { + if (TRACER.isEnabled()) + { + TRACER.trace("Removing consumer " + consumer); //$NON-NLS-1$ + } + + doConsumerRemoved((ServerConsumer)consumer); + if (TRACER.isEnabled()) + { + TRACER.trace("Removed consumer " + consumer); //$NON-NLS-1$ + } + } + + public void messageReceived(Message message) + { + if (TRACER.isEnabled()) + { + TRACER.trace("Logging received message " + message); //$NON-NLS-1$ + } + + doMessageReceived((MessageImpl)message); + if (TRACER.isEnabled()) + { + TRACER.trace("Logged received message " + message); //$NON-NLS-1$ + } + } + + public void messageSent(Message message, long consumerID) + { + if (TRACER.isEnabled()) + { + TRACER.trace("Logging sent message " + message); //$NON-NLS-1$ + } + + doMessageSent((MessageImpl)message, consumerID); + if (TRACER.isEnabled()) + { + TRACER.trace("Logged sent message " + message); //$NON-NLS-1$ + } + } + + public void messageAcknowledged(Message message, long consumerID) + { + if (TRACER.isEnabled()) + { + TRACER.trace("Logging acknowledged message " + message); //$NON-NLS-1$ + } + + doMessageAcknowledged((MessageImpl)message, consumerID); + if (TRACER.isEnabled()) + { + TRACER.trace("Logged acknowledged message " + message); //$NON-NLS-1$ + } + } + + protected abstract String[] doGetDestinationNames(); + + protected abstract ServerDestination doGetDestination(String name); + + protected abstract long[] doGetConsumerIDs(); + + protected abstract ServerConsumer doGetConsumer(long id); + + protected abstract void doDestinationAdded(ServerDestination destination); + + protected abstract void doDestinationRemoved(ServerDestination destination); + + protected abstract void doConsumerAdded(ServerConsumer consumer); + + protected abstract void doConsumerRemoved(ServerConsumer consumer); + + protected abstract void doMessageReceived(MessageImpl message); + + protected abstract void doMessageSent(MessageImpl message, long consumerID); + + protected abstract void doMessageAcknowledged(MessageImpl message, long consumerID); +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/NOOPStore.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/NOOPStore.java new file mode 100644 index 0000000000..f149857ce3 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/NOOPStore.java @@ -0,0 +1,40 @@ +/* + * 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.net4j.jms.internal.server.store; + +import org.eclipse.net4j.jms.server.IStoreTransaction; + +/** + * @author Eike Stepper + */ +public class NOOPStore extends AbstractStore +{ + private static final String STORE_TYPE = "NOOP"; //$NON-NLS-1$ + + public NOOPStore() + { + super(STORE_TYPE); + setInstanceID(STORE_TYPE); + } + + public IStoreTransaction startTransaction() + { + return new NOOPTransaction(this); + } + + public void commitTransaction(IStoreTransaction transaction) + { + } + + public void rollbackTransaction(IStoreTransaction transaction) + { + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/NOOPTransaction.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/NOOPTransaction.java new file mode 100644 index 0000000000..1e99f31740 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/NOOPTransaction.java @@ -0,0 +1,85 @@ +/* + * 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.net4j.jms.internal.server.store; + +import org.eclipse.net4j.internal.jms.MessageImpl; +import org.eclipse.net4j.jms.internal.server.ServerConsumer; +import org.eclipse.net4j.jms.internal.server.ServerDestination; + +/** + * @author Eike Stepper + */ +public class NOOPTransaction extends AbstractTransaction +{ + public NOOPTransaction(AbstractStore store) + { + super(store); + } + + @Override + protected String[] doGetDestinationNames() + { + return NO_DESTINATION_NAMES; + } + + @Override + protected ServerDestination doGetDestination(String name) + { + return null; + } + + @Override + protected long[] doGetConsumerIDs() + { + return NO_CONSUMER_IDS; + } + + @Override + protected ServerConsumer doGetConsumer(long id) + { + return null; + } + + @Override + protected void doDestinationAdded(ServerDestination destination) + { + } + + @Override + protected void doDestinationRemoved(ServerDestination destination) + { + } + + @Override + protected void doConsumerAdded(ServerConsumer consumer) + { + } + + @Override + protected void doConsumerRemoved(ServerConsumer consumer) + { + } + + @Override + protected void doMessageReceived(MessageImpl message) + { + } + + @Override + protected void doMessageSent(MessageImpl message, long consumerID) + { + } + + @Override + protected void doMessageAcknowledged(MessageImpl message, long consumerID) + { + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/StoreException.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/StoreException.java new file mode 100644 index 0000000000..a26ac8d570 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/internal/server/store/StoreException.java @@ -0,0 +1,38 @@ +/* + * 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.net4j.jms.internal.server.store; + +/** + * @author Eike Stepper + */ +public class StoreException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + + public StoreException() + { + } + + public StoreException(String message) + { + super(message); + } + + public StoreException(Throwable cause) + { + super(cause); + } + + public StoreException(String message, Throwable cause) + { + super(message, cause); + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IConnection.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IConnection.java new file mode 100644 index 0000000000..92e6cb9abf --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IConnection.java @@ -0,0 +1,25 @@ +/* + * 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.net4j.jms.server; + +/** + * @author Eike Stepper + */ +public interface IConnection +{ + public IServer getServer(); + + public String getUserName(); + + public ISession openSession(int sessionID); + + public ISession getSession(int sessionID); +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IDestination.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IDestination.java new file mode 100644 index 0000000000..860dbe1699 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IDestination.java @@ -0,0 +1,29 @@ +/* + * 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.net4j.jms.server; + +/** + * @author Eike Stepper + */ +public interface IDestination +{ + public String getName(); + + public Type getType(); + + /** + * @author Eike Stepper + */ + public enum Type + { + QUEUE, TOPIC; + } +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IServer.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IServer.java new file mode 100644 index 0000000000..1123120044 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IServer.java @@ -0,0 +1,25 @@ +/* + * 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.net4j.jms.server; + +import org.eclipse.net4j.jms.internal.server.Server; + +/** + * @author Eike Stepper + */ +public interface IServer +{ + public static final IServer INSTANCE = Server.INSTANCE; + + public IDestination createDestination(String name, IDestination.Type type); + + public IConnection logon(String userName, String password); +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IServerConsumer.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IServerConsumer.java new file mode 100644 index 0000000000..401941ddc2 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IServerConsumer.java @@ -0,0 +1,34 @@ +/* + * 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.net4j.jms.server; + +import org.eclipse.net4j.protocol.IProtocol; + +/** + * @author Eike Stepper + * @since 2.0 + */ +public interface IServerConsumer +{ + public long getID(); + + public IDestination getDestination(); + + public String getMessageSelector(); + + public ISession getSession(); + + public IProtocol<?> getProtocol(); + + public boolean isNoLocal(); + + public boolean isDurable(); +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/ISession.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/ISession.java new file mode 100644 index 0000000000..d90a2eb53e --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/ISession.java @@ -0,0 +1,21 @@ +/* + * 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.net4j.jms.server; + +/** + * @author Eike Stepper + */ +public interface ISession +{ + public IConnection getConnection(); + + public int getID(); +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IStore.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IStore.java new file mode 100644 index 0000000000..8320f3a822 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IStore.java @@ -0,0 +1,27 @@ +/* + * 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.net4j.jms.server; + +/** + * @author Eike Stepper + */ +public interface IStore +{ + public String getStoreType(); + + public String getInstanceID(); + + public IStoreTransaction startTransaction(); + + public void commitTransaction(IStoreTransaction transaction); + + public void rollbackTransaction(IStoreTransaction transaction); +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IStoreTransaction.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IStoreTransaction.java new file mode 100644 index 0000000000..0c541b4e1b --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/IStoreTransaction.java @@ -0,0 +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.net4j.jms.server; + +import javax.jms.Message; + +/** + * @author Eike Stepper + */ +public interface IStoreTransaction +{ + public String[] getDestinationNames(); + + /** + * @since 2.0 + */ + public IDestination getDestination(String name); + + public long[] getConsumerIDs(); + + /** + * @since 2.0 + */ + public IServerConsumer getConsumer(long id); + + /** + * @since 2.0 + */ + public void destinationAdded(IDestination destination); + + /** + * @since 2.0 + */ + public void destinationRemoved(IDestination destination); + + /** + * @since 2.0 + */ + public void consumerAdded(IServerConsumer consumer); + + /** + * @since 2.0 + */ + public void consumerRemoved(IServerConsumer consumer); + + /** + * @since 2.0 + */ + public void messageReceived(Message message); + + /** + * @since 2.0 + */ + public void messageSent(Message message, long consumerID); + + /** + * @since 2.0 + */ + public void messageAcknowledged(Message message, long consumerID); +} diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/JMSServerUtil.java b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/JMSServerUtil.java new file mode 100644 index 0000000000..70d000e798 --- /dev/null +++ b/plugins/org.eclipse.net4j.examples.installer/examples/jms.server/src/org/eclipse/net4j/jms/server/JMSServerUtil.java @@ -0,0 +1,37 @@ +/* + * 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.net4j.jms.server; + +import org.eclipse.net4j.jms.internal.server.protocol.JMSServerProtocolFactory; +import org.eclipse.net4j.jms.internal.server.protocol.admin.JMSAdminServerProtocolFactory; +import org.eclipse.net4j.jms.internal.server.store.NOOPStore; +import org.eclipse.net4j.util.container.IManagedContainer; + +/** + * @author Eike Stepper + */ +public final class JMSServerUtil +{ + private JMSServerUtil() + { + } + + public static void prepareContainer(IManagedContainer container) + { + container.registerFactory(new JMSServerProtocolFactory()); + container.registerFactory(new JMSAdminServerProtocolFactory()); + } + + public static IStore createNOOPStore() + { + return new NOOPStore(); + } +} |