Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkuppe2007-11-29 12:10:36 +0000
committermkuppe2007-11-29 12:10:36 +0000
commit42152aed10d0b009d8ec1778da2e18950d8a2c8b (patch)
tree5b80099691f3ae59cae0bb7cba1c0d62200d5e32 /framework/bundles/org.eclipse.ecf.discovery
parent81707365f170dfb5e4de112dc173256e3b90a623 (diff)
downloadorg.eclipse.ecf-42152aed10d0b009d8ec1778da2e18950d8a2c8b.tar.gz
org.eclipse.ecf-42152aed10d0b009d8ec1778da2e18950d8a2c8b.tar.xz
org.eclipse.ecf-42152aed10d0b009d8ec1778da2e18950d8a2c8b.zip
ASSIGNED - bug 209774: Simplify/generalize discovery API (summary bug)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=209774
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.discovery')
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/.classpath2
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/.settings/org.eclipse.jdt.core.prefs329
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/.settings/org.eclipse.jdt.ui.prefs58
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/META-INF/MANIFEST.MF9
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/AbstractDiscoveryContainerAdapter.java277
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainerAdapter.java161
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceInfo.java27
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceListener.java19
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceProperties.java5
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeEvent.java27
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeListener.java5
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java49
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceProperties.java7
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceTypeContainerEvent.java54
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/IServiceID.java8
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java6
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceTypeID.java64
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/service/IDiscoveryService.java1
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryDebugOption.java26
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/Messages.java31
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/messages.properties2
22 files changed, 856 insertions, 315 deletions
diff --git a/framework/bundles/org.eclipse.ecf.discovery/.classpath b/framework/bundles/org.eclipse.ecf.discovery/.classpath
index ce0c7a5d4..7cdeb7319 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/.classpath
+++ b/framework/bundles/org.eclipse.ecf.discovery/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.0%Foundation-1.0"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/framework/bundles/org.eclipse.ecf.discovery/.settings/org.eclipse.jdt.core.prefs b/framework/bundles/org.eclipse.ecf.discovery/.settings/org.eclipse.jdt.core.prefs
index b578b6b5b..9b677ba53 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/.settings/org.eclipse.jdt.core.prefs
+++ b/framework/bundles/org.eclipse.ecf.discovery/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,330 @@
-#Fri Apr 20 14:30:58 GMT-08:00 2007
+#Fri Nov 23 16:51:32 CET 2007
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1
-org.eclipse.jdt.core.compiler.compliance=1.3
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+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.maxProblemPerUnit=1000
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+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=error
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+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=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=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=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+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=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.3
+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_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_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_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.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+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=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+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=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+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.format_guardian_clause_on_one_line=false
+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=true
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=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=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not 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=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not 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=do not 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=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=do not 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_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_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=do not 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_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=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=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_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_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.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=800
+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=false
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+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.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/framework/bundles/org.eclipse.ecf.discovery/.settings/org.eclipse.jdt.ui.prefs b/framework/bundles/org.eclipse.ecf.discovery/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..1546d829a
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.discovery/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,58 @@
+#Tue Aug 21 11:27:48 CDT 2007
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_core
+formatter_settings_version=11
+internal.default.compliance=user
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=;
+org.eclipse.jdt.ui.ondemandthreshold=3
+org.eclipse.jdt.ui.staticondemandthreshold=99
+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_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+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=false
+sp_cleanup.format_source_code=true
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=false
+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=false
+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=false
+sp_cleanup.remove_unused_imports=false
+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=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/framework/bundles/org.eclipse.ecf.discovery/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.discovery/META-INF/MANIFEST.MF
index 9f5ee3f20..3596cfecf 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/META-INF/MANIFEST.MF
+++ b/framework/bundles/org.eclipse.ecf.discovery/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.ecf.discovery;singleton:=true
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.eclipse.ecf.internal.discovery.DiscoveryPlugin
Bundle-Vendor: %plugin.provider
Bundle-Localization: plugin
@@ -11,8 +11,9 @@ Export-Package: org.eclipse.ecf.discovery,
org.eclipse.ecf.discovery.identity,
org.eclipse.ecf.discovery.service,
org.eclipse.ecf.internal.discovery;x-internal:=true
-Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0,
- J2SE-1.3
+Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
+ J2SE-1.4
Require-Bundle: org.eclipse.equinox.common,
org.eclipse.ecf
-Import-Package: org.osgi.framework;version="1.3.0"
+Import-Package: org.eclipse.osgi.util;version="1.1.0",
+ org.osgi.framework;version="1.3.0"
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/AbstractDiscoveryContainerAdapter.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/AbstractDiscoveryContainerAdapter.java
index ac01c09f1..bb8bc67b3 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/AbstractDiscoveryContainerAdapter.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/AbstractDiscoveryContainerAdapter.java
@@ -10,40 +10,42 @@
******************************************************************************/
package org.eclipse.ecf.discovery;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
+import java.util.*;
import org.eclipse.core.runtime.Assert;
import org.eclipse.ecf.core.AbstractContainer;
import org.eclipse.ecf.core.IContainer;
-import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.core.identity.IDFactory;
-import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.core.identity.*;
+import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.discovery.identity.IServiceTypeID;
+import org.eclipse.ecf.internal.discovery.DiscoveryDebugOption;
+import org.eclipse.ecf.internal.discovery.DiscoveryPlugin;
public abstract class AbstractDiscoveryContainerAdapter extends AbstractContainer implements IDiscoveryContainerAdapter, IContainer {
- protected final String servicesNamespaceName;
+ /**
+ * Collection of service listeners i.e. Collection<IServiceListener>.
+ * NOTE: Access to this collection is synchronized, so subclasses should take this into account.
+ */
+ protected final Set allServiceListeners;
- protected final DiscoveryContainerConfig config;
+ private DiscoveryContainerConfig config;
/**
* Map of service type to collection of service listeners i.e. <String,Collection<IServiceListener>>.
* NOTE: Access to this map is synchronized, so subclasses should take this into account.
*/
protected final Map serviceListeners;
+ protected final String servicesNamespaceName;
/**
* Collection of service type listeners i.e. Collection<IServiceTypeListener>.
* NOTE: Access to this collection is synchronized, so subclasses should take this into account.
*/
protected final Collection serviceTypeListeners;
+ /**
+ * @param aNamespaceName
+ * @param aConfig
+ */
public AbstractDiscoveryContainerAdapter(String aNamespaceName, DiscoveryContainerConfig aConfig) {
servicesNamespaceName = aNamespaceName;
Assert.isNotNull(servicesNamespaceName);
@@ -51,126 +53,151 @@ public abstract class AbstractDiscoveryContainerAdapter extends AbstractContaine
Assert.isNotNull(config);
serviceTypeListeners = Collections.synchronizedSet(new HashSet());
serviceListeners = Collections.synchronizedMap(new HashMap());
+ allServiceListeners = Collections.synchronizedSet(new HashSet());
}
- protected DiscoveryContainerConfig getConfig() {
- return config;
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#addServiceListener(org.eclipse.ecf.discovery.IServiceListener)
+ */
+ public void addServiceListener(IServiceListener aListener) {
+ Assert.isNotNull(aListener);
+ allServiceListeners.add(aListener);
}
- /**
- * @deprecated
- * @see org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#addServiceListener(java.lang.String,
- * org.eclipse.ecf.discovery.IServiceListener)
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#addServiceListener(org.eclipse.ecf.discovery.identity.IServiceTypeID, org.eclipse.ecf.discovery.IServiceListener)
*/
- public void addServiceListener(String type, IServiceListener listener) {
- if (type == null || listener == null) {
- return;
- }
+ public void addServiceListener(IServiceTypeID aType, IServiceListener aListener) {
+ Assert.isNotNull(aListener);
+ Assert.isNotNull(aType);
synchronized (serviceListeners) { // put-if-absent idiom race condition
- Collection v = (Collection) serviceListeners.get(type);
+ Collection v = (Collection) serviceListeners.get(aType);
if (v == null) {
v = Collections.synchronizedSet(new HashSet());
- serviceListeners.put(type, v);
+ serviceListeners.put(aType, v);
}
- v.add(listener);
+ v.add(aListener);
}
}
- /*
- * (non-Javadoc)
- *
+ /* (non-Javadoc)
* @see org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#addServiceTypeListener(org.eclipse.ecf.discovery.IServiceTypeListener)
*/
- public void addServiceTypeListener(IServiceTypeListener listener) {
- if (listener == null)
- return;
- synchronized (serviceTypeListeners) {
- serviceTypeListeners.add(listener);
- }
+ public void addServiceTypeListener(IServiceTypeListener aListener) {
+ Assert.isNotNull(aListener);
+ serviceTypeListeners.add(aListener);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ecf.core.IContainer#dispose()
+ protected void clearListeners() {
+ serviceListeners.clear();
+ serviceTypeListeners.clear();
+ allServiceListeners.clear();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.AbstractContainer#dispose()
*/
public void dispose() {
disconnect();
+ clearListeners();
+ config = null;
super.dispose();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ecf.core.IContainer#getConnectNamespace()
+ /**
+ * Calls {@link IServiceListener#serviceDiscovered(IServiceEvent)} for all registered {@link IServiceListener}
+ * @param aServiceEvent The {@link IServiceEvent} to send along the call
*/
- public Namespace getConnectNamespace() {
- return IDFactory.getDefault().getNamespaceByName(servicesNamespaceName);
+ protected void fireServiceDiscovered(IServiceEvent aServiceEvent) {
+ Assert.isNotNull(aServiceEvent);
+ final Collection listeners = getListeners(aServiceEvent.getServiceInfo().getServiceID().getServiceTypeID());
+ if (listeners != null) {
+ for (final Iterator i = listeners.iterator(); i.hasNext();) {
+ final IServiceListener l = (IServiceListener) i.next();
+ l.serviceDiscovered(aServiceEvent);
+ Trace.trace(DiscoveryPlugin.PLUGIN_ID, DiscoveryDebugOption.METHODS_TRACING, this.getClass(), "fireServiceDiscovered", aServiceEvent.toString()); //$NON-NLS-1$
+ }
+ }
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ecf.core.identity.IIdentifiable#getID()
+ /**
+ * Calls {@link IServiceTypeListener#serviceTypeDiscovered(IServiceTypeEvent)} for all registered {@link IServiceTypeListener}
+ * @param aServiceTypeEvent The {@link IServiceTypeEvent} to send along the call
*/
- public ID getID() {
- if (config != null) {
- return config.getID();
+ protected void fireServiceTypeDiscovered(IServiceTypeEvent aServiceTypeEvent) {
+ Assert.isNotNull(aServiceTypeEvent);
+ List notify = null;
+ synchronized (serviceTypeListeners) {
+ notify = new ArrayList(serviceTypeListeners);
+ }
+ for (final Iterator i = notify.iterator(); i.hasNext();) {
+ final IServiceTypeListener l = (IServiceTypeListener) i.next();
+ l.serviceTypeDiscovered(aServiceTypeEvent);
+ Trace.trace(DiscoveryPlugin.PLUGIN_ID, DiscoveryDebugOption.METHODS_TRACING, this.getClass(), "fireServiceTypeDiscovered", aServiceTypeEvent.toString()); //$NON-NLS-1$
}
- return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#removeServiceListener(org.eclipse.ecf.discovery.identity.IServiceTypeID, org.eclipse.ecf.discovery.IServiceListener)
+ /**
+ * Calls {@link IServiceListener#serviceUndiscovered(IServiceEvent)} for all registered {@link IServiceListener}
+ * @param aServiceEvent The {@link IServiceEvent} to send along the call
*/
- public void removeServiceListener(IServiceTypeID type, IServiceListener listener) {
- removeServiceListener(type.getName(), listener);
+ protected void fireServiceUndiscovered(IServiceEvent aServiceEvent) {
+ Assert.isNotNull(aServiceEvent);
+ final Collection listeners = getListeners(aServiceEvent.getServiceInfo().getServiceID().getServiceTypeID());
+ if (listeners != null) {
+ for (final Iterator i = listeners.iterator(); i.hasNext();) {
+ final IServiceListener l = (IServiceListener) i.next();
+ l.serviceUndiscovered(aServiceEvent);
+ Trace.trace(DiscoveryPlugin.PLUGIN_ID, DiscoveryDebugOption.METHODS_TRACING, this.getClass(), "fireServiceUndiscovered", aServiceEvent.toString()); //$NON-NLS-1$
+ }
+ }
+ }
+
+ /**
+ * @return The {@link DiscoveryContainerConfig} of this {@link IDiscoveryContainerAdapter}
+ */
+ protected DiscoveryContainerConfig getConfig() {
+ return config;
}
/* (non-Javadoc)
- * @see org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#addServiceListener(org.eclipse.ecf.discovery.identity.IServiceTypeID, org.eclipse.ecf.discovery.IServiceListener)
+ * @see org.eclipse.ecf.core.IContainer#getConnectNamespace()
*/
- public void addServiceListener(IServiceTypeID type, IServiceListener listener) {
- addServiceListener(type.getName(), listener);
+ public Namespace getConnectNamespace() {
+ return IDFactory.getDefault().getNamespaceByName(servicesNamespaceName);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#removeServiceTypeListener(org.eclipse.ecf.discovery.IServiceTypeListener)
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.identity.IIdentifiable#getID()
*/
- public void removeServiceTypeListener(IServiceTypeListener listener) {
- if (listener == null)
- return;
- synchronized (serviceTypeListeners) {
- serviceTypeListeners.remove(listener);
+ public ID getID() {
+ if (config != null) {
+ return config.getID();
}
+ return null;
}
+ // merges the allServiceListener with the serviceListeners for the given type
+
/**
- * @deprecated
- * @see org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#removeServiceListener(java.lang.String,
- * org.eclipse.ecf.discovery.IServiceListener)
+ * Joins the {@link Collection} of {@link IServiceListener}s interested in any {@link IServiceTypeID} with
+ * the {@link Collection} of the {@link IServiceListener} registered for the given {@link IServiceTypeID}
+ * @param aServiceType The {@link IServiceTypeID} for which the {@link IServiceListener}s are returned
+ * @return All {@link IServiceListener}s interested in the given {@link IServiceTypeID}
*/
- public void removeServiceListener(String type, IServiceListener listener) {
- if (type == null || listener == null) {
- return;
- }
+ protected Collection getListeners(IServiceTypeID aServiceType) {
+ Assert.isNotNull(aServiceType);
+ Collection listeners = new HashSet();
synchronized (serviceListeners) {
- final Collection v = (Collection) serviceListeners.get(type);
- if (v != null) {
- v.remove(listener);
+ Collection collection = (Collection) serviceListeners.get(aServiceType);
+ if (collection != null) {
+ listeners.addAll(collection);
}
}
- }
-
- protected void clearListeners() {
- synchronized (serviceListeners) {
- serviceListeners.clear();
- }
- synchronized (serviceTypeListeners) {
- serviceTypeListeners.clear();
+ synchronized (allServiceListeners) {
+ listeners.addAll(allServiceListeners);
}
+ return Collections.unmodifiableCollection(listeners);
}
/* (non-Javadoc)
@@ -180,65 +207,33 @@ public abstract class AbstractDiscoveryContainerAdapter extends AbstractContaine
return IDFactory.getDefault().getNamespaceByName(servicesNamespaceName);
}
- protected void fireServiceTypeAdded(IServiceEvent serviceEvent) {
- if (serviceEvent == null)
- return;
- List notify = null;
- synchronized (serviceTypeListeners) {
- notify = new ArrayList(serviceTypeListeners);
- }
- for (final Iterator i = notify.iterator(); i.hasNext();) {
- final IServiceTypeListener l = (IServiceTypeListener) i.next();
- l.serviceTypeAdded(serviceEvent);
- }
- }
-
- protected void fireServiceAdded(IServiceEvent serviceEvent) {
- if (serviceEvent == null)
- return;
- Collection notify = null;
- synchronized (serviceListeners) {
- final Collection orig = (Collection) serviceListeners.get(serviceEvent.getServiceInfo().getServiceID().getServiceTypeID().getName());
- if (orig != null)
- notify = new ArrayList(orig);
- }
- if (notify != null) {
- for (final Iterator i = notify.iterator(); i.hasNext();) {
- final IServiceListener l = (IServiceListener) i.next();
- l.serviceAdded(serviceEvent);
- }
- }
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#removeServiceListener(org.eclipse.ecf.discovery.IServiceListener)
+ */
+ public void removeServiceListener(IServiceListener aListener) {
+ Assert.isNotNull(aListener);
+ allServiceListeners.remove(aListener);
}
- protected void fireServiceRemoved(IServiceEvent serviceEvent) {
- Collection notify = null;
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#removeServiceListener(org.eclipse.ecf.discovery.identity.IServiceTypeID, org.eclipse.ecf.discovery.IServiceListener)
+ */
+ public void removeServiceListener(IServiceTypeID aType, IServiceListener aListener) {
+ Assert.isNotNull(aListener);
+ Assert.isNotNull(aType);
synchronized (serviceListeners) {
- final Collection orig = (Collection) serviceListeners.get(serviceEvent.getServiceInfo().getServiceID().getServiceTypeID().getName());
- if (orig != null)
- notify = new ArrayList(orig);
- }
- if (notify != null) {
- for (final Iterator i = notify.iterator(); i.hasNext();) {
- final IServiceListener l = (IServiceListener) i.next();
- l.serviceRemoved(serviceEvent);
+ final Collection v = (Collection) serviceListeners.get(aType);
+ if (v != null) {
+ v.remove(aListener);
}
}
}
- protected void fireServiceResolved(IServiceEvent serviceEvent) {
- if (serviceEvent == null)
- return;
- Collection notify = null;
- synchronized (serviceListeners) {
- final Collection orig = (Collection) serviceListeners.get(serviceEvent.getServiceInfo().getServiceID().getServiceTypeID().getName());
- if (orig != null)
- notify = new ArrayList(orig);
- }
- if (notify != null) {
- for (final Iterator i = notify.iterator(); i.hasNext();) {
- final IServiceListener l = (IServiceListener) i.next();
- l.serviceResolved(serviceEvent);
- }
- }
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#removeServiceTypeListener(org.eclipse.ecf.discovery.IServiceTypeListener)
+ */
+ public void removeServiceTypeListener(IServiceTypeListener aListener) {
+ Assert.isNotNull(aListener);
+ serviceTypeListeners.remove(aListener);
}
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainerAdapter.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainerAdapter.java
index 29d794114..2fe40ad4b 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainerAdapter.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainerAdapter.java
@@ -12,15 +12,13 @@ package org.eclipse.ecf.discovery;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.ecf.core.identity.Namespace;
import org.eclipse.ecf.core.util.ECFException;
-import org.eclipse.ecf.discovery.identity.IServiceID;
-import org.eclipse.ecf.discovery.identity.IServiceTypeID;
-import org.eclipse.ecf.discovery.identity.ServiceIDFactory;
+import org.eclipse.ecf.discovery.identity.*;
/**
* Entry point discovery container adapter. This interface exposes the ability
* to add/remove listeners for newly discovered services and service types,
* register and unregister locally provided services, and get (synch) and
- * request (asynch) service info from a remote service provider.
+ * request (asynchronous) service info from a remote service provider.
* <p>
* This interface can be used by container provider implementations as an
* adapter so that calls to
@@ -33,22 +31,13 @@ import org.eclipse.ecf.discovery.identity.ServiceIDFactory;
public interface IDiscoveryContainerAdapter extends IAdaptable {
/**
- * Add a service type listener. The given listener will have its method
- * called when a service type is discovered.
- *
- * @param listener
- * the listener to be notified. Must not be <code>null</code>.
- */
- public void addServiceTypeListener(IServiceTypeListener listener);
-
- /**
- * Remove a service type listener. Remove the type listener.
+ * Add a service listener. The given listener will have its method called
+ * when a service is discovered.
*
* @param listener
- * IServiceTypeListener to be removed. Must not be
- * <code>null</code>.
+ * IServiceListener to be notified. Must not be <code>null</code>.
*/
- public void removeServiceTypeListener(IServiceTypeListener listener);
+ public void addServiceListener(IServiceListener listener);
/**
* Add a service listener. The given listener will have its method called
@@ -57,45 +46,69 @@ public interface IDiscoveryContainerAdapter extends IAdaptable {
*
* @param type
* String type to listen for. Must not be <code>null</code>.
- * Must be formatted accroding to this specific IDiscoveryContainer
+ * Must be formatted according to this specific IDiscoveryContainer
* @param listener
* IServiceListener to be notified. Must not be <code>null</code>.
- * @deprecated Use addServiceListener(IServiceTypeID, IServiceListener) instead.
*/
- public void addServiceListener(String type, IServiceListener listener);
-
public void addServiceListener(IServiceTypeID type, IServiceListener listener);
/**
- * Remove a service listener. Remove the listener associated with the type
- * specified by the first parameter.
+ * Add a service type listener. The given listener will have its method
+ * called when a service type is discovered.
*
- * @param type
- * String of the desired type to remove the listener. Must not be
- * <code>null</code>.
- * Must be formatted accroding to this specific IDiscoveryContainer
* @param listener
- * IServiceListener listener to be removed. Must not be
+ * the listener to be notified. Must not be <code>null</code>.
+ */
+ public void addServiceTypeListener(IServiceTypeListener listener);
+
+ /**
+ * Synchronously retrieve info about the service
+ *
+ * @param service
+ * IServiceID of the service to get info about. Must not be
* <code>null</code>.
- * @deprecated Use removeServiceListener(IServiceTypeID, IServiceListener) instead.
+ * @return IServiceInfo the service info retrieved. <code>null</code> if
+ * no information retrievable.
*/
- public void removeServiceListener(String type, IServiceListener listener);
+ public IServiceInfo getServiceInfo(IServiceID service);
- public void removeServiceListener(IServiceTypeID type, IServiceListener listener);
+ /**
+ * Synchronously get service info about all known services
+ *
+ * @return IServiceInfo[] the resulting array of service info instances.
+ * Will not be <code>null</code>. May be of length 0.
+ */
+ public IServiceInfo[] getServices();
/**
- * Register the given service type. This publishes the given service type to
- * the underlying publishing mechanism
+ * Synchronously get service info about all known services of given service type
*
- * @param serviceType
- * String of the serviceType to be published. Must not be
- * <code>null</code>.
- * Must be formatted accroding to this specific IDiscoveryContainer
- * @deprecated Use registerServiceType(IServiceTypeID) instead.
+ * @param type
+ * IServiceTypeID defining the type of service we are interested in
+ * getting service info about. Must not be <code>null</code>
+ * @return IServiceInfo[] the resulting array of service info instances.
+ * Will not be <code>null</code>. May be of length 0.
*/
- public void registerServiceType(String serviceType);
+ public IServiceInfo[] getServices(IServiceTypeID type);
- public void registerServiceType(IServiceTypeID type);
+ /**
+ * Get a Namespace for services associated with this discovery container adapter. The given Namespace
+ * may be used via {@link ServiceIDFactory} to create IServiceIDs rather than simple IDs. For example:
+ * <pre>
+ * IServiceID serviceID = ServiceIDFactory.getDefault().createServiceID(container.getServicesNamespace(),serviceType,serviceName);
+ * </pre>
+ *
+ * @return Namespace for creating service IDs. Will not be <code>null</code>.
+ */
+ public Namespace getServicesNamespace();
+
+ /**
+ * Synchronously get service info about all known services of given service type
+ *
+ * @return IServiceTypeID[] the resulting array of service type IDs.
+ * Will not be <code>null</code>. May be of length 0.
+ */
+ public IServiceTypeID[] getServiceTypes();
/**
* Register the given service. This publishes the service defined by the
@@ -110,65 +123,45 @@ public interface IDiscoveryContainerAdapter extends IAdaptable {
public void registerService(IServiceInfo serviceInfo) throws ECFException;
/**
- * Synchronously (within given timeout) retrieve info about the service
- * defined by the first parameter.
+ * Remove a service listener. Remove the listener from this container
*
- * @param service
- * IServiceID of the service to get info about. Must not be
+ * @param listener
+ * IServiceListener listener to be removed. Must not be
* <code>null</code>.
- * @param timeout
- * int time to wait for a response (in ms)
- * @return IServiceInfo the service info retrieved. <code>null</code> if
- * no information retrieved within timeout.
*/
- public IServiceInfo getServiceInfo(IServiceID service, int timeout);
+ public void removeServiceListener(IServiceListener listener);
/**
- * Asynchronously (within given timeout) retrieve info about the service
- * defined by the first parameter. Sends a request for service information
- * and returns. Answers to such requests occur via {@link IServiceListener}'s
- * {@link IServiceListener#serviceResolved(IServiceEvent) serviceResolved(IServiceEvent)}
- * method.
+ * Remove a service listener. Remove the listener associated with the type
+ * specified by the first parameter.
*
- * @param service
- * ServiceID of the service to get info about. Must not be
+ * @param type
+ * String of the desired type to remove the listener. Must not be
* <code>null</code>.
- * @param timeout
- * int time to wait for a response (in ms)
- */
- public void requestServiceInfo(IServiceID service, int timeout);
-
- /**
- * Unregister service defined by serviceInfo.
- *
- * @param serviceInfo
- * IServiceInfo defining the service to unregister. Must not be
+ * Must be formatted according to this specific IDiscoveryContainer
+ * @param listener
+ * IServiceListener listener to be removed. Must not be
* <code>null</code>.
*/
- public void unregisterService(IServiceInfo serviceInfo);
+ public void removeServiceListener(IServiceTypeID type, IServiceListener listener);
/**
- * Get service info about all known services of given service type
+ * Remove a service type listener. Remove the type listener.
*
- * @param type
- * String defining the type of service we are interested in
- * getting service info about. Must not be <code>null</code>
- * @return IServiceInfo[] the resulting array of service info instances.
- * Will not be <code>null</code>. May be of length 0.
- * @deprecated Use getServices(IServiceTypeID) instead.
+ * @param listener
+ * IServiceTypeListener to be removed. Must not be
+ * <code>null</code>.
*/
- public IServiceInfo[] getServices(String type);
-
- public IServiceInfo[] getServices(IServiceTypeID type);
+ public void removeServiceTypeListener(IServiceTypeListener listener);
/**
- * Get a namespace for services associated with this discovery container adapter. The given namespace
- * may be used via {@link ServiceIDFactory} to create IServiceIDs rather than simple IDs. For example:
- * <pre>
- * IServiceID serviceID = ServiceIDFactory.getDefault().createServiceID(container.getServicesNamespace(),serviceType,serviceName);
- * </pre>
+ * Unregister a previously registered service defined by serviceInfo.
*
- * @return Namespace for creating service IDs. Will not be <code>null</code>.
+ * @param serviceInfo
+ * IServiceInfo defining the service to unregister. Must not be
+ * <code>null</code>.
+ * @throws ECFException
+ * if service info cannot be unregistered with this service
*/
- public Namespace getServicesNamespace();
+ public void unregisterService(IServiceInfo serviceInfo) throws ECFException;
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceInfo.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceInfo.java
index 1d69c496a..c58bb4fdb 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceInfo.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceInfo.java
@@ -9,23 +9,22 @@
package org.eclipse.ecf.discovery;
-import java.net.InetAddress;
-
+import java.net.URI;
import org.eclipse.ecf.discovery.identity.IServiceID;
/**
- * Service information contrace. Defines the information associated with a
+ * Service information contract. Defines the information associated with a
* remotely discoverable service
*
*/
public interface IServiceInfo {
/**
- * Get InetAddress for service
+ * Get URI for service
*
- * @return InetAddress the address for the service. May be <code>null</code> if address
+ * @return {@link java.net.URI} the location for the service. May be <code>null</code> if location
* is not known.
*/
- public InetAddress getAddress();
+ public URI getLocation();
/**
* Get ServiceID for service.
@@ -35,13 +34,6 @@ public interface IServiceInfo {
public IServiceID getServiceID();
/**
- * The port for the service
- *
- * @return port
- */
- public int getPort();
-
- /**
* The priority for the service
*
* @return int the priority. Zero if no priority information for service.
@@ -62,13 +54,4 @@ public interface IServiceInfo {
* @return Map the properties associated with this service. Will not be <code>null</code>.
*/
public IServiceProperties getServiceProperties();
-
- /**
- * Returns true if this service info has been resolved by the service
- * publisher, false if not.
- *
- * @return true if this instance has been resolved, false if not
- */
- public boolean isResolved();
-
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceListener.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceListener.java
index 6b9ff2e84..5f73d24db 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceListener.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceListener.java
@@ -36,25 +36,18 @@ package org.eclipse.ecf.discovery;
* via I/O operations or blocking UI calls.
*/
public interface IServiceListener {
- /**
- * Notification that a service has been added.
- *
- * @param event Will not be <code>null</code>.
- */
- public void serviceAdded(IServiceEvent event);
/**
- * Notification that a service has been removed.
+ * Notification that a service has been discovered (the service is fully resolved).
*
- * @param event Will not be <code>null</code>.
+ * @param anEvent Will not be <code>null</code>
*/
- public void serviceRemoved(IServiceEvent event);
+ public void serviceDiscovered(IServiceEvent anEvent);
/**
- * Notification that a service has been resolved (that complete service info
- * is now available).
+ * Notification that a previously discovered service has been undiscovered.
*
- * @param event Will not be <code>null</code>.
+ * @param anEvent Will not be <code>null</code>
*/
- public void serviceResolved(IServiceEvent event);
+ public void serviceUndiscovered(IServiceEvent anEvent);
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceProperties.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceProperties.java
index 725f772dd..b44c83f55 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceProperties.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceProperties.java
@@ -10,6 +10,7 @@
package org.eclipse.ecf.discovery;
import java.util.Enumeration;
+import java.util.Properties;
public interface IServiceProperties {
/**
@@ -95,4 +96,8 @@ public interface IServiceProperties {
*/
public Object setProperty(String name, Object value);
+ /**
+ * @return A copy of this {@link IServiceProperties} as a {@link Properties}
+ */
+ public Properties asProperties();
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeEvent.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeEvent.java
new file mode 100644
index 000000000..223081961
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeEvent.java
@@ -0,0 +1,27 @@
+/****************************************************************************
+ * Copyright (c) 2007 Composent, Inc. 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:
+ * Composent, Inc. - initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.ecf.discovery;
+
+import org.eclipse.ecf.core.events.IContainerEvent;
+import org.eclipse.ecf.discovery.identity.IServiceTypeID;
+
+/**
+ * Service type discovery event that provides access to service type
+ */
+public interface IServiceTypeEvent extends IContainerEvent {
+
+ /**
+ * Get service type id for this service type event.
+ * @return IServiceTypeID for this service type event. Will not be <code>null</code>.
+ */
+ public IServiceTypeID getServiceTypeID();
+}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeListener.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeListener.java
index 5009f78bf..4c469d1cf 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeListener.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeListener.java
@@ -35,10 +35,11 @@ package org.eclipse.ecf.discovery;
* via I/O operations or blocking UI calls.
*/
public interface IServiceTypeListener {
+
/**
- * Notification that a service type has been added
+ * Notification that a service type has been discovered
*
* @param event Must not be <code>null</code>.
*/
- public void serviceTypeAdded(IServiceEvent event);
+ public void serviceTypeDiscovered(IServiceTypeEvent event);
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java
index 1d675b983..9b9cb72ef 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java
@@ -10,8 +10,7 @@
package org.eclipse.ecf.discovery;
import java.io.Serializable;
-import java.net.InetAddress;
-
+import java.net.URI;
import org.eclipse.ecf.discovery.identity.IServiceID;
/**
@@ -22,47 +21,48 @@ public class ServiceInfo implements IServiceInfo, Serializable {
private static final long serialVersionUID = -5651115550295457142L;
- public static final int DEFAULT_PRIORITY = -1;
- public static final int DEFAULT_WEIGHT = -1;
+ public static final int DEFAULT_PRIORITY = 0;
+ public static final int DEFAULT_WEIGHT = 0;
- protected InetAddress addr = null;
+ protected URI uri = null;
protected IServiceID serviceID;
- protected int port;
-
protected int priority;
protected int weight;
protected IServiceProperties properties;
- public ServiceInfo(InetAddress address, IServiceID serviceID, int port, int priority, int weight, IServiceProperties props) {
- this.addr = address;
+ public ServiceInfo() {
+ // null constructor for subclasses
+ }
+
+ public ServiceInfo(URI anURI, IServiceID serviceID, int priority, int weight, IServiceProperties props) {
+ this.uri = anURI;
this.serviceID = serviceID;
- this.port = port;
this.priority = priority;
this.weight = weight;
this.properties = props;
}
- public ServiceInfo(InetAddress address, IServiceID serviceID, int port, IServiceProperties props) {
- this(address, serviceID, port, DEFAULT_PRIORITY, DEFAULT_WEIGHT, props);
+ public ServiceInfo(URI anURI, IServiceID serviceID, IServiceProperties props) {
+ this(anURI, serviceID, DEFAULT_PRIORITY, DEFAULT_WEIGHT, props);
}
- public ServiceInfo(InetAddress address, IServiceID serviceID, int port) {
- this(address, serviceID, port, DEFAULT_PRIORITY, DEFAULT_WEIGHT, new ServiceProperties());
+ public ServiceInfo(URI anURI, IServiceID serviceID) {
+ this(anURI, serviceID, DEFAULT_PRIORITY, DEFAULT_WEIGHT, new ServiceProperties());
}
/* (non-Javadoc)
* @see org.eclipse.ecf.discovery.IServiceInfo#getAddress()
*/
- public InetAddress getAddress() {
- return addr;
+ public URI getLocation() {
+ return uri;
}
- protected void setAddress(InetAddress address) {
- this.addr = address;
+ protected void setLocation(URI address) {
+ this.uri = address;
}
/* (non-Javadoc)
@@ -73,13 +73,6 @@ public class ServiceInfo implements IServiceInfo, Serializable {
}
/* (non-Javadoc)
- * @see org.eclipse.ecf.discovery.IServiceInfo#getPort()
- */
- public int getPort() {
- return port;
- }
-
- /* (non-Javadoc)
* @see org.eclipse.ecf.discovery.IServiceInfo#getPriority()
*/
public int getPriority() {
@@ -104,7 +97,7 @@ public class ServiceInfo implements IServiceInfo, Serializable {
* @see org.eclipse.ecf.discovery.IServiceInfo#isResolved()
*/
public boolean isResolved() {
- return (addr != null);
+ return (uri != null);
}
/* (non-Javadoc)
@@ -112,8 +105,8 @@ public class ServiceInfo implements IServiceInfo, Serializable {
*/
public String toString() {
final StringBuffer buf = new StringBuffer("ServiceInfo["); //$NON-NLS-1$
- buf.append("addr=").append(addr).append(";id=").append(serviceID) //$NON-NLS-1$ //$NON-NLS-2$
- .append(";port=").append(port).append(";priority=").append( //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append("uri=").append(uri).append(";id=").append(serviceID) //$NON-NLS-1$ //$NON-NLS-2$
+ .append(";priority=").append( //$NON-NLS-1$
priority).append(";weight=").append(weight).append( //$NON-NLS-1$
";props=").append(properties).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
return buf.toString();
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceProperties.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceProperties.java
index b0939eec7..6c365d241 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceProperties.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceProperties.java
@@ -93,4 +93,11 @@ public class ServiceProperties implements IServiceProperties {
public Object setPropertyString(String name, String value) {
return props.put(name, value);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IServiceProperties#asProperties()
+ */
+ public Properties asProperties() {
+ return new Properties(props);
+ }
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceTypeContainerEvent.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceTypeContainerEvent.java
new file mode 100644
index 000000000..18e901b98
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceTypeContainerEvent.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2004 Composent, Inc. 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: Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.ecf.discovery;
+
+import org.eclipse.ecf.core.identity.ID;
+import org.eclipse.ecf.discovery.identity.IServiceTypeID;
+
+/**
+ * Base event implementation of {@link IServiceEvent}. Subclasses
+ * may be created as appropriate.
+ */
+public class ServiceTypeContainerEvent implements IServiceTypeEvent {
+
+ private static final long serialVersionUID = -2989101661453584041L;
+
+ protected IServiceTypeID serviceType;
+
+ protected ID containerID;
+
+ public ServiceTypeContainerEvent(IServiceTypeID serviceType, ID containerID) {
+ this.serviceType = serviceType;
+ this.containerID = containerID;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.events.IContainerEvent#getLocalContainerID()
+ */
+ public ID getLocalContainerID() {
+ return containerID;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ final StringBuffer buf = new StringBuffer("ServiceTypeContainerEvent["); //$NON-NLS-1$
+ buf.append("servicetypeid=").append(getServiceTypeID()).append(";containerid=").append(getLocalContainerID()).append("]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return buf.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IServiceTypeEvent#getServiceTypeID()
+ */
+ public IServiceTypeID getServiceTypeID() {
+ return serviceType;
+ }
+}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/IServiceID.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/IServiceID.java
index 6c326bb5d..43f3af549 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/IServiceID.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/IServiceID.java
@@ -19,14 +19,6 @@ import org.eclipse.ecf.core.identity.ID;
public interface IServiceID extends ID {
/**
- * Get service type for this ID.
- * Delegates to getServiceTypeID().getName()
- * @return String service type. Will not be <code>null</code>.
- * @deprecated Use getServiceTypeID() instead!
- */
- public String getServiceType();
-
- /**
* Get service type ID for this ID.
* @return IServiceTypeID. Will not be <code>null</code>.
*/
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java
index bf8ffbfcb..69aa7498b 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java
@@ -35,8 +35,7 @@ public class ServiceID extends BaseID implements IServiceID {
protected String getFullyQualifiedName() {
if (name == null)
return type.getName();
- else
- return type.getName() + "@" + name;
+ return type.getName() + "@" + name; //$NON-NLS-1$
}
/* (non-Javadoc)
@@ -47,9 +46,8 @@ public class ServiceID extends BaseID implements IServiceID {
final ServiceID other = (ServiceID) o;
final String typename = other.getFullyQualifiedName();
return getFullyQualifiedName().compareTo(typename);
- } else {
- return 1;
}
+ return 1;
}
/* (non-Javadoc)
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceTypeID.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceTypeID.java
index 27082fdcc..c6471f51e 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceTypeID.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceTypeID.java
@@ -11,9 +11,12 @@
package org.eclipse.ecf.discovery.identity;
+import java.util.Arrays;
+import java.util.List;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.ecf.core.identity.BaseID;
-import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.core.identity.*;
+import org.eclipse.ecf.core.util.StringUtils;
+import org.eclipse.ecf.internal.discovery.Messages;
/**
* ServiceTypeID base class.
@@ -50,6 +53,39 @@ public class ServiceTypeID extends BaseID implements IServiceTypeID {
Assert.isNotNull(typeName);
}
+ protected ServiceTypeID(Namespace ns, IServiceTypeID id) {
+ this(ns, id.getServices(), id.getScopes(), id.getProtocols(), id.getNamingAuthority());
+ }
+
+ public ServiceTypeID(String aType) throws IDCreateException {
+ if (aType == null)
+ throw new IDCreateException(Messages.ServiceTypeID_EXCEPTION_SERVICE_TYPE_ID_NOT_NULL);
+ try {
+ // remove the leading _
+ String type = aType.substring(1);
+
+ String[] split = StringUtils.split(type, "_"); //$NON-NLS-1$
+ // naming authority
+ int offset = split.length - 1;
+ this.namingAuthority = split[offset];
+
+ // protocol and scope
+ String string = split[--offset];
+ String[] protoAndScope = StringUtils.split(string, ".", string.indexOf(".") - 1); //$NON-NLS-1$ //$NON-NLS-2$
+ this.protocols = new String[] {protoAndScope[0]};
+ this.scopes = new String[] {protoAndScope[1]};
+
+ // services are the remaining strings in the array
+ List subList = Arrays.asList(split).subList(0, offset);
+ this.services = (String[]) subList.toArray(new String[0]);
+
+ createType();
+ } catch (Exception e) {
+ throw new IDCreateException(Messages.ServiceTypeID_EXCEPTION_SERVICE_TYPE_ID_NOT_PARSEABLE, e);
+ }
+ Assert.isTrue(aType.equals(typeName));
+ }
+
protected void createType() {
final StringBuffer buf = new StringBuffer();
//services
@@ -61,7 +97,11 @@ public class ServiceTypeID extends BaseID implements IServiceTypeID {
//protocols
for (int i = 0; i < protocols.length; i++) {
buf.append(protocols[i]);
- buf.append(DELIM);
+ if (i != protocols.length - 1) {
+ buf.append(DELIM);
+ } else {
+ buf.append("."); //$NON-NLS-1$
+ }
}
//scope
for (int i = 0; i < scopes.length; i++) {
@@ -75,6 +115,13 @@ public class ServiceTypeID extends BaseID implements IServiceTypeID {
}
/* (non-Javadoc)
+ * @see org.eclipse.ecf.core.identity.BaseID#getName()
+ */
+ public String getName() {
+ return typeName;
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.ecf.core.identity.BaseID#namespaceCompareTo(org.eclipse.ecf.core.identity.BaseID)
*/
protected int namespaceCompareTo(BaseID o) {
@@ -119,8 +166,8 @@ public class ServiceTypeID extends BaseID implements IServiceTypeID {
* @see java.lang.Object#toString()
*/
public String toString() {
- final StringBuffer buf = new StringBuffer("ServiceTypeID[");
- buf.append("typeName=").append(typeName).append("]");
+ final StringBuffer buf = new StringBuffer("ServiceTypeID["); //$NON-NLS-1$
+ buf.append("typeName=").append(typeName).append("]"); //$NON-NLS-1$//$NON-NLS-2$
return buf.toString();
}
@@ -166,6 +213,13 @@ public class ServiceTypeID extends BaseID implements IServiceTypeID {
}
/* (non-Javadoc)
+ * @see org.eclipse.ecf.core.identity.BaseID#hashCode()
+ */
+ public int hashCode() {
+ return getName().hashCode();
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.ecf.discovery.identity.IServiceTypeID#getInternal()
*/
public String getInternal() {
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/service/IDiscoveryService.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/service/IDiscoveryService.java
index 7e3d1e5b8..7f7ba48c2 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/service/IDiscoveryService.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/service/IDiscoveryService.java
@@ -19,5 +19,6 @@ import org.eclipse.ecf.discovery.IDiscoveryContainerAdapter;
* service clients.
*/
public interface IDiscoveryService extends IDiscoveryContainerAdapter {
+ // All methods provided by superclass
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryDebugOption.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryDebugOption.java
new file mode 100644
index 000000000..82398ade0
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryDebugOption.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Versant Corp.
+ * 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:
+ * Markus Kuppe (mkuppe <at> versant <dot> com) - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.internal.discovery;
+
+public class DiscoveryDebugOption {
+ public static final String DEBUG = DiscoveryPlugin.PLUGIN_ID + "/debug"; //$NON-NLS-1$
+
+ public static final String EXCEPTIONS_CATCHING = DEBUG + "/exceptions/catching"; //$NON-NLS-1$
+
+ public static final String EXCEPTIONS_THROWING = DEBUG + "/exceptions/throwing"; //$NON-NLS-1$
+
+ public static final String METHODS_ENTERING = DEBUG + "/methods/entering"; //$NON-NLS-1$
+
+ public static final String METHODS_EXITING = DEBUG + "/methods/exiting"; //$NON-NLS-1$
+
+ public static final String METHODS_TRACING = DEBUG + "/methods/tracing"; //$NON-NLS-1$
+
+}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java
index 72792f80c..27c7d4864 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java
@@ -16,6 +16,9 @@ import org.osgi.framework.BundleContext;
* The main plugin class to be used in the desktop.
*/
public class DiscoveryPlugin implements BundleActivator {
+
+ public static final String PLUGIN_ID = "org.eclipse.ecf.discovery"; //$NON-NLS-1$
+
// The shared instance.
private static DiscoveryPlugin plugin;
@@ -33,6 +36,7 @@ public class DiscoveryPlugin implements BundleActivator {
* @throws Exception
*/
public void start(BundleContext context) throws Exception {
+ // nothing to do
}
/**
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/Messages.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/Messages.java
new file mode 100644
index 000000000..db397ef0a
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/Messages.java
@@ -0,0 +1,31 @@
+/****************************************************************************
+ * Copyright (c) 2007 Composent, Inc. 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:
+ * Composent, Inc. - initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.ecf.internal.discovery;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.discovery.messages"; //$NON-NLS-1$
+ public static String ServiceTypeID_EXCEPTION_SERVICE_TYPE_ID_NOT_NULL;
+ public static String ServiceTypeID_EXCEPTION_SERVICE_TYPE_ID_NOT_PARSEABLE;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ // Nothing to do
+ }
+}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/messages.properties b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/messages.properties
new file mode 100644
index 000000000..3ab8c19b9
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/messages.properties
@@ -0,0 +1,2 @@
+ServiceTypeID_EXCEPTION_SERVICE_TYPE_ID_NOT_NULL=ServiceTypeID cannot be null
+ServiceTypeID_EXCEPTION_SERVICE_TYPE_ID_NOT_PARSEABLE=ServiceTypeID cannot be parsed

Back to the top