diff --git a/bundles/org.eclipse.equinox.io/.classpath b/bundles/org.eclipse.equinox.io/.classpath deleted file mode 100644 index 5329b18fd6..0000000000 --- a/bundles/org.eclipse.equinox.io/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/bundles/org.eclipse.equinox.io/.project b/bundles/org.eclipse.equinox.io/.project deleted file mode 100644 index ef5ae899d1..0000000000 --- a/bundles/org.eclipse.equinox.io/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.equinox.io - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/bundles/org.eclipse.equinox.io/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.equinox.io/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/bundles/org.eclipse.equinox.io/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/bundles/org.eclipse.equinox.io/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.io/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b1c8691de0..0000000000 --- a/bundles/org.eclipse.equinox.io/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,474 +0,0 @@ -eclipse.preferences.version=1 -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=warning -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.unsafeTypeOperation=warning -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_assignment_statements_on_columns=false -org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false -org.eclipse.jdt.core.formatter.align_with_spaces=false -org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=0 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=49 -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_assertion_message=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_bitwise_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 -org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 -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_record_components=16 -org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 -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_shift_operator=0 -org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=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_record_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_type_annotations=0 -org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 -org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 -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_last_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=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_statement_group_in_switch=0 -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_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_record_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.align_tags_descriptions_grouped=true -org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false -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.count_line_length_from_starting_position=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=true -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=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=false -org.eclipse.jdt.core.formatter.comment.indent_tag_description=false -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not 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.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=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_record_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=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert -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_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_after_type_annotation=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_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=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_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not 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_record_components=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=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_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not 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_record_declaration=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_relational_operator=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_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert -org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=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_bitwise_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_record_declaration=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_record_components=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_switch_case_expressions=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_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=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_record_constructor=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_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_record_declaration=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_relational_operator=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_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=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_annotation_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never -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_enum_constant_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false -org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never -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_after_code_block=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.text_block_indentation=0 -org.eclipse.jdt.core.formatter.use_on_off_tags=true -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true -org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator=true -org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true -org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true -org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true -org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true -org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true -org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error -org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/bundles/org.eclipse.equinox.io/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.io/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 894ba5a9dd..0000000000 --- a/bundles/org.eclipse.equinox.io/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile -formatter_settings_version=21 -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/bundles/org.eclipse.equinox.io/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.equinox.io/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index c37bbc48aa..0000000000 --- a/bundles/org.eclipse.equinox.io/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Thu Mar 29 10:30:40 EEST 2007 -eclipse.preferences.version=1 -pluginProject.extensions=false diff --git a/bundles/org.eclipse.equinox.io/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.io/META-INF/MANIFEST.MF deleted file mode 100644 index ec9681fc27..0000000000 --- a/bundles/org.eclipse.equinox.io/META-INF/MANIFEST.MF +++ /dev/null @@ -1,27 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %bundleName -Bundle-SymbolicName: org.eclipse.equinox.io -Bundle-Version: 1.1.400.qualifier -Bundle-Vendor: %bundleVendor -Bundle-Activator: org.eclipse.equinox.internal.io.impl.Activator -Bundle-Description: This bundle contains service for creating connections. -Import-Package: - javax.microedition.io, - org.eclipse.equinox.internal.util.hash;version="1.0.0", - org.eclipse.equinox.internal.util.pool;version="1.0.0", - org.eclipse.equinox.internal.util.ref;version="1.0.0", - org.osgi.framework;version="1.0", - org.osgi.service.io;version="[1.0,1.1)", - org.osgi.service.log;version="1.0.0", - org.osgi.util.tracker;version="1.2" -Export-Package: - javax.microedition.io, - org.osgi.service.io;version="1.0", - org.eclipse.equinox.internal.io; x-internal:=true, - org.eclipse.equinox.internal.io.impl; x-internal:=true, - org.eclipse.equinox.internal.io.util; x-internal:=true -Bundle-RequiredExecutionEnvironment: OSGi/Minimum-1.0 -Provided-Services: class=org.osgi.service.io.ConnectorService -Bundle-Localization: plugin -Automatic-Module-Name: org.eclipse.equinox.io diff --git a/bundles/org.eclipse.equinox.io/OSGI-INF/permissions.perm b/bundles/org.eclipse.equinox.io/OSGI-INF/permissions.perm deleted file mode 100644 index 6cedcddb8d..0000000000 --- a/bundles/org.eclipse.equinox.io/OSGI-INF/permissions.perm +++ /dev/null @@ -1,18 +0,0 @@ -(org.osgi.framework.PackagePermission "javax.microedition.io" "import") -(org.osgi.framework.PackagePermission "org.osgi.service.io" "import") -(org.osgi.framework.PackagePermission "org.osgi.service.log" "import") -(org.osgi.framework.PackagePermission "org.osgi.util.tracker" "import") -(org.osgi.framework.PackagePermission "org.osgi.framework" "import") -(org.osgi.framework.PackagePermission "org.eclipse.equinox.internal.util.hash" "import") -(org.osgi.framework.PackagePermission "org.eclipse.equinox.internal.util.pool" "import") -(org.osgi.framework.PackagePermission "org.eclipse.equinox.internal.util.ref" "import") -(org.osgi.framework.PackagePermission "org.eclipse.equinox.internal.io" "export") -(org.osgi.framework.PackagePermission "org.eclipse.equinox.internal.io.impl" "export") -(org.osgi.framework.PackagePermission "org.eclipse.equinox.internal.io.util" "export") -(org.osgi.framework.PackagePermission "javax.microedition.io" "export") -(org.osgi.framework.BundlePermission "*" "provide") -(org.osgi.framework.BundlePermission "*" "host") -(org.osgi.framework.ServicePermission "org.osgi.service.io.ConnectionFactory" "get") -(org.osgi.framework.ServicePermission "org.osgi.service.io.ConnectorService" "register") -(java.util.PropertyPermission "*" "read") -(java.net.SocketPermission "*" "listen") diff --git a/bundles/org.eclipse.equinox.io/about.html b/bundles/org.eclipse.equinox.io/about.html deleted file mode 100644 index 164f781a8f..0000000000 --- a/bundles/org.eclipse.equinox.io/about.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - -About - - -

About This Content

- -

November 30, 2017

-

License

- -

- 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 2.0 ("EPL"). A copy of the EPL is - available at http://www.eclipse.org/legal/epl-2.0. - For purposes of the EPL, "Program" will mean the Content. -

- -

- 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 http://www.eclipse.org. -

- - - \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.io/build.properties b/bundles/org.eclipse.equinox.io/build.properties deleted file mode 100644 index d0d957875c..0000000000 --- a/bundles/org.eclipse.equinox.io/build.properties +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################### -# Copyright (c) 1997, 2015 by ProSyst Software GmbH -# http://www.prosyst.com -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# ProSyst Software GmbH - initial API and implementation -############################################################################### -source.. = osgi/,\ - src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - OSGI-INF/ -src.includes = about.html diff --git a/bundles/org.eclipse.equinox.io/forceQualifierUpdate.txt b/bundles/org.eclipse.equinox.io/forceQualifierUpdate.txt deleted file mode 100644 index 56f1032a8a..0000000000 --- a/bundles/org.eclipse.equinox.io/forceQualifierUpdate.txt +++ /dev/null @@ -1,2 +0,0 @@ -# To force a version qualifier update add the bug here -Bug 403352 - Update all parent versions to match our build stream diff --git a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/ConnectionFactory.java b/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/ConnectionFactory.java deleted file mode 100644 index 9f6aae71e9..0000000000 --- a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/ConnectionFactory.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2002, 2013). All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.osgi.service.io; - -import java.io.IOException; -import javax.microedition.io.Connection; - -/** - * A Connection Factory service is called by the implementation of the Connector - * Service to create {@code javax.microedition.io.Connection} objects which - * implement the scheme named by {@code IO_SCHEME}. - * - * When a {@code ConnectorService.open} method is called, the implementation of - * the Connector Service will examine the specified name for a scheme. The - * Connector Service will then look for a Connection Factory service which is - * registered with the service property {@code IO_SCHEME} which matches the - * scheme. The {@link #createConnection(String, int, boolean)} method of the - * selected Connection Factory will then be called to create the actual - * {@code Connection} object. - * - * @author $Id$ - */ -public interface ConnectionFactory { - /** - * Service property containing the scheme(s) for which this Connection - * Factory can create {@code Connection} objects. This property is of type - * {@code String[]}. - */ - public static final String IO_SCHEME = "io.scheme"; - - /** - * Create a new {@code Connection} object for the specified URI. - * - * @param name The full URI passed to the {@code ConnectorService.open} - * method - * @param mode The mode parameter passed to the - * {@code ConnectorService.open} method - * @param timeouts The timeouts parameter passed to the - * {@code ConnectorService.open} method - * @return A new {@code javax.microedition.io.Connection} object. - * @throws IOException If a {@code javax.microedition.io.Connection} object - * can not not be created. - */ - public Connection createConnection(String name, int mode, boolean timeouts) throws IOException; -} diff --git a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/ConnectorService.java b/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/ConnectorService.java deleted file mode 100644 index 3965bf616b..0000000000 --- a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/ConnectorService.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2002, 2013). All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.osgi.service.io; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import javax.microedition.io.Connection; -import javax.microedition.io.Connector; - -/** - * The Connector Service should be called to create and open - * {@code javax.microedition.io.Connection} objects. - * - * When an {@code open*} method is called, the implementation of the Connector - * Service will examine the specified name for a scheme. The Connector Service - * will then look for a Connection Factory service which is registered with the - * service property {@code IO_SCHEME} which matches the scheme. The - * {@code createConnection} method of the selected Connection Factory will then - * be called to create the actual {@code Connection} object. - * - *

- * If more than one Connection Factory service is registered for a particular - * scheme, the service with the highest ranking (as specified in its - * {@code service.ranking} property) is called. If there is a tie in ranking, - * the service with the lowest service ID (as specified in its - * {@code service.id} property), that is the service that was registered first, - * is called. This is the same algorithm used by - * {@code BundleContext.getServiceReference}. - * - * @author $Id$ - */ -public interface ConnectorService { - /** - * Read access mode. - * - * @see "javax.microedition.io.Connector.READ" - */ - public static final int READ = Connector.READ; - /** - * Write access mode. - * - * @see "javax.microedition.io.Connector.WRITE" - */ - public static final int WRITE = Connector.WRITE; - /** - * Read/Write access mode. - * - * @see "javax.microedition.io.Connector.READ_WRITE" - */ - public static final int READ_WRITE = Connector.READ_WRITE; - - /** - * Create and open a {@code Connection} object for the specified name. - * - * @param name The URI for the connection. - * @return A new {@code javax.microedition.io.Connection} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.open(String name)" - */ - public Connection open(String name) throws IOException; - - /** - * Create and open a {@code Connection} object for the specified name and - * access mode. - * - * @param name The URI for the connection. - * @param mode The access mode. - * @return A new {@code javax.microedition.io.Connection} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.open(String name, int mode)" - */ - public Connection open(String name, int mode) throws IOException; - - /** - * Create and open a {@code Connection} object for the specified name, - * access mode and timeouts. - * - * @param name The URI for the connection. - * @param mode The access mode. - * @param timeouts A flag to indicate that the caller wants timeout - * exceptions. - * @return A new {@code javax.microedition.io.Connection} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.open(String name, int mode, boolean timeouts)" - */ - public Connection open(String name, int mode, boolean timeouts) throws IOException; - - /** - * Create and open an {@code InputStream} object for the specified name. - * - * @param name The URI for the connection. - * @return An {@code InputStream} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.openInputStream(String name)" - */ - public InputStream openInputStream(String name) throws IOException; - - /** - * Create and open a {@code DataInputStream} object for the specified name. - * - * @param name The URI for the connection. - * @return A {@code DataInputStream} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.openDataInputStream(String name)" - */ - public DataInputStream openDataInputStream(String name) throws IOException; - - /** - * Create and open an {@code OutputStream} object for the specified name. - * - * @param name The URI for the connection. - * @return An {@code OutputStream} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.openOutputStream(String name)" - */ - public OutputStream openOutputStream(String name) throws IOException; - - /** - * Create and open a {@code DataOutputStream} object for the specified name. - * - * @param name The URI for the connection. - * @return A {@code DataOutputStream} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.openDataOutputStream(String name)" - */ - public DataOutputStream openDataOutputStream(String name) throws IOException; -} diff --git a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/package-info.java b/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/package-info.java deleted file mode 100644 index 321a4bd03d..0000000000 --- a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/package-info.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2010, 2012). All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * IO Connector Package Version 1.0. - * - *

- * Bundles wishing to use this package must list the package in the - * Import-Package header of the bundle's manifest. This package has two types of - * users: the consumers that use the API in this package and the providers that - * implement the API in this package. - * - *

- * Example import for consumers using the API in this package: - *

- * {@code Import-Package: org.osgi.service.io; version="[1.0,2.0)", javax.microedition.io} - *

- * Example import for providers implementing the API in this package: - *

- * {@code Import-Package: org.osgi.service.io; version="[1.0,1.1)", javax.microedition.io} - * - * @version 1.0 - * @author $Id$ - */ - -package org.osgi.service.io; - diff --git a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/packageinfo b/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/packageinfo deleted file mode 100644 index 7c8de0324f..0000000000 --- a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/packageinfo +++ /dev/null @@ -1 +0,0 @@ -version 1.0 diff --git a/bundles/org.eclipse.equinox.io/plugin.properties b/bundles/org.eclipse.equinox.io/plugin.properties deleted file mode 100644 index 251be750a4..0000000000 --- a/bundles/org.eclipse.equinox.io/plugin.properties +++ /dev/null @@ -1,17 +0,0 @@ -############################################################################### -# Copyright (c) 1997-2009 by ProSyst Software GmbH -# http://www.prosyst.com -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# ProSyst Software GmbH - initial API and implementation -############################################################################### -#Properties file for org.eclipse.equinox.io -bundleVendor = Eclipse.org - Equinox -bundleName = IO Connector Service \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.io/pom.xml b/bundles/org.eclipse.equinox.io/pom.xml deleted file mode 100644 index d54d3d5f88..0000000000 --- a/bundles/org.eclipse.equinox.io/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - 4.0.0 - - rt.equinox.bundles - org.eclipse.equinox.bundles - 4.24.0-SNAPSHOT - ../../ - - org.eclipse.equinox - org.eclipse.equinox.io - 1.1.400-SNAPSHOT - eclipse-plugin - - - - org.eclipse.tycho - tycho-compiler-plugin - ${tycho.version} - - - -nowarn:[${project.basedir}/osgi] - - - - - - diff --git a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/Connection.java b/bundles/org.eclipse.equinox.io/src/javax/microedition/io/Connection.java deleted file mode 100644 index c159034272..0000000000 --- a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/Connection.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package javax.microedition.io; - -public abstract interface Connection { - - public abstract void close() throws java.io.IOException; - -} diff --git a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/ConnectionNotFoundException.java b/bundles/org.eclipse.equinox.io/src/javax/microedition/io/ConnectionNotFoundException.java deleted file mode 100644 index 702d28fd57..0000000000 --- a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/ConnectionNotFoundException.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package javax.microedition.io; - -public class ConnectionNotFoundException extends java.io.IOException { - - private static final long serialVersionUID = 1L; - - public ConnectionNotFoundException() { - } - - public ConnectionNotFoundException(java.lang.String var0) { - } - -} diff --git a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/Connector.java b/bundles/org.eclipse.equinox.io/src/javax/microedition/io/Connector.java deleted file mode 100644 index f24c4c6b2a..0000000000 --- a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/Connector.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package javax.microedition.io; - -public class Connector { - - private Connector() { - } - - public static javax.microedition.io.Connection open(java.lang.String var0) throws java.io.IOException { - return null; - } - - public static javax.microedition.io.Connection open(java.lang.String var0, int var1) throws java.io.IOException { - return null; - } - - public static javax.microedition.io.Connection open(java.lang.String var0, int var1, boolean var2) throws java.io.IOException { - return null; - } - - public static java.io.DataInputStream openDataInputStream(java.lang.String var0) throws java.io.IOException { - return null; - } - - public static java.io.DataOutputStream openDataOutputStream(java.lang.String var0) throws java.io.IOException { - return null; - } - - public static java.io.InputStream openInputStream(java.lang.String var0) throws java.io.IOException { - return null; - } - - public static java.io.OutputStream openOutputStream(java.lang.String var0) throws java.io.IOException { - return null; - } - - public final static int READ = 1; - - public final static int WRITE = 2; - - public final static int READ_WRITE = 3; - -} diff --git a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/ContentConnection.java b/bundles/org.eclipse.equinox.io/src/javax/microedition/io/ContentConnection.java deleted file mode 100644 index eb57ae2888..0000000000 --- a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/ContentConnection.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package javax.microedition.io; - -public abstract interface ContentConnection extends javax.microedition.io.StreamConnection { - - public abstract java.lang.String getEncoding(); - - public abstract long getLength(); - - public abstract java.lang.String getType(); - -} diff --git a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/Datagram.java b/bundles/org.eclipse.equinox.io/src/javax/microedition/io/Datagram.java deleted file mode 100644 index fd13ffb0ea..0000000000 --- a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/Datagram.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package javax.microedition.io; - -public abstract interface Datagram extends java.io.DataInput, java.io.DataOutput { - - public abstract java.lang.String getAddress(); - - public abstract byte[] getData(); - - public abstract int getLength(); - - public abstract int getOffset(); - - public abstract void reset(); - - public abstract void setAddress(javax.microedition.io.Datagram var0); - - public abstract void setAddress(java.lang.String var0) throws java.io.IOException; - - public abstract void setData(byte[] var0, int var1, int var2); - - public abstract void setLength(int var0); - -} diff --git a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/DatagramConnection.java b/bundles/org.eclipse.equinox.io/src/javax/microedition/io/DatagramConnection.java deleted file mode 100644 index b00556f975..0000000000 --- a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/DatagramConnection.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package javax.microedition.io; - -public abstract interface DatagramConnection extends javax.microedition.io.Connection { - - public abstract int getMaximumLength() throws java.io.IOException; - - public abstract int getNominalLength() throws java.io.IOException; - - public abstract javax.microedition.io.Datagram newDatagram(byte[] var0, int var1) throws java.io.IOException; - - public abstract javax.microedition.io.Datagram newDatagram(byte[] var0, int var1, java.lang.String var2) throws java.io.IOException; - - public abstract javax.microedition.io.Datagram newDatagram(int var0) throws java.io.IOException; - - public abstract javax.microedition.io.Datagram newDatagram(int var0, java.lang.String var1) throws java.io.IOException; - - public abstract void receive(javax.microedition.io.Datagram var0) throws java.io.IOException; - - public abstract void send(javax.microedition.io.Datagram var0) throws java.io.IOException; - -} diff --git a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/HttpConnection.java b/bundles/org.eclipse.equinox.io/src/javax/microedition/io/HttpConnection.java deleted file mode 100644 index 7896d96ea6..0000000000 --- a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/HttpConnection.java +++ /dev/null @@ -1,143 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package javax.microedition.io; - -public abstract interface HttpConnection extends javax.microedition.io.ContentConnection { - - public abstract long getDate() throws java.io.IOException; - - public abstract long getExpiration() throws java.io.IOException; - - public abstract java.lang.String getFile(); - - public abstract java.lang.String getHeaderField(int var0) throws java.io.IOException; - - public abstract java.lang.String getHeaderField(java.lang.String var0) throws java.io.IOException; - - public abstract long getHeaderFieldDate(java.lang.String var0, long var1) throws java.io.IOException; - - public abstract int getHeaderFieldInt(java.lang.String var0, int var1) throws java.io.IOException; - - public abstract java.lang.String getHeaderFieldKey(int var0) throws java.io.IOException; - - public abstract java.lang.String getHost(); - - public abstract long getLastModified() throws java.io.IOException; - - public abstract int getPort(); - - public abstract java.lang.String getProtocol(); - - public abstract java.lang.String getQuery(); - - public abstract java.lang.String getRef(); - - public abstract java.lang.String getRequestMethod(); - - public abstract java.lang.String getRequestProperty(java.lang.String var0); - - public abstract int getResponseCode() throws java.io.IOException; - - public abstract java.lang.String getResponseMessage() throws java.io.IOException; - - public abstract java.lang.String getURL(); - - public abstract void setRequestMethod(java.lang.String var0) throws java.io.IOException; - - public abstract void setRequestProperty(java.lang.String var0, java.lang.String var1) throws java.io.IOException; - - public final static java.lang.String GET = "GET"; - - public final static java.lang.String HEAD = "HEAD"; - - public final static java.lang.String POST = "POST"; - - public final static int HTTP_ACCEPTED = 202; - - public final static int HTTP_BAD_GATEWAY = 502; - - public final static int HTTP_BAD_METHOD = 405; - - public final static int HTTP_BAD_REQUEST = 400; - - public final static int HTTP_CLIENT_TIMEOUT = 408; - - public final static int HTTP_CONFLICT = 409; - - public final static int HTTP_CREATED = 201; - - public final static int HTTP_ENTITY_TOO_LARGE = 413; - - public final static int HTTP_EXPECT_FAILED = 417; - - public final static int HTTP_FORBIDDEN = 403; - - public final static int HTTP_GATEWAY_TIMEOUT = 504; - - public final static int HTTP_GONE = 410; - - public final static int HTTP_INTERNAL_ERROR = 500; - - public final static int HTTP_LENGTH_REQUIRED = 411; - - public final static int HTTP_MOVED_PERM = 301; - - public final static int HTTP_MOVED_TEMP = 302; - - public final static int HTTP_MULT_CHOICE = 300; - - public final static int HTTP_NO_CONTENT = 204; - - public final static int HTTP_NOT_ACCEPTABLE = 406; - - public final static int HTTP_NOT_AUTHORITATIVE = 203; - - public final static int HTTP_NOT_FOUND = 404; - - public final static int HTTP_NOT_IMPLEMENTED = 501; - - public final static int HTTP_NOT_MODIFIED = 304; - - public final static int HTTP_OK = 200; - - public final static int HTTP_PARTIAL = 206; - - public final static int HTTP_PAYMENT_REQUIRED = 402; - - public final static int HTTP_PRECON_FAILED = 412; - - public final static int HTTP_PROXY_AUTH = 407; - - public final static int HTTP_REQ_TOO_LONG = 414; - - public final static int HTTP_RESET = 205; - - public final static int HTTP_SEE_OTHER = 303; - - public final static int HTTP_TEMP_REDIRECT = 307; - - public final static int HTTP_UNAUTHORIZED = 401; - - public final static int HTTP_UNAVAILABLE = 503; - - public final static int HTTP_UNSUPPORTED_RANGE = 416; - - public final static int HTTP_UNSUPPORTED_TYPE = 415; - - public final static int HTTP_USE_PROXY = 305; - - public final static int HTTP_VERSION = 505; - -} diff --git a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/InputConnection.java b/bundles/org.eclipse.equinox.io/src/javax/microedition/io/InputConnection.java deleted file mode 100644 index 4e112cdb87..0000000000 --- a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/InputConnection.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package javax.microedition.io; - -public abstract interface InputConnection extends javax.microedition.io.Connection { - - public abstract java.io.DataInputStream openDataInputStream() throws java.io.IOException; - - public abstract java.io.InputStream openInputStream() throws java.io.IOException; - -} diff --git a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/OutputConnection.java b/bundles/org.eclipse.equinox.io/src/javax/microedition/io/OutputConnection.java deleted file mode 100644 index e9c53c965d..0000000000 --- a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/OutputConnection.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package javax.microedition.io; - -public abstract interface OutputConnection extends javax.microedition.io.Connection { - - public abstract java.io.DataOutputStream openDataOutputStream() throws java.io.IOException; - - public abstract java.io.OutputStream openOutputStream() throws java.io.IOException; - -} diff --git a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/StreamConnection.java b/bundles/org.eclipse.equinox.io/src/javax/microedition/io/StreamConnection.java deleted file mode 100644 index 6e6695c4c4..0000000000 --- a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/StreamConnection.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package javax.microedition.io; - -public abstract interface StreamConnection extends javax.microedition.io.InputConnection, javax.microedition.io.OutputConnection { - -} diff --git a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/StreamConnectionNotifier.java b/bundles/org.eclipse.equinox.io/src/javax/microedition/io/StreamConnectionNotifier.java deleted file mode 100644 index d69e76c309..0000000000 --- a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/StreamConnectionNotifier.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package javax.microedition.io; - -public abstract interface StreamConnectionNotifier extends javax.microedition.io.Connection { - - public abstract javax.microedition.io.StreamConnection acceptAndOpen() throws java.io.IOException; - -} diff --git a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/package.html b/bundles/org.eclipse.equinox.io/src/javax/microedition/io/package.html deleted file mode 100644 index 84f3c6f6b9..0000000000 --- a/bundles/org.eclipse.equinox.io/src/javax/microedition/io/package.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -The classes for the generic connections. - - diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/ConnectionListener.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/ConnectionListener.java deleted file mode 100644 index 3aa99b6f4f..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/ConnectionListener.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io; - -import java.util.EventListener; -import javax.microedition.io.Connection; - -/** - * Interface for a listener that will receive notification when the connection - * is created and when is closed. - *

- * Listener is notified for creation of the connection only when the connector - * service creates connection that implements only this and the Connection - * interface, when the needed IOProvider is not available at the moment of - * creation. When the provider becomes available then all registered listeners - * will receive event - *

- * CONNECTION_CREATED and the created connection. Event - * CONNECTION_CLOSED must be send from every connection that - * implements this interface when it is closing. - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public interface ConnectionListener extends EventListener { - /** - * Constant for event type created - */ - public static final int CONNECTION_CREATED = 0; - /** - * Constant for event type closed - */ - public static final int CONNECTION_CLOSED = 1; - - /** - * Receives notification that a connection has been created or closed. - */ - public void notify(String uri, int eventType, Connection conn); - -} diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/ConnectionNotifier.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/ConnectionNotifier.java deleted file mode 100644 index 8f2f0ae02f..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/ConnectionNotifier.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io; - -/** - * Provides methods for registering listeners for receiving events from a - * connection (that implements this interface). - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public interface ConnectionNotifier { - /** - * Adds the given listener to the set of listeners that will be notified - * when the connection is created or closed. - */ - public void addConnectionListener(ConnectionListener l); - - /** - * Removes the given listener from the set of listeners that will be - * notified when the connection is created or closed. - */ - public void removeConnectionListener(ConnectionListener l); -} diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/RandomAccessConnection.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/RandomAccessConnection.java deleted file mode 100644 index 2477c55d72..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/RandomAccessConnection.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io; - -import java.io.*; -import javax.microedition.io.InputConnection; -import javax.microedition.io.OutputConnection; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public interface RandomAccessConnection extends InputConnection, OutputConnection, DataInput, DataOutput { - - public long length() throws IOException; - - public long getFilePointer() throws IOException; - - public boolean isSelected(); - - public int read() throws IOException; - - public int read(byte[] buff, int off, int len) throws IOException; - - public void seek(long len) throws IOException; - - public void write(int b) throws IOException; - - public void write(byte[] buff, int off, int len) throws IOException; - - public void flush() throws IOException; -} diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/Activator.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/Activator.java deleted file mode 100644 index 00bf119f8e..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/Activator.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io.impl; - -import org.eclipse.equinox.internal.util.ref.Log; -import org.osgi.framework.*; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class Activator implements BundleActivator { - - public static BundleContext bc = null; - private ConnectorServiceImpl connector; - private Log log; - - public void start(BundleContext bc) throws BundleException { - Activator.bc = bc; - log = new Log(bc, false); - log.setDebug(getBoolean("equinox.connector.debug")); - log.setPrintOnConsole(getBoolean("equinox.connector.console")); - if (log.getDebug()) { - log.setMaps(TracerConfigConnector.getMap(), null); - } - connector = new ConnectorServiceImpl(bc, log); - } - - public void stop(BundleContext bc) { - if (connector != null) { - connector.close(); - connector = null; - log.close(); - } - Activator.bc = null; - } - - public static boolean getBoolean(String property) { - String prop = (bc != null) ? bc.getProperty(property) : System.getProperty(property); - return ((prop != null) && prop.equalsIgnoreCase("true")); - } - - public static int getInteger(String property, int defaultValue) { - String prop = (bc != null) ? bc.getProperty(property) : System.getProperty(property); - if (prop != null) { - try { - return Integer.decode(prop).intValue(); - } catch (NumberFormatException e) { - //do nothing - } - } - return defaultValue; - } -} diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectionFactoryListener.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectionFactoryListener.java deleted file mode 100644 index 4d466e4f04..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectionFactoryListener.java +++ /dev/null @@ -1,155 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io.impl; - -import java.io.IOException; -import java.util.*; -import javax.microedition.io.Connection; -import org.eclipse.equinox.internal.io.impl.PrivilegedRunner.PrivilegedDispatcher; -import org.osgi.framework.*; -import org.osgi.service.io.ConnectionFactory; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class ConnectionFactoryListener implements ServiceListener, PrivilegedDispatcher { - private static Hashtable urlToConN = new Hashtable(5); - private BundleContext bc; - - public ConnectionFactoryListener(BundleContext bc) { - this.bc = bc; - - try { - bc.addServiceListener(this, '(' + Constants.OBJECTCLASS + '=' + ConnectionFactory.class.getName() + ')'); - } catch (InvalidSyntaxException ex) { - // Ignored - syntax is right! - } - } - - public void close() { - bc.removeServiceListener(this); - - if (!urlToConN.isEmpty()) { - Vector copyV = new Vector(urlToConN.size()); - - for (Enumeration en = urlToConN.elements(); en.hasMoreElements();) { - copyV.addElement(en.nextElement()); - } - - for (Enumeration en = copyV.elements(); en.hasMoreElements();) { - ConnectionNotifierImpl cn = (ConnectionNotifierImpl) en.nextElement(); - try { - cn.close(); - } catch (IOException ex) { - } - } - } - } - - static void removeConnectionNotifier(String url) { - urlToConN.remove(url); - } - - static int count = 0; - - static Connection getConnectionNotifier(String scheme, String url, int mode, boolean timeouts, String filter, int count) throws IOException { - ConnectionNotifierImpl ret = null; - synchronized (urlToConN) { - if (urlToConN.containsKey(url)) { - return (Connection) urlToConN.get(url); - } - - ret = new ConnectionNotifierImpl(scheme, url, mode, timeouts, filter); - urlToConN.put(url, ret); - if (count == ConnectionFactoryListener.count) - return ret; - } - - Connection c = ConnectorServiceImpl.getConnection(filter, url, mode, timeouts, false); - if (c != null) { - if (ret.hasListeners()) - ret.notifyCreated(c); - else - ret.close(); - } - return c; - } - - public void serviceChanged(ServiceEvent event) { - if (event.getType() == ServiceEvent.REGISTERED && !urlToConN.isEmpty()) { - ServiceReference ref = event.getServiceReference(); - ConnectionFactory factory = (ConnectionFactory) bc.getService(ref); - String[] schemes = (String[]) ref.getProperty(ConnectionFactory.IO_SCHEME); - - Vector toNotify = new Vector(urlToConN.size()); - synchronized (urlToConN) { - for (Enumeration en = urlToConN.elements(); en.hasMoreElements();) { - ConnectionNotifierImpl cn = (ConnectionNotifierImpl) en.nextElement(); - if (match(schemes, cn.scheme)) - toNotify.addElement(cn); - } - } - for (int i = 0; i < toNotify.size(); i++) { - ConnectionNotifierImpl cn = (ConnectionNotifierImpl) toNotify.elementAt(i); - try { - if (cn.context != null) { - PrivilegedRunner.doPrivileged(cn.context, this, 0, cn, factory, null, null); - return; - } - Connection connection = factory.createConnection(cn.url, cn.mode, cn.timeouts); - if (cn.hasListeners()) - cn.notifyCreated(connection); - else - cn.close(); - } catch (Throwable ex) { - ex.printStackTrace(); - } - } - - bc.ungetService(ref); - } - } - - static boolean match(String[] schemes, String scheme) { - if (schemes != null && scheme != null) { - for (int i = 0; i < schemes.length; i++) { - if (scheme.equals(schemes[i])) { - return true; - } - } - } - - return false; - } - - /** - * @see org.eclipse.equinox.internal.io.impl.PrivilegedRunner.PrivilegedDispatcher#dispatchPrivileged(int, - * java.lang.Object, java.lang.Object, java.lang.Object, - * java.lang.Object) - */ - public Object dispatchPrivileged(int type, Object arg1, Object arg2, Object arg3, Object arg4) throws Exception { - ConnectionNotifierImpl cn = (ConnectionNotifierImpl) arg1; - ConnectionFactory factory = (ConnectionFactory) arg2; - Connection connection = factory.createConnection(cn.url, cn.mode, cn.timeouts); - if (cn.hasListeners()) { - cn.notifyCreated(connection); - } else { - cn.close(); - } - return null; - } -} diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectionNotifierImpl.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectionNotifierImpl.java deleted file mode 100644 index 2ecf94ad3d..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectionNotifierImpl.java +++ /dev/null @@ -1,120 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io.impl; - -import java.io.IOException; -import java.util.Enumeration; -import java.util.Vector; -import javax.microedition.io.Connection; -import org.eclipse.equinox.internal.io.ConnectionListener; -import org.eclipse.equinox.internal.io.ConnectionNotifier; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -class ConnectionNotifierImpl implements ConnectionNotifier, Connection { - private Vector list; - String scheme; - int mode; - boolean timeouts; - String url; - String filter; - - boolean notified = false; - Object context; - - ConnectionNotifierImpl(String scheme, String url, int mode, boolean timeouts, String filter) { - list = new Vector(3, 5); - this.scheme = scheme; - this.url = url; - this.mode = mode; - this.timeouts = timeouts; - this.filter = filter; - SecurityManager sm = System.getSecurityManager(); - if (sm != null) - context = System.getSecurityManager().getSecurityContext(); - } - - public void addConnectionListener(ConnectionListener l) { - long timeStart = 0; - if (ConnectorServiceImpl.hasDebug) { - ConnectorServiceImpl.debug(16050, l.getClass().getName(), null); - timeStart = System.currentTimeMillis(); - } - try { - synchronized (list) { - if (!notified) { - if (!list.contains(l)) - list.addElement(l); - return; - } - } - Connection c = ConnectorServiceImpl.getConnection(filter, url, mode, timeouts, false); - if (c != null) - l.notify(url, ConnectionListener.CONNECTION_CREATED, c); - } catch (Exception exc) { - } finally { - if (ConnectorServiceImpl.hasDebug) { - ConnectorServiceImpl.debug(16051, String.valueOf(System.currentTimeMillis() - timeStart), null); - } - } - } - - public void removeConnectionListener(ConnectionListener l) { - if (ConnectorServiceImpl.hasDebug) { - ConnectorServiceImpl.debug(16052, l.getClass().getName(), null); - } - list.removeElement(l); - } - - boolean hasListeners() { - return !list.isEmpty(); - } - - void notifyCreated(Connection conn) { - notify(ConnectionListener.CONNECTION_CREATED, conn); - } - - private void notify(int eventType, Connection conn) { - if (eventType != ConnectionListener.CONNECTION_CREATED && eventType != ConnectionListener.CONNECTION_CLOSED) { - return; - } - - synchronized (list) { - if (notified) - return; - notified = true; - } - ConnectionFactoryListener.removeConnectionNotifier(url); - for (Enumeration en = list.elements(); en.hasMoreElements();) { - ConnectionListener l = (ConnectionListener) en.nextElement(); - l.notify(url, eventType, conn); - } - } - - public void close() throws IOException { - if (ConnectorServiceImpl.hasDebug) { - ConnectorServiceImpl.debug(16053, url, null); - } - synchronized (list) { - if (notified) - return; - notified = true; - } - ConnectionFactoryListener.removeConnectionNotifier(url); - } -} diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectorServiceImpl.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectorServiceImpl.java deleted file mode 100644 index fee1efd578..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectorServiceImpl.java +++ /dev/null @@ -1,404 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io.impl; - -import java.io.*; -import javax.microedition.io.*; -import org.eclipse.equinox.internal.util.ref.Log; -import org.osgi.framework.*; -import org.osgi.service.io.ConnectionFactory; -import org.osgi.service.io.ConnectorService; - -/** - * ConnectorService implementation. - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class ConnectorServiceImpl implements ConnectorService { - static BundleContext bc; - ServiceRegistration reg; - ConnectionFactoryListener listener; - - static boolean enableNotification = Activator.getBoolean("eclipse.io.enable.notification"); - public static boolean hasDebug; - private static Log log; - - public ConnectorServiceImpl(BundleContext bc, Log log) { - ConnectorServiceImpl.log = log; - ConnectorServiceImpl.hasDebug = log.getDebug(); - init(bc); - } - - public static void debug(int id, String message, Throwable t) { - log.debug(0x1200, id, message, t, false); - } - - public ConnectorServiceImpl(BundleContext bc) { - init(bc); - } - - private void init(BundleContext bc) { - ConnectorServiceImpl.bc = bc; - - if (enableNotification) { - listener = new ConnectionFactoryListener(bc); - } - - reg = bc.registerService(ConnectorService.class.getName(), this, null); - } - - public void close() { - reg.unregister(); - - if (listener != null) { - listener.close(); - } - } - - public Connection open(String uri) throws IOException { - return open(uri, READ_WRITE); - } - - public Connection open(String uri, int mode) throws IOException { - return open(uri, mode, false); - } - - static char[] chars = {'~', '='}; - - public Connection open(String uri, int mode, boolean timeouts) throws IOException { - long timeStart = 0; - if (hasDebug) { - debug(16001, uri + ", " + (mode == READ_WRITE ? "READ_WRITE" : (mode == READ) ? "READ" : "WRITE"), null); - timeStart = System.currentTimeMillis(); - } - try { - if (uri == null) { - throw new IllegalArgumentException("URL cannot be NULL!"); - } - - int sPos = uri.indexOf(":"); - - if (sPos < 1) { // scheme must be at least with 1 symbol - throw new IllegalArgumentException("Does not have scheme"); - } - - String scheme = uri.substring(0, sPos); - StringBuffer filter = new StringBuffer(scheme.length() + 13); - filter.append('('); - filter.append(ConnectionFactory.IO_SCHEME); - filter.append(chars); - filter.append(scheme); - filter.append(')'); - - int count = 0; - if (listener != null) - count = ConnectionFactoryListener.count; - Connection c = getConnection(filter.toString(), uri, mode, timeouts, true); - - if (c == null && listener != null) - c = ConnectionFactoryListener.getConnectionNotifier(scheme, uri, mode, timeouts, filter.toString(), count); - if (c == null) - throw new ConnectionNotFoundException("Failed to create connection " + uri); - return c; - } finally { - if (hasDebug) { - debug(16002, String.valueOf(System.currentTimeMillis() - timeStart), null); - } - } - } - - static protected Connection getConnection(String filter, String uri, int mode, boolean timeouts, boolean connector) throws IOException { - ServiceReference[] cfRefs = null; - Connection ret = null; - try { - cfRefs = bc.getServiceReferences(ConnectionFactory.class.getName(), filter); - } catch (InvalidSyntaxException ex) { - } - - if (cfRefs != null) { - sort(cfRefs, 0, cfRefs.length); - } - - IOException ioExc = null; - boolean not_found = false; - if (cfRefs != null) - for (int i = 0; i < cfRefs.length; i++) { - ConnectionFactory prov = (ConnectionFactory) bc.getService(cfRefs[i]); - if (prov != null) - try { - not_found = true; - ret = prov.createConnection(uri, mode, timeouts); - } catch (IOException e) { - if (hasDebug) { - debug(16003, prov.getClass().getName(), e); - } - if (ioExc == null) - ioExc = e; - } finally { - if (ret == null) - bc.ungetService(cfRefs[i]); - else { - if (hasDebug) { - debug(16004, prov.getClass().getName(), null); - } - return ret; - } - } - } - - if (connector) - try { - ret = Connector.open(uri, mode, timeouts); - } catch (ConnectionNotFoundException ignore) { // returns null -> - // ConnectionNotifier - // is created - debug(16014, null, ignore); - } finally { - if (ret == null) { - if (ioExc != null) - throw ioExc; - if (not_found) - throw new ConnectionNotFoundException("Failed to create connection " + uri); - - } else { - if (hasDebug) { - debug(16005, null, null); - } - } - } - return ret; - } - - private static void sort(ServiceReference[] array, int start, int end) { - int middle = (start + end) / 2; - if (start + 1 < middle) - sort(array, start, middle); - if (middle + 1 < end) - sort(array, middle, end); - if (start + 1 >= end) - return; // this case can only happen when this method is called by - // the user - - if (getRanking(array[middle - 1]) == getRanking(array[middle])) { - if (getServiceID(array[middle - 1]) < getServiceID(array[middle])) { - return; - } - } else if (getRanking(array[middle - 1]) >= getRanking(array[middle])) { - return; - } - - if (start + 2 == end) { - ServiceReference temp = array[start]; - array[start] = array[middle]; - array[middle] = temp; - return; - } - int i1 = start, i2 = middle, i3 = 0; - Object[] merge = new Object[end - start]; - while (i1 < middle && i2 < end) { - if (getRanking(array[i1]) == getRanking(array[i2])) { - merge[i3++] = getServiceID(array[i1]) < getServiceID(array[i2]) ? array[i1++] : array[i2++]; - } else { - merge[i3++] = getRanking(array[i1]) >= getRanking(array[i2]) ? array[i1++] : array[i2++]; - } - } - if (i1 < middle) - System.arraycopy(array, i1, merge, i3, middle - i1); - System.arraycopy(merge, 0, array, start, i2 - start); - } - - private static int getRanking(ServiceReference ref) { - Object rank = ref.getProperty(Constants.SERVICE_RANKING); - - if (rank == null || !(rank instanceof Integer)) { - return 0; - } - - return ((Integer) rank).intValue(); - } - - private static long getServiceID(ServiceReference ref) { - Object sid = ref.getProperty(Constants.SERVICE_ID); - - if (sid == null || !(sid instanceof Long)) { - return 0; - } - - return ((Long) sid).intValue(); - } - - /** - * Create and open an DataInputStream object for the specified - * name. - * - * @param name - * the URI for the connection. - * @throws IOException - * if and I/O error occurs - * @throws ConnectionNotFoundException - * if the Connection object can not be made or if no - * handler for the requested scheme can be found. - * @throws IllegalArgumentException - * if the given uri is invalid - * @return A DataInputStream to the given URI - */ - public DataInputStream openDataInputStream(String name) throws IOException { - long timeBegin = 0; - if (hasDebug) { - debug(16006, name, null); - timeBegin = System.currentTimeMillis(); - } - try { - Connection conn = open(name, READ); - - if (!(conn instanceof InputConnection)) { - try { - conn.close(); - } catch (IOException e) { - } - throw new IOException("Connection does not implement InputConnection:" + conn.getClass()); - } - - return ((InputConnection) conn).openDataInputStream(); - } finally { - if (hasDebug) { - debug(16007, String.valueOf(System.currentTimeMillis() - timeBegin), null); - } - } - } - - /** - * Create and open an DataOutputStream object for the specified - * name. - * - * @param name - * the URI for the connection. - * @throws IOException - * if and I/O error occurs - * @throws ConnectionNotFoundException - * if the Connection object can not be made or if no - * handler for the requested scheme can be found. - * @throws IllegalArgumentException - * if the given uri is invalid - * @return A DataOutputStream to the given URI - */ - public DataOutputStream openDataOutputStream(String name) throws IOException { - long timeBegin = 0; - if (hasDebug) { - debug(16008, name, null); - } - try { - Connection conn = open(name, WRITE); - - if (!(conn instanceof OutputConnection)) { - try { - conn.close(); - } catch (IOException e) { - } - - throw new IOException("Connection does not implement OutputConnection:" + conn.getClass()); - } - - return ((OutputConnection) conn).openDataOutputStream(); - } finally { - if (hasDebug) { - debug(16009, String.valueOf(System.currentTimeMillis() - timeBegin), null); - } - } - } - - /** - * Create and open an InputStream object for the specified name. - * - * - * @param name - * the URI for the connection. - * @throws IOException - * if and I/O error occurs - * @throws ConnectionNotFoundException - * if the Connection object can not be made or if no - * handler for the requested scheme can be found. - * @throws IllegalArgumentException - * if the given uri is invalid - * @return A InputStream to the given URI - */ - public InputStream openInputStream(String name) throws IOException { - long timeBegin = 0; - if (hasDebug) { - debug(16010, name, null); - timeBegin = System.currentTimeMillis(); - } - try { - Connection conn = open(name, READ); - - if (!(conn instanceof InputConnection)) { - try { - conn.close(); - } catch (IOException e) { - } - - throw new IOException("Connection does not implement InputConnection:" + conn.getClass()); - } - - return ((InputConnection) conn).openInputStream(); - } finally { - if (hasDebug) { - debug(16011, String.valueOf(System.currentTimeMillis() - timeBegin), null); - } - } - } - - /** - * Create and open an OutputStream object for the specified name. - * - * @param name - * the URI for the connection. - * @throws IOException - * if and I/O error occurs - * @throws ConnectionNotFoundException - * if the Connection object can not be made or if no - * handler for the requested scheme can be found. - * @throws IllegalArgumentException - * if the given uri is invalid - * @return A OutputStream to the given URI - */ - public OutputStream openOutputStream(String name) throws IOException { - long timeBegin = 0; - if (hasDebug) { - debug(16012, name, null); - timeBegin = System.currentTimeMillis(); - } - try { - Connection conn = open(name, WRITE); - - if (!(conn instanceof OutputConnection)) { - try { - conn.close(); - } catch (IOException e) { - } - - throw new IOException("Connection does not implement OutputConnection:" + conn.getClass()); - } - - return ((OutputConnection) conn).openOutputStream(); - } finally { - if (hasDebug) { - debug(16013, String.valueOf(System.currentTimeMillis() - timeBegin), null); - } - } - } -} diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/PrivilegedRunner.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/PrivilegedRunner.java deleted file mode 100644 index 2d5fd7f0c5..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/PrivilegedRunner.java +++ /dev/null @@ -1,197 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io.impl; - -import java.security.*; -import org.eclipse.equinox.internal.util.pool.ObjectCreator; -import org.eclipse.equinox.internal.util.pool.ObjectPool; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public final class PrivilegedRunner implements ObjectCreator { - - private static ObjectPool POOL; - - static { - try { - POOL = new ObjectPool(new PrivilegedRunner(), 5, 10); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /* prevent instantiations */ - private PrivilegedRunner() { - } - - /** - * Same as the longer doPrivileged method, but fills in the first parameter - * only. All other parameters are set to null. - * - * @param dispatcher - * the dispatcher which should be called - * @param type - * the type of the action - used in the dispatcher - * @param arg1 - * a parameter received by the dispatcher - * @see #doPrivileged(PrivilegedDispatcher, int, Object, Object, Object, - * Object) - * @return the object returned from the execution - * @throws Exception - * if the dispatcher fails - */ - public static final Object doPrivileged(PrivilegedDispatcher dispatcher, int type, Object arg1) throws Exception { - return doPrivileged(null, dispatcher, type, arg1, null, null, null); - } - - /** - * Performs a privileged action. The method calls the dispatcher inside the - * privileged call passing it the same parameters that were passed to this - * method. - * - * @param dispatcher - * the dispatcher which should be called - * @param type - * the type of the action - used in the dispatcher - * @param arg1 - * a parameter received by the dispatcher - * @param arg2 - * a parameter received by the dispatcher - * @param arg3 - * a parameter received by the dispatcher - * @param arg4 - * a parameter received by the dispatcher - * @return the object returned from the execution - * @throws Exception - * if the dispatcher fails - */ - public static final Object doPrivileged(PrivilegedDispatcher dispatcher, int type, Object arg1, Object arg2, Object arg3, Object arg4) throws Exception { - return doPrivileged(null, dispatcher, type, arg1, arg2, arg3, arg4); - } - - /** - * Performs a privileged action. The method calls the dispatcher inside the - * privileged call passing it the same parameters that were passed to this - * method. - * - * @param context - * the access context - * @param dispatcher - * the dispatcher which should be called - * @param type - * the type of the action - used in the dispatcher - * @param arg1 - * a parameter received by the dispatcher - * @param arg2 - * a parameter received by the dispatcher - * @param arg3 - * a parameter received by the dispatcher - * @param arg4 - * a parameter received by the dispatcher - * @return the object returned from the execution - * @throws Exception - * if the dispatcher fails - */ - public static final Object doPrivileged(Object context, PrivilegedDispatcher dispatcher, int type, Object arg1, Object arg2, Object arg3, Object arg4) throws Exception { - /* init runner */ - PA runner = (PA) POOL.getObject(); - runner.dispatcher = dispatcher; - runner.type = type; - runner.arg1 = arg1; - runner.arg2 = arg2; - runner.arg3 = arg3; - runner.arg4 = arg4; - - try { - if (System.getSecurityManager() != null) { - /* - * if security manager is set - then privileged execution is - * started - */ - if (context != null) { - return AccessController.doPrivileged(runner, (AccessControlContext) context); - } - return AccessController.doPrivileged(runner); - } - /* if no security manager is set - simply run the action */ - return runner.run(); - } catch (PrivilegedActionException e) { - throw e.getException(); - } finally { - runner.recycle(); - POOL.releaseObject(runner); - } - } - - /** - * @see org.eclipse.equinox.internal.util.pool.ObjectCreator#getInstance() - */ - public Object getInstance() throws Exception { - return new PA(); - } - - /** - * This dispatcher is the handler that is called within the privileged call. - * It should dispatch and perform the requested actions depending on the - * action type and using the given job parameters. - * - * @author Valentin Valchev - * @version $Revision: 1.1 $ - */ - public static interface PrivilegedDispatcher { - - /** - * @param type - * the type of the action - * @param arg1 - * parameter 1 - depends on the action type - * @param arg2 - * parameter 2 - depends on the action type - * @param arg3 - * parameter 3 - depends on the action type - * @param arg4 - * parameter 4 - depends on the action type - * @return an object which should be returned from the - * PrivilegedAction.run() method - * @throws Exception - * on error - */ - Object dispatchPrivileged(int type, Object arg1, Object arg2, Object arg3, Object arg4) throws Exception; - } - - static class PA implements PrivilegedExceptionAction { - - int type; - Object arg1, arg2, arg3, arg4; - PrivilegedDispatcher dispatcher; - - void recycle() { - dispatcher = null; - type = -1; - arg1 = arg2 = arg3 = arg4 = null; - } - - /** - * @see java.security.PrivilegedExceptionAction#run() - */ - public Object run() throws Exception { - return dispatcher.dispatchPrivileged(type, arg1, arg2, arg3, arg4); - } - } - -} diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/TracerConfigConnector.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/TracerConfigConnector.java deleted file mode 100644 index ba43591610..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/TracerConfigConnector.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io.impl; - -import org.eclipse.equinox.internal.util.hash.HashIntObjNS; - -/** - * @author Lubomir Mitev - * @author Pavlin Dobrev - * @version 1.0 - */ -public class TracerConfigConnector { - - public static HashIntObjNS getMap() { - /* - * increase size if you add more dumps in the table - at this moment the - * entries in table are 159 - */ - HashIntObjNS map = new HashIntObjNS(28);// (int)(28 * 0.7) = 19, 18 - constructMap(map); - return map; - } - - public static void constructMap(HashIntObjNS map) { - map.put(-0x1200, "Connector Service"); - map.put(16001, "[BEGIN - open connection] The values of the URI and the access mode are"); - map.put(16002, "[END - open connection] took"); - map.put(16003, "IOException when connection is created from ConnectionFactory"); - map.put(16004, "Connection is created from ConnectionFactory"); - map.put(16005, "Connection is created from javax.microedition.io.Connector"); - map.put(16006, "[BEGIN - open DataInputStream] The URI is"); - map.put(16007, "[END - open DataInputStream] took"); - map.put(16008, "[BEGIN - open DataOutputStream] The URI is"); - map.put(16009, "[END - open DataOutputStream] took"); - map.put(16010, "[BEGIN - open InputStream] The URI is"); - map.put(16011, "[END - open InputStream] took"); - map.put(16012, "[BEGIN - open OutputStream] The URI is"); - map.put(16013, "[END - open OutputStream] took"); - map.put(16014, "ConnectionNotFoundException thrown from system javax.microedition.io.Connector"); - map.put(16050, "[BEGIN - add ConnectionListener] The ConnectionListener is"); - map.put(16051, "[END - add ConnectionListener] took"); - map.put(16052, "Remove ConnectionListener"); - map.put(16053, "Close connection. The URI is"); - } -} diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/package.html b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/package.html deleted file mode 100644 index 32d3d8472c..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/package.html +++ /dev/null @@ -1,10 +0,0 @@ - - -

The OSGi IO Provider Specification Version 1.0. -

Bundles wishing to use this package must list the package -in the Import-Package header of the bundle's manifest. -For example: -

-Import-Package: org.osgi.service.io; specification-version=1.0
-
- diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/AbstractConnectionNotifier.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/AbstractConnectionNotifier.java deleted file mode 100644 index 41ebc558df..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/AbstractConnectionNotifier.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io.util; - -import java.util.*; -import javax.microedition.io.Connection; -import org.eclipse.equinox.internal.io.ConnectionListener; -import org.eclipse.equinox.internal.io.ConnectionNotifier; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public abstract class AbstractConnectionNotifier extends Dictionary implements ConnectionNotifier { - private Vector list; - private Hashtable info; - - // the local address to which the connection is bound - - public final static String LOCAL_ADDRESS = "local_address"; - - // the local port to which the connection is bound. - - public final static String LOCAL_PORT = "local_port"; - - // the remote address to which the connection is connected. - - public final static String ADDRESS = "address"; - - // the remote port to which the connection is connected. - - public final static String PORT = "port"; - - // the encoder used - - public final static String ENCODER = "enc"; - - public static final String SO_TIMEOUT = "timeout"; - - protected AbstractConnectionNotifier() { - list = new Vector(2, 3); - info = new Hashtable(30); - } - - // ConnectionNotifier methods - public void addConnectionListener(ConnectionListener l) { - if (!list.contains(l)) { - list.addElement(l); - } - } - - public void removeConnectionListener(ConnectionListener l) { - list.removeElement(l); - } - - // returns the url of connection - protected abstract String getURL(); - - // the connection to which this ConnectionLife is bound to - protected abstract Connection getConnection(); - - protected void notifyClosed() { - for (Enumeration en = list.elements(); en.hasMoreElements();) { - ConnectionListener l = (ConnectionListener) en.nextElement(); - l.notify(getURL(), ConnectionListener.CONNECTION_CLOSED, getConnection()); - } - } - - protected void setInfo(String key, Object value) { - if (key != null && value != null) { - info.put(key, value); - } - } - - public int size() { - return info.size(); - } - - public boolean isEmpty() { - return info.isEmpty(); - } - - public Enumeration keys() { - return info.keys(); - } - - public Enumeration elements() { - return info.elements(); - } - - public Object get(Object key) { - return info.get(key); - } - - public Object remove(Object key) { - return info.remove(key); - } - -} diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/AbstractDatagram.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/AbstractDatagram.java deleted file mode 100644 index 2eb79bc4a4..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/AbstractDatagram.java +++ /dev/null @@ -1,437 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io.util; - -import java.io.*; -import javax.microedition.io.Datagram; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public abstract class AbstractDatagram implements Datagram { - protected byte[] data; - private int pos; - private int count; - - public AbstractDatagram(int size) { - this(new byte[size]); - } - - public AbstractDatagram(byte[] data) { - this.data = data; - pos = 0; - count = data.length; - } - - public AbstractDatagram(byte[] data, int start, int length) { - if (start > data.length || (start + length) > data.length) { - throw new IllegalArgumentException("Start possition or length is greater than data length"); - } - - this.data = data; - pos = start; - count = length; - } - - public synchronized byte[] getData() { - return data; - } - - public int getLength() { - return count; - } - - public int getOffset() { - return pos; - } - - public void setLength(int len) { - if (len < 0 || len > data.length) { - throw new IllegalArgumentException("Given length is negative or greater than buffer size"); - } - - count = len; - } - - public synchronized void setData(byte[] buffer, int offset, int len) { - if (offset > buffer.length || (offset + len) > buffer.length) { - throw new IllegalArgumentException(); - } - - data = buffer; - pos = offset; - count = len; - } - - public void reset() { - pos = 0; - count = 0; - } - - public int read() { - return (pos < count) ? (data[pos++] & 0xff) : -1; - } - - public void readFully(byte b[]) throws IOException { - readFully(b, 0, b.length); - } - - public void readFully(byte b[], int off, int len) throws IOException { - if (len < 0) { - throw new IndexOutOfBoundsException(); - } - - int n = 0; - - while (n < len) { - int ch = read(); - - if (ch < 0) { - throw new EOFException(); - } - - b[off + (n++)] = (byte) ch; - } - } - - public int skipBytes(int n) throws IOException { - if (pos + n > count) { - n = count - pos; - } - - if (n < 0) { - return 0; - } - - pos += n; - return n; - } - - public boolean readBoolean() throws IOException { - int ch = read(); - - if (ch < 0) { - throw new EOFException(); - } - - return (ch != 0); - } - - public byte readByte() throws IOException { - int ch = read(); - - if (ch < 0) { - throw new EOFException(); - } - - return (byte) (ch); - } - - public int readUnsignedByte() throws IOException { - int ch = read(); - - if (ch < 0) { - throw new EOFException(); - } - - return ch; - } - - public short readShort() throws IOException { - int ch1 = read(); - int ch2 = read(); - - if ((ch1 | ch2) < 0) { - throw new EOFException(); - } - - return (short) ((ch1 << 8) + (ch2 << 0)); - } - - public int readUnsignedShort() throws IOException { - int ch1 = read(); - int ch2 = read(); - - if ((ch1 | ch2) < 0) { - throw new EOFException(); - } - - return (ch1 << 8) + (ch2 << 0); - } - - public char readChar() throws IOException { - int ch1 = read(); - int ch2 = read(); - - if ((ch1 | ch2) < 0) { - throw new EOFException(); - } - - return (char) ((ch1 << 8) + (ch2 << 0)); - } - - public int readInt() throws IOException { - int ch1 = read(); - int ch2 = read(); - int ch3 = read(); - int ch4 = read(); - - if ((ch1 | ch2 | ch3 | ch4) < 0) { - throw new EOFException(); - } - - return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0)); - } - - public long readLong() throws IOException { - return ((long) (readInt()) << 32) + (readInt() & 0xFFFFFFFFL); - } - - public float readFloat() throws IOException { - return Float.intBitsToFloat(readInt()); - } - - public double readDouble() throws IOException { - return Double.longBitsToDouble(readLong()); - } - - public String readLine() throws IOException { - throw new RuntimeException("Function not supported"); - } - - public String readUTF() throws IOException { - return readUTF(this); - } - - public final static String readUTF(DataInput in) throws IOException { - int utflen = in.readUnsignedShort(); - StringBuffer str = new StringBuffer(utflen); - byte bytearr[] = new byte[utflen]; - int c, char2, char3; - int count = 0; - - in.readFully(bytearr, 0, utflen); - - while (count < utflen) { - c = bytearr[count] & 0xff; - - switch (c >> 4) { - case 0 : - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - /* 0xxxxxxx */ - count++; - str.append((char) c); - break; - - case 12 : - case 13 : - /* 110x xxxx 10xx xxxx */ - count += 2; - - if (count > utflen) { - throw new UTFDataFormatException(); - } - - char2 = bytearr[count - 1]; - - if ((char2 & 0xC0) != 0x80) { - throw new UTFDataFormatException(); - } - - str.append((char) (((c & 0x1F) << 6) | (char2 & 0x3F))); - break; - - case 14 : - /* 1110 xxxx 10xx xxxx 10xx xxxx */ - count += 3; - - if (count > utflen) { - throw new UTFDataFormatException(); - } - - char2 = bytearr[count - 2]; - char3 = bytearr[count - 1]; - - if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80)) { - throw new UTFDataFormatException(); - } - - str.append((char) (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0))); - break; - - default : - /* 10xx xxxx, 1111 xxxx */ - throw new UTFDataFormatException(); - } - } - - // The number of chars produced may be less than utflen - return str.toString(); - } - - // -------------------------------------------------------- - public void write(int b) throws IOException { - - if (pos < data.length) { - data[pos++] = (byte) b; - } else { - byte buf[] = new byte[data.length + 1]; - System.arraycopy(data, 0, buf, 0, count); - data = buf; - data[pos++] = (byte) b; - count++; - } - } - - public void write(byte b[]) throws IOException { - write(b, 0, b.length); - } - - public void write(byte b[], int off, int len) throws IOException { - if (b == null) { - throw new NullPointerException(); - } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { - return; - } - - for (int i = 0; i < len; i++) { - write(b[off + i]); - } - } - - public void writeBoolean(boolean v) throws IOException { - write(v ? 1 : 0); - } - - public void writeByte(int v) throws IOException { - write(v); - } - - public void writeShort(int v) throws IOException { - write((v >>> 8) & 0xFF); - write((v >>> 0) & 0xFF); - } - - public void writeChar(int v) throws IOException { - write((v >>> 8) & 0xFF); - write((v >>> 0) & 0xFF); - } - - public void writeInt(int v) throws IOException { - write((v >>> 24) & 0xFF); - write((v >>> 16) & 0xFF); - write((v >>> 8) & 0xFF); - write((v >>> 0) & 0xFF); - } - - public void writeLong(long v) throws IOException { - write((int) (v >>> 56) & 0xFF); - write((int) (v >>> 48) & 0xFF); - write((int) (v >>> 40) & 0xFF); - write((int) (v >>> 32) & 0xFF); - write((int) (v >>> 24) & 0xFF); - write((int) (v >>> 16) & 0xFF); - write((int) (v >>> 8) & 0xFF); - write((int) (v >>> 0) & 0xFF); - } - - public void writeFloat(float v) throws IOException { - writeInt(Float.floatToIntBits(v)); - } - - public void writeDouble(double v) throws IOException { - writeLong(Double.doubleToLongBits(v)); - } - - public void writeBytes(String s) throws IOException { - int len = s.length(); - - for (int i = 0; i < len; i++) { - write((byte) s.charAt(i)); - } - } - - public void writeChars(String s) throws IOException { - int len = s.length(); - - for (int i = 0; i < len; i++) { - int v = s.charAt(i); - write((v >>> 8) & 0xFF); - write((v >>> 0) & 0xFF); - } - } - - public void writeUTF(String str) throws IOException { - writeUTF(str, this); - } - - static int writeUTF(String str, DataOutput out) throws IOException { - int strlen = str.length(); - int utflen = 0; - char[] charr = new char[strlen]; - int c, count = 0; - - str.getChars(0, strlen, charr, 0); - - for (int i = 0; i < strlen; i++) { - c = charr[i]; - - if ((c >= 0x0001) && (c <= 0x007F)) { - utflen++; - } else if (c > 0x07FF) { - utflen += 3; - } else { - utflen += 2; - } - } - - if (utflen > 65535) { - throw new UTFDataFormatException(); - } - - byte[] bytearr = new byte[utflen + 2]; - bytearr[count++] = (byte) ((utflen >>> 8) & 0xFF); - bytearr[count++] = (byte) ((utflen >>> 0) & 0xFF); - - for (int i = 0; i < strlen; i++) { - c = charr[i]; - - if ((c >= 0x0001) && (c <= 0x007F)) { - bytearr[count++] = (byte) c; - } else if (c > 0x07FF) { - bytearr[count++] = (byte) (0xE0 | ((c >> 12) & 0x0F)); - bytearr[count++] = (byte) (0x80 | ((c >> 6) & 0x3F)); - bytearr[count++] = (byte) (0x80 | ((c >> 0) & 0x3F)); - } else { - bytearr[count++] = (byte) (0xC0 | ((c >> 6) & 0x1F)); - bytearr[count++] = (byte) (0x80 | ((c >> 0) & 0x3F)); - } - } - - out.write(bytearr); - return utflen + 2; - } - -} diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/URI.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/URI.java deleted file mode 100644 index b9ecd7cdc0..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/URI.java +++ /dev/null @@ -1,350 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io.util; - -import java.util.Hashtable; -import java.util.Enumeration; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class URI { - - /* - * :///;?# - */ - private String scheme; - private String schemeSpec; - private String auth; - private String userInfo; - private String host; - private String port; - private String path; - private String query; - private String fragment; - private boolean isOpaque; - - private Hashtable params; - - public URI(String uri) { - if (uri == null) { - throw new IllegalArgumentException("URL cannot be NULL!"); - } - - byte[] buf = uri.getBytes(); - int sPos = indexOf(buf, ':', 0); - - scheme = trim(buf, 0, sPos); - - sPos++; - - int ePos = indexOf(buf, '#', sPos); - - if (ePos != -1) { - fragment = trim(buf, ePos + 1, buf.length); - } else { - ePos = buf.length; - } - - schemeSpec = trim(buf, sPos, ePos); - - int pos = indexOf(buf, '?', sPos, ePos); - - if (pos != -1) { - query = trim(buf, pos + 1, ePos); - ePos = pos; - } - - pos = indexOf(buf, ';', sPos, ePos); - - if (pos != -1) { - parseParams(buf, pos + 1, ePos); - ePos = pos; - } - - isOpaque = true; - - if (buf[sPos] == '/' && buf[sPos + 1] == '/') { - sPos += 2; - isOpaque = false; - } - - pos = indexOf(buf, '/', sPos, ePos); - - if (pos != -1) { - path = trim(buf, pos, ePos); - ePos = pos; - } - - auth = trim(buf, sPos, ePos); - - if (!isOpaque) { - pos = indexOf(buf, '@', sPos); - - if (pos != -1) { - userInfo = trim(buf, sPos, pos); - sPos = pos + 1; - } - - pos = indexOf(buf, ']', sPos); - if (pos != -1) { - host = trim(buf, sPos, pos + 1); - sPos = pos + 1; - } - - pos = indexOf(buf, ':', sPos); - - if (pos != -1) { - port = trim(buf, pos + 1, ePos); - ePos = pos; - } - if (host == null) { - host = trim(buf, sPos, ePos); - } - } - } - - public String getScheme() { - return scheme; - } - - public String getHost() { - return host; - } - - public String getPort() { - return port; - } - - public int getPortNumber() { - return port == null ? -1 : Integer.parseInt(port); - } - - public String getFragment() { - return fragment; - } - - public String getQuery() { - return query; - } - - public String getUserInfo() { - return userInfo; - } - - public String getPath() { - return path; - } - - public String getSchemeSpecificPart() { - return schemeSpec; - } - - public String getAuthority() { - return auth; - } - - public boolean isOpaque() { - return isOpaque; - } - - public String get(String param) { - return params == null ? null : (String) params.get(param); - } - - public String getParams() { - if (params == null || params.isEmpty()) { - return null; - } - - StringBuffer sb = new StringBuffer(); - - for (Enumeration en = params.keys(); en.hasMoreElements();) { - String key = (String) en.nextElement(); - sb.append(";"); - sb.append(key); - sb.append("="); - sb.append(((String) params.get(key))); - } - - if (sb.length() == 0) { - return null; - } - - return sb.toString(); - } - - public static String getHost(String uri) { - if (uri == null) { - throw new IllegalArgumentException("URL cannot be NULL!"); - } - - int pos = uri.indexOf("://"); - - if (pos == -1) { - throw new IllegalArgumentException("Does not have scheme"); - } - - int sPos = pos + 3; - - pos = uri.indexOf('@', sPos); - if (pos != -1) { - sPos = pos + 1; - } - - int ePos = endOfHostPort(uri, sPos); - - pos = uri.indexOf(']', sPos); - if (pos != -1) { - return uri.substring(sPos, pos + 1); - } - - pos = uri.indexOf(':', sPos); - - if (sPos != -1 && pos < ePos) { - return uri.substring(sPos, pos); - } - - return uri.substring(sPos, ePos); - } - - public static int getPort(String uri) { - if (uri == null) { - throw new IllegalArgumentException("URL cannot be NULL!"); - } - - int pos = uri.indexOf("://"); - - if (pos == -1) { - throw new IllegalArgumentException("Does not have scheme"); - } - - int sPos = pos + 3; - - pos = uri.indexOf('@', sPos); - if (pos != -1) { - sPos = pos + 1; - } - - pos = uri.indexOf(']', sPos); - if (pos != -1) { - sPos = pos + 1; - } - - sPos = uri.indexOf(":", sPos); - - if (sPos == -1) { - // return -1; - throw new IllegalArgumentException("Port is missing " + uri); - } - - sPos++; - - int ePos = endOfHostPort(uri, sPos); - - return Integer.parseInt(uri.substring(sPos, ePos)); - } - - static int endOfHostPort(String str, int spos) { - int pos = str.indexOf("/", spos); - int tmp = str.indexOf(";", spos); - - if (tmp != -1 && tmp < pos || pos == -1) { - pos = tmp; - } - - if (pos != -1) { - return pos; - } - - return str.length(); - } - - static int indexOf(byte[] ba, char b, int startPos) { - return indexOf(ba, b, startPos, ba.length); - } - - static int indexOf(byte[] ba, char b, int sPos, int ePos) { - if (sPos > ba.length || sPos < 0 || ePos > ba.length || ePos < 0 || sPos >= ePos) { - return -1;// throw new IllegalArgumentException(); - } - - for (int i = sPos; i < ePos; i++) { - if (ba[i] == b) { - return i; - } - } - - return -1; - } - - static String trim(byte[] buf, int s, int e) { - if (s >= e) { - return null; - } - - while (s < buf.length && s < e && buf[s] == ' ') { - s++; - } - - while (e >= 0 && e > s && buf[e - 1] == ' ') { - e--; - } - - if (s == e) { - return null; - } - - return new String(buf, s, e - s); - } - - private void parseParams(byte[] buf, int sPos, int ePos) { - int pos; - - while (sPos < ePos && (pos = indexOf(buf, ';', sPos)) != -1) { - parseParam(buf, sPos, pos); - sPos = pos + 1; - } - - if (sPos < ePos) { - parseParam(buf, sPos, ePos); - } - } - - private void parseParam(byte[] buf, int sPos, int ePos) { - int rpos = indexOf(buf, '=', sPos, ePos); - - if (rpos != -1) { - String key = trim(buf, sPos, rpos); - - if (key == null) { - return; - } - - String str = trim(buf, rpos + 1, ePos); - - if (str != null) { - if (params == null) { - params = new Hashtable(); - } - - params.put(key, str); - } - } - } - -} diff --git a/bundles/org.eclipse.equinox.ip/.classpath b/bundles/org.eclipse.equinox.ip/.classpath deleted file mode 100644 index ce0c7a5d47..0000000000 --- a/bundles/org.eclipse.equinox.ip/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/bundles/org.eclipse.equinox.ip/.project b/bundles/org.eclipse.equinox.ip/.project deleted file mode 100644 index b5b74da368..0000000000 --- a/bundles/org.eclipse.equinox.ip/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.equinox.ip - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/bundles/org.eclipse.equinox.ip/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.equinox.ip/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/bundles/org.eclipse.equinox.ip/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/bundles/org.eclipse.equinox.ip/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.ip/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b1c8691de0..0000000000 --- a/bundles/org.eclipse.equinox.ip/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,474 +0,0 @@ -eclipse.preferences.version=1 -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=warning -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.unsafeTypeOperation=warning -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_assignment_statements_on_columns=false -org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false -org.eclipse.jdt.core.formatter.align_with_spaces=false -org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=0 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=49 -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_assertion_message=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_bitwise_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 -org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 -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_record_components=16 -org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 -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_shift_operator=0 -org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=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_record_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_type_annotations=0 -org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 -org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 -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_last_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=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_statement_group_in_switch=0 -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_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_record_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.align_tags_descriptions_grouped=true -org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false -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.count_line_length_from_starting_position=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=true -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=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=false -org.eclipse.jdt.core.formatter.comment.indent_tag_description=false -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not 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.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=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_record_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=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert -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_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_after_type_annotation=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_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=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_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not 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_record_components=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=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_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not 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_record_declaration=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_relational_operator=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_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert -org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=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_bitwise_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_record_declaration=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_record_components=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_switch_case_expressions=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_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=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_record_constructor=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_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_record_declaration=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_relational_operator=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_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=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_annotation_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never -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_enum_constant_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false -org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never -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_after_code_block=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.text_block_indentation=0 -org.eclipse.jdt.core.formatter.use_on_off_tags=true -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true -org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator=true -org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true -org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true -org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true -org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true -org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true -org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error -org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/bundles/org.eclipse.equinox.ip/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.ip/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 894ba5a9dd..0000000000 --- a/bundles/org.eclipse.equinox.ip/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile -formatter_settings_version=21 -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/bundles/org.eclipse.equinox.ip/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.equinox.ip/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index 6fb22e1086..0000000000 --- a/bundles/org.eclipse.equinox.ip/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Thu Mar 29 10:32:21 EEST 2007 -eclipse.preferences.version=1 -pluginProject.extensions=false diff --git a/bundles/org.eclipse.equinox.ip/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.ip/META-INF/MANIFEST.MF deleted file mode 100644 index 7908c5f39c..0000000000 --- a/bundles/org.eclipse.equinox.ip/META-INF/MANIFEST.MF +++ /dev/null @@ -1,43 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %bundleName -Bundle-SymbolicName: org.eclipse.equinox.ip -Bundle-Version: 1.1.700.qualifier -Bundle-Vendor: %bundleVendor -Bundle-Description: Provides implementation of the Intial Provisioning service - defined by OSGi specification release 4. -Bundle-Activator: org.eclipse.equinox.internal.ip.impl.ProvisioningAgent -DynamicImport-Package: org.osgi.service.permissionadmin; version="1.0" -Import-Package: - javax.servlet;version="2.1", - javax.servlet.http;version="2.1", - org.eclipse.equinox.internal.util.ref;version="1.0", - org.eclipse.equinox.internal.util.timer;version="1.0", - org.osgi.framework;version="1.0", - org.osgi.service.cm;version="1.2.0", - org.osgi.service.http;version="1.0", - org.osgi.service.log;version="1.3.0", - org.osgi.service.provisioning;version="[1.2,1.3)", - org.osgi.service.useradmin;version="1.0", - org.osgi.util.tracker;version="1.3.2" -Export-Package: - org.eclipse.equinox.internal.ip;x-internal:=true, - org.eclipse.equinox.internal.ip.dscagent;x-internal:=true, - org.eclipse.equinox.internal.ip.impl;x-internal:=true, - org.eclipse.equinox.internal.ip.provider;x-internal:=true, - org.eclipse.equinox.internal.ip.provider.env;x-internal:=true, - org.eclipse.equinox.internal.ip.provider.file;x-internal:=true, - org.eclipse.equinox.internal.ip.provider.http;x-internal:=true, - org.eclipse.equinox.internal.ip.storage.cm;x-internal:=true, - org.eclipse.equinox.internal.ip.storage.file;x-internal:=true -Content-Id: equinox.provisioning_agent -Prv-Storage: org.eclipse.equinox.internal.ip.storage.file.FileStorage -PrvInfo-Providers: - org.eclipse.equinox.internal.ip.provider.env.EnvironmentInfoProvider;300, - org.eclipse.equinox.internal.ip.provider.http.HttpProvider;200, - org.eclipse.equinox.internal.ip.provider.file.FileProvider;100 -Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0, - J2SE-1.3 -Bundle-Localization: plugin -Automatic-Module-Name: org.eclipse.equinox.ip - diff --git a/bundles/org.eclipse.equinox.ip/OSGI-INF/permissions.perm b/bundles/org.eclipse.equinox.ip/OSGI-INF/permissions.perm deleted file mode 100644 index 5a965875d0..0000000000 --- a/bundles/org.eclipse.equinox.ip/OSGI-INF/permissions.perm +++ /dev/null @@ -1 +0,0 @@ -(java.security.AllPermission "*" "*") \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.ip/about.html b/bundles/org.eclipse.equinox.ip/about.html deleted file mode 100644 index 164f781a8f..0000000000 --- a/bundles/org.eclipse.equinox.ip/about.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - -About - - -

About This Content

- -

November 30, 2017

-

License

- -

- 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 2.0 ("EPL"). A copy of the EPL is - available at http://www.eclipse.org/legal/epl-2.0. - For purposes of the EPL, "Program" will mean the Content. -

- -

- 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 http://www.eclipse.org. -

- - - \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.ip/build.properties b/bundles/org.eclipse.equinox.ip/build.properties deleted file mode 100644 index 41490f2f19..0000000000 --- a/bundles/org.eclipse.equinox.ip/build.properties +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################### -# Copyright (c) 1997-2009 by ProSyst Software GmbH -# http://www.prosyst.com -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# ProSyst Software GmbH - initial API and implementation -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - OSGI-INF/ -src.includes = about.html diff --git a/bundles/org.eclipse.equinox.ip/forceQualifierUpdate.txt b/bundles/org.eclipse.equinox.ip/forceQualifierUpdate.txt deleted file mode 100644 index 56f1032a8a..0000000000 --- a/bundles/org.eclipse.equinox.ip/forceQualifierUpdate.txt +++ /dev/null @@ -1,2 +0,0 @@ -# To force a version qualifier update add the bug here -Bug 403352 - Update all parent versions to match our build stream diff --git a/bundles/org.eclipse.equinox.ip/plugin.properties b/bundles/org.eclipse.equinox.ip/plugin.properties deleted file mode 100644 index 4c8bcbb829..0000000000 --- a/bundles/org.eclipse.equinox.ip/plugin.properties +++ /dev/null @@ -1,17 +0,0 @@ -############################################################################### -# Copyright (c) 1997-2009 by ProSyst Software GmbH -# http://www.prosyst.com -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# ProSyst Software GmbH - initial API and implementation -############################################################################### -#Properties file for org.eclipse.equinox.ip -bundleVendor = Eclipse.org - Equinox -bundleName = Initial Provisioning \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.ip/pom.xml b/bundles/org.eclipse.equinox.ip/pom.xml deleted file mode 100644 index c2a6a85fa7..0000000000 --- a/bundles/org.eclipse.equinox.ip/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - 4.0.0 - - rt.equinox.bundles - org.eclipse.equinox.bundles - 4.24.0-SNAPSHOT - ../../ - - org.eclipse.equinox - org.eclipse.equinox.ip - 1.1.700-SNAPSHOT - eclipse-plugin - diff --git a/bundles/org.eclipse.equinox.ip/props.txt b/bundles/org.eclipse.equinox.ip/props.txt deleted file mode 100644 index 1dcfbf44c0..0000000000 --- a/bundles/org.eclipse.equinox.ip/props.txt +++ /dev/null @@ -1,16 +0,0 @@ -# File is separated on few text and few binary parts. Each text part starts -# with #[TEXT] while each binary starts with #[BINARY] -# Lines that starts with # (excluding the these that are with #[TEXT] or #[BINARY]) -# are comments. Lines are trimmed so line " key=value " is equal to "key=value" - -# TEXT section contains properties that are to be loaded directly at load phase -# The format of lines is : -# = -#[TEXT] -#provisioning.spid=testgateway -#provisioning.reference=http://localhost:80/prvsetup - -# BINARY section contains properties that are to be loaded indirectly -# The format of lines is : -# = -#[BINARY] \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/ProvisioningInfoProvider.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/ProvisioningInfoProvider.java deleted file mode 100644 index 7437c6749e..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/ProvisioningInfoProvider.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.ip; - -import java.util.Dictionary; - -import org.osgi.service.provisioning.ProvisioningService; - -/** - * Provides a set (can be empty) of configuration properties used by the Initial - * Provisioning Bundle. The properties obtained by the providers become part of - * the Provisioning Dictionary. Arbitrary number of Configuration Loaders could - * be registered as services in the OSGi framework. Different providers could - * export different set of configuration properties. If a property is provided - * by more than one provider, the Provisioning Bundle uses this one, which is - * exported by a provider with the higher service ranking. - * - * @author Avgustin Marinov - * @author Pavlin Dobrev - * @version 1.0 - */ - -public interface ProvisioningInfoProvider { - - /** - * This property specifies URL for connecting to the Management Server. - */ - public static final String MANAGER_URL = "equinox.provisioning.manager.url"; - - /** - * This property specifies the host of the Gateway Manager that Management - * Server management agent bundle must connect to. If this property is not - * present in the dictionary, then Management Server bundle will listen for - * a back end device to push this information to. - */ - public final static String GM_HOST = "equinox.provisioning.gm.host"; - - /** - * This manifest header determines the packed into the provisioning agent - * bundle providers that are to be started. - */ - public final static String PROVIDERS = "PrvInfo-Providers"; - - /** - * Initializes provider. Give to the provider a reference to - * ProvisioningService dictionary. Provider can return properties that are - * to be set properties in the provisioning dictionary. It is not necessary - * for provider to insert explicitly a property unless it has to be listed - * through the Dictionary.keys() method or it evokes action - * (as ProvisioningService.PROVISIONIN_REFERENCE). - * - * @param prvSrv - * provisioning service reference - * @return the initial data. It can be null. - * @throws Exception - * on initialization error - */ - public Dictionary init(ProvisioningService prvSrv) throws Exception; - - /** - * Gets a property with a supplied key from the provider. This method is - * invoked by the Provisioning Agent when - * Dictionary.get(propertyKey) is invoked for a propertyKey - * which is not already stored in the ProvisioningDictionary. The method is - * invoked subsequently on all registered providers ordered by service - * ranking until some of them returns value different from null. - * - * @param propertyKey - * the key. - * @return the property value or null if there is no such - * property. - */ - public Object get(Object propertyKey); -} diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/ProvisioningStorage.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/ProvisioningStorage.java deleted file mode 100644 index 489b0a25bd..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/ProvisioningStorage.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.ip; - -import java.util.Dictionary; - -/** - * Provides persistent storage for the Initial Provisioning Dictionary. This - * service is used by the Provisioning Agent to store the provisioning data. - * - * @author Avgustin Marinov, e-mail: a_marinov@prosyst.bg - * @author Pavlin Dobrev - * @version 1.0 - */ - -public interface ProvisioningStorage { - - /** - * This method is invoked by Provisioning Agent on startup. The storage - * returns the stored data. After that the provisioning service is - * responsible to put the data into the provisioning service dictionary. - * - * @return the stored info - * @throws Exception - * an exception if I/O error occurs - */ - public Dictionary getStoredInfo() throws Exception; - - /** - * This method is invoked by provisioning service on provisioning data - * update. The storage must store the data. - * - * @param provisioningData - * Provisioning Data dictionary. - * @throws Exception - * if the data cannot be stored - */ - public void store(Dictionary provisioningData) throws Exception; -} diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/dscagent/DiscoveryAgent.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/dscagent/DiscoveryAgent.java deleted file mode 100644 index a53a6c7212..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/dscagent/DiscoveryAgent.java +++ /dev/null @@ -1,272 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.ip.dscagent; - -import java.io.IOException; -import java.io.InterruptedIOException; -import java.net.*; -import java.util.Dictionary; -import org.eclipse.equinox.internal.ip.ProvisioningInfoProvider; -import org.eclipse.equinox.internal.ip.impl.Log; -import org.eclipse.equinox.internal.ip.impl.ProvisioningAgent; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.provisioning.ProvisioningService; - -/** - * Agent who make FW available for UDM multicast discovery. It joins - * provisioning agent to a MulticastSocket and waits for ping replies. The - * response contains data that describes gateway. HTTP port is determined using - * next algorithm:
- *
    - *
  1. If "equinox.provisioning.gwhttp.port" property is set it is used - * for HTTP port value.
  2. - *
  3. Else if there has org.osgi.service.HttpService is registered and - * the default such service has registration property "openPort", value of this - * property is assumed as port.
  4. - *
  5. Else HTTP port is assumed to be "80" (the default HTTP port).
  6. - *
- * - * @author Avgustin Marinov - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class DiscoveryAgent implements Runnable { - - /** - * This property can be used when HTTP service is not a prosyst's - * implementation or HTTP is not always, which gives a port with - * registration property "openPort", available. - */ - public static final String HTTP_PORT = "equinox.provisioning.gwhttp.port"; - - /** - * This property can be used when HTTPS service is not a prosyst's - * implementation, HTTPS is old prosyst's https implementation, or http is - * not always, which gives a port with registration property - * "secureOpenPort", or HTTPS is not always available. - */ - public static final String HTTPS_PORT = "equinox.provisioning.gwhttps.port"; - - /** - * Packet Timeout - */ - public static final String TIMEOUT = "equinox.provisioning.packet.timeout"; - - /** - * Separator used in string representing gateway. It separates different - * parts of that string. - */ - public static final char SEPARATOR = '#'; - - /** - * The String that corresponds to lack of sPID. - */ - public static final String NULL = new String(new byte[] {1}); - - /** Reference to provisioning agent. */ - private ProvisioningAgent prvAgent; - - /** If discoverer service is active. */ - private boolean active = true; - - // Net staff - /** The multicast socket. */ - private MulticastSocket mcsocket; - /** The group. */ - private InetAddress group; - - /** - * Bundles context used for determining of HTTP port in ProSyst HTTPS - * Service Implementation. - */ - private BundleContext bc; - - /** - * Constructs instance of Discovery agent. - * - * @param address - * address of multicast host. - * @param port - * port of multicast host. - * @param bc - * bundle context used to be accessed framework. - * @param prvAgent - * the provisioning agent - * @throws UnknownHostException - * when address cannot be resolved - * @throws IOException - * on I/O error, when accessing the given address - */ - public DiscoveryAgent(String address, int port, BundleContext bc, ProvisioningAgent prvAgent) throws UnknownHostException, IOException { - group = InetAddress.getByName(address); - mcsocket = new MulticastSocket(port); - this.bc = bc; - this.prvAgent = prvAgent; - mcsocket.joinGroup(group); - mcsocket.setSoTimeout(ProvisioningAgent.getInteger(TIMEOUT, 10000)); - Log.debug("Discovery Agent has joined to multicast socket " + address + ":" + port + "."); - } - - /** - * Until close() method is invoked this method accepts packages broadcasted - * to multicast host. - */ - public void run() { - byte[] buffer = new byte[256]; - DatagramPacket request = new DatagramPacket(buffer, buffer.length); - Log.debug("Discovery Agent starting listening."); - int errors = 0; - while (active) { - try { - mcsocket.receive(request); - /* It is ping send by the backend discoverer */ - if ("equinox.provisioning.ping".equals(new String(request.getData(), 0, request.getLength()))) { - byte[] data = getResponse(); - if (data != null) { - DatagramPacket response = new DatagramPacket(data, data.length, group, request.getPort()); - /* response.setData(data); */ - mcsocket.send(response); - } - } - request.setLength(buffer.length); /* Restore packet length */ - } catch (InterruptedIOException _) { - } catch (IOException e) { - if (errors++ > 5) { - Log.debug("Seventh unexpected exception. Discoverer will be closed!", e); - return; - } - } - } - } - - /** - * Closes discoverer agent - */ - public void close() { - try { - active = false; - mcsocket.leaveGroup(group); - mcsocket.close(); - } catch (Exception e) { - Log.debug(e); - } - } - - /** - * Encodes some valuable gateways parameters into string. The format is as - * follows:
- * <spid>#<host>#<http port>#<ready>#<others - * info>
- * where:
- *
    - *
  1. sPID is service platform id
  2. - *
  3. host is service platform host
  4. - *
  5. HTTP port is service platform HTTP port
  6. - *
  7. ready is service platform is ready with deploying management - * agent bundle
  8. - *
  9. others info is service platform others info in format: - * {<key0>=<value0>,<key1>=<value1>...}
  10. - *
- * - * @return string representation of gateway data as byte array. - */ - private byte[] getResponse() { - String httpPort = ProvisioningAgent.bc.getProperty(HTTP_PORT); - String httpsPort = ProvisioningAgent.bc.getProperty(HTTPS_PORT); - - // try to determine from service - if (httpPort == null || httpsPort == null) { - // Not using HttpService.class.getName(), because we don't need to - // import - // it. - ServiceReference sref = bc.getServiceReference("org.osgi.service.http.HttpService"); - // HTTP Service is available - explore it - if (httpPort == null) - httpPort = getPortProperty(sref, "openPort"); - if (httpsPort == null) - httpsPort = getPortProperty(sref, "secureOpenPort"); - } - - Dictionary info = prvAgent.getInformation(); - if (info == null) { - return null; - } - - StringBuffer buff = new StringBuffer(); - String spid = (String) info.get(ProvisioningService.PROVISIONING_SPID); - buff.append(spid == null || spid.length() == 0 ? NULL : spid); - buff.append(SEPARATOR); - String host = null; - try { - host = InetAddress.getLocalHost().getHostName(); - } catch (Exception e) { - host = "unknown"; - } - buff.append(host); - buff.append(SEPARATOR); - buff.append(httpPort); - buff.append(SEPARATOR); - buff.append(httpsPort); - buff.append(SEPARATOR); - buff.append(info.get(ProvisioningInfoProvider.MANAGER_URL) != null); - buff.append(SEPARATOR); - buff.append('{'); - buff.append(ProvisioningService.PROVISIONING_REFERENCE); - buff.append('='); - buff.append(info.get(ProvisioningService.PROVISIONING_REFERENCE)); - buff.append(','); - buff.append(ProvisioningService.PROVISIONING_START_BUNDLE); - buff.append('='); - buff.append(info.get(ProvisioningService.PROVISIONING_START_BUNDLE)); - buff.append('}'); - buff.append(SEPARATOR); - buff.append(getFlag()); - Log.debug("Discoverer agent sends gw info : " + buff); - return buff.toString().getBytes(); - } - - public int getFlag() { - int flag = 0; - if (prvAgent.getHttpAllowed()) { - try { - new URL("http://").openConnection(); - flag |= 0x01; - } catch (Exception e) { - } - } - - try { - new URL("rsh://").openConnection(); - flag |= 0x02; - } catch (Exception e) { - } - - try { - new URL("https://").openConnection(); - flag |= 0x04; - } catch (Exception e) { - } - - return flag; - } - - private static final String getPortProperty(ServiceReference ref, String property) { - Object ret = ref != null ? ref.getProperty(property) : null; - return ret == null ? "-1" : "" + ret; - } - -} diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/impl/Log.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/impl/Log.java deleted file mode 100644 index 13277f3cc8..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/impl/Log.java +++ /dev/null @@ -1,173 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.ip.impl; - -import java.io.*; -import java.net.HttpURLConnection; -import java.net.URL; -import java.util.Dictionary; -import org.osgi.service.log.LogService; -import org.osgi.service.provisioning.ProvisioningService; - -/** - * Simple debug class for provisioning agent bundle. - * - * @author Avgustin Marinov - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class Log { - - /** - * Property for workaround the J9 2.0 problem with Content-Length, the - * content length is not set if property is "true" - */ - public static boolean j9workAround; - - /** If debug mode is on. */ - public static boolean debug; - /** If debug mode is on. */ - public static boolean remoteDebug; - /** If to send trace */ - public static boolean sendTrace; - - /** Message that trace is not send */ - public static byte[] NO_TRACE = "NoTrace".getBytes(); - - /** Reference to provisioning service */ - public static ProvisioningService prvSrv; - - /** Log stream to receive logged messages. */ - private static PrintStream logStream; - - /** org.eclipse.equinox.internal.util.ref.Log class to receive logged messages */ - public static org.eclipse.equinox.internal.util.ref.Log log; - - static { - try { - String logFile = ProvisioningAgent.bc.getProperty("equinox.provisioning.provisioning.logfile"); - if (logFile != null && (logFile = logFile.trim()).length() != 0) { - File log = new File(logFile); - log = log.isDirectory() ? new File(log, "log.txt") : log; - logStream = new PrintStream(new FileOutputStream(log), true); - } - } catch (Exception e) { - logStream = null; - } - } - - /** - * Dumps a debug string - * - * @param obj - * a debug string - */ - public static void debug(String obj) { - String message = "[PROVISIONING] " + obj; - if (debug && logStream != null) { - logStream.println(message); - } else if (log != null) { - log.debug(message, null); - } - } - - /** - * Dumps a debug exception - * - * @param e - * a debugged Throwable - */ - public static void debug(Throwable e) { - debug(null, e, remoteDebug); - } - - /** - * Dumps an exception if debug mode is enabled - * - * @param e - * the exception to dump - */ - public static void debug(String message, Throwable e) { - debug(message, e, remoteDebug); - } - - private static void debug(String message, Throwable e, boolean sendRemote) { - if (debug && logStream != null) { - logStream.println("[PROVISIONING] " + message); - e.printStackTrace(logStream); - } else if (log != null) { - log.debug(message, e); - } - if (sendRemote && e != null && (e.getMessage() == null || e.getMessage().indexOf("Error from Backend") == -1)) { - log(message, e); - } - } - - /** - * Logs an exception - * - * @param e - * the exception - */ - private static void log(String message, Throwable e) { - debug("Log exception remotely."); - String logUrl = null; - try { - ProvisioningService prvSrv = Log.prvSrv; - if (prvSrv != null) { - Dictionary info = prvSrv.getInformation(); - if (info != null) { - logUrl = (String) info.get("equinox.provisioning.prv.log"); - if (logUrl != null) { - debug("Log url = " + logUrl); - HttpURLConnection conn = (HttpURLConnection) new URL(logUrl).openConnection(); - conn.setRequestMethod("POST"); - conn.setRequestProperty("Connection", "close"); - conn.setRequestProperty(ProvisioningService.PROVISIONING_SPID, info.get(ProvisioningService.PROVISIONING_SPID) + ""); - conn.setRequestProperty("msg", (message != null ? message + ": " : "") + e.getMessage()); - conn.setRequestProperty("lvl", LogService.LOG_ERROR + ""); - - OutputStream os = new ByteArrayOutputStream(); - if (sendTrace) { - e.printStackTrace(new PrintStream(os)); - } else { - os.write(NO_TRACE); - } - byte[] stackTrace = ((ByteArrayOutputStream) os).toByteArray(); - if (!j9workAround) { - conn.setRequestProperty("Content-Length", stackTrace.length + ""); - } - - conn.setDoOutput(true); - conn.setDoInput(true); - conn.setUseCaches(false); - conn.connect(); - - os = conn.getOutputStream(); - os.write(stackTrace); - os.flush(); - - InputStream is = conn.getInputStream(); - while (is.read() != -1) { - } - } - } - } - } catch (Throwable t) { - debug("Error while logging remotely to url \"" + logUrl + '"', t, false); - } - } -} diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/impl/ProvisioningAgent.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/impl/ProvisioningAgent.java deleted file mode 100644 index ba33733e49..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/impl/ProvisioningAgent.java +++ /dev/null @@ -1,1555 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2009 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.ip.impl; - -import java.io.*; -import java.lang.reflect.*; -import java.net.*; -import java.util.*; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; -import org.eclipse.equinox.internal.ip.ProvisioningInfoProvider; -import org.eclipse.equinox.internal.ip.ProvisioningStorage; -import org.eclipse.equinox.internal.util.timer.Timer; -import org.eclipse.equinox.internal.util.timer.TimerListener; -import org.osgi.framework.*; -import org.osgi.service.provisioning.ProvisioningService; - -/** - * Class implementing provisioning management based on OSGi RFC 27. On start - * this BundleActivator gets its manifest headers - * ProvisioningAgent.providerS and ProvisioningAgent.STORAGE. - * Using them it decides which ProvisioningInfoProvider-s and which - * ProvisioningStorage are packed in the bundle. It make instances them. - * To be succesfull instantiation they MUST have constructor without parameters. - * All packed in bundle providers that implement BundleActivator. Their - * methods start(BundleContext) are invoked after instantiation. (On - * stop their stop(BundleContext)-s are invoked). ProvisioningStorage is - * used for saving provisioning service data. If no such storage thatas are lost - * on restart of bundle. Any fail in provider/storage instantiation, providers - * casting to BundleActivator ends with exception in bundle start and - * bundle will not reach state ACTIVE. - * - * Also it starts DiscoveryAgent which is prosyst's feature. It is constructed - * using values of system properties: "equinox.multicast.host" as host and - * "equinox.multicast.port" as port. If one of these properties is null no - * instance of DiscoveryAgent is made. - * - * @author Avgustin Marinov - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class ProvisioningAgent implements BundleActivator, ProvisioningService, ServiceListener, FrameworkListener, TimerListener { - - /** - * This manifest header determines the packed into the provisioning agent - * bundle storage (if such exists) that is to be setarted. - */ - public final static String STORAGE = "Prv-Storage"; - - /** - * This manifest header determines URL Handlers packed into the provisioning - * agent bundle that are to be started. - */ - public final static String URL_HANDLERS = "Url-Handlers"; - - /** This system property that determines multicast host for discoverer agent. */ - public final static String MULTICAST_HOST = "equinox.provisioning.multicast.host"; - - /** This system property taht determines multicast port for discoverer agent. */ - public final static String MULTICAST_PORT = "equinox.provisioning.multicast.port"; - - /** - * This system property determines if provisioning can use HTTP transport - * (assumed as unsecured) for provisioning data assignments. - */ - public final static String HTTP_ALLOWED = "equinox.provisioning.httpprv.allowed"; - - /** - * This system property determines if provisioning must waits until the - * framework is started. - */ - public final static String WAIT_FW_START = "equinox.provisioning.prv.fwstart"; - - /** - * This system property determines if provisioning should try to make - * provisioning on every start - */ - public final static String REPROVISIONING_ON_START = "equinox.provisioning.reprovision.onstart"; - - /** - * Close Zip after reading. - */ - public final static String CLOSE_ZIP = "equinox.provisioning.close.zip"; - - /** - * This system property determines if provisioning agent should print debug - * and error information on the console. - */ - public final static String DEBUG = "equinox.provisioning.debug"; - - /** - * This system property determines if provisioning agent should print debug - * and error information on the console. - */ - public final static String REMOTE_DEBUG = "equinox.provisioning.remote.debug"; - - /** BundleContext used for interactions with framework. */ - public static BundleContext bc; - - /** Provisioning data. */ - private ProvisioningData info; - /** Registration of ProvisioningService. */ - private ServiceRegistration sreg; - /** - * Configuration store used for data storing. It is null after start if no - * storage packed in bundle. - */ - private ProvisioningStorage storage; - - /** If HTTP protocol is allows for provisioning data assignments. */ - private boolean httpAllowed; - - /** - * If storage is inner packed but it is not inner provider, and is - * BundleActivator and its start method has been invoked, it must be - * stopped. - */ - private boolean destroyStorageOnStop = false; - - /** - * Contains providers packed in bundle. It can be null after start if no - * providers packed in bundle. - */ - private Vector providers; - - /** - * Contains URL handlers packed in bundle. It can be null after start if no - * providers packed in bundle. - */ - private Vector urlHandlers; - - /** - * DiscoveryAgent instantiated by this object on start(BundleContext). It is - * null after start id host or port arenot set in manifest. - */ - private Runnable da; - - /** If there is need to wait for start of framework. */ - private boolean wfs; - /** If the information is added and provistioning assignements are allowed. */ - private boolean active; - /** - * Flag if the start data is processed from frameworkEvent or from - * start(BundleContext) method. - */ - private boolean startProcessed; - /** If to do reprovisiong */ - private boolean reprovision; - /** - * If the service is already registered. Used to be avided duplicated - * registration on start. - */ - private boolean registered; - /** If to close zip after reading */ - private boolean closeZip; - - // =================================================================================// - private static final int PROVISIONING = 1; - - private static final String HAS_FAILED_PROVISIONG = "!@#$_hasFailedPrv"; - - private boolean reAfterPrvFailureDisabled; - private int a; - private int b; - private int changePeriod; - private int maxPeriod; - - private Timer timer; - private long nextProvisioningAfter; - private int times; - // =================================================================================// - - public final static int ERROR_UNKNOWN = 0; - public final static int ERROR_LOAD_STORE_DATA = 1; - public final static int ERROR_MALFORMED_URL = 2; - public final static int ERROR_IO_EXCEPTION = 3; - public final static int ERROR_CORRUPTED_ZIP = 4; - - /** - * Invoked by framework on bundle start. - * - * @param bc - * bundle context - * @exception java.lang.Exception - * mostly when manifest dont match to packed - * providers/storage or their implementation do not match - * expectations. - */ - public void start(BundleContext bc) throws Exception { - ProvisioningAgent.bc = bc; - active = false; - startProcessed = false; - wfs = true; - if (bc.getProperty(WAIT_FW_START) != null) - if (bc.getProperty(WAIT_FW_START).equals("false")) - wfs = false; - httpAllowed = true; - if (bc.getProperty(HTTP_ALLOWED) != null) - if (bc.getProperty(HTTP_ALLOWED).equals("false")) - httpAllowed = false; - reprovision = getBoolean(ProvisioningAgent.REPROVISIONING_ON_START); - closeZip = getBoolean(CLOSE_ZIP); - - // =================================================================================// - reAfterPrvFailureDisabled = getBoolean("equinox.provisioning.provisioning.reAfterPrvFailure.disabled"); - a = getInteger("equinox.provisioning.provisioning.reAfterPrvFailure.a", 60000); - b = getInteger("equinox.provisioning.provisioning.reAfterPrvFailure.b", 60000); - changePeriod = getInteger("equinox.provisioning.provisioning.reAfterPrvFailure.changePeriod", 300000); - maxPeriod = getInteger("equinox.provisioning.provisioning.reAfterPrvFailure.maxperiod", 3600000); - nextProvisioningAfter = a; - // =================================================================================// - Log.j9workAround = getBoolean("equinox.provisioning.j9.2.0.workaround"); - Log.debug = getBoolean(DEBUG); - Log.remoteDebug = getBoolean(REMOTE_DEBUG); - Log.sendTrace = getBoolean("equinox.provisioning.send.trace"); - Log.prvSrv = this; - - org.eclipse.equinox.internal.util.ref.Log log = new org.eclipse.equinox.internal.util.ref.Log(bc); - log.setDebug(true); // always log to LogService! - log.setPrintOnConsole(Log.debug); - Log.log = log; - - try { - start0(bc); - } catch (Exception exc) { - Log.log.close(); - Log.log = null; - throw exc; - } - } - - private void start0(BundleContext bc) throws Exception { - Log.debug("Starting provisioning agent ..."); - - Bundle thisBundle = bc.getBundle(); - - // Starts URL handlers packed into the provisioning bundle - String urlHandlersHeader = (String) thisBundle.getHeaders().get(URL_HANDLERS); - if (urlHandlersHeader != null) { - StringTokenizer strTok = new StringTokenizer(urlHandlersHeader, ", "); - urlHandlers = new Vector(strTok.countTokens()); - while (strTok.hasMoreTokens()) { - try { - BundleActivator handler = (BundleActivator) Class.forName(strTok.nextToken().trim()).newInstance(); - handler.start(bc); - urlHandlers.addElement(handler); - } catch (Exception e) { - Log.debug("Can't instantiate or start a handler!"); - throw e; - } - } - urlHandlersHeader = null; - } - - // Gets inner storage activator class name (if inner storage exists). - String storageName = (String) thisBundle.getHeaders().get(STORAGE); - if (storageName != null) { - storageName = storageName.trim(); - } - - // Registers configuration providers packed into the bundle - String providersHeader = (String) thisBundle.getHeaders().get(ProvisioningInfoProvider.PROVIDERS); - if (providersHeader != null) { - providers = new Vector(5); - StringTokenizer strTok = new StringTokenizer(providersHeader, ",; "); - while (strTok.hasMoreTokens()) { - String providerName = strTok.nextToken().trim(); - strTok.nextToken(); // Skips ranking - Object provider = Class.forName(providerName).newInstance(); - if (provider instanceof BundleActivator) { - ((BundleActivator) provider).start(bc); - } - if (providerName.equals(storageName)) { - storage = (ProvisioningStorage) provider; - destroyStorageOnStop = true; - } - providers.addElement(provider); - } - } - - if (storage == null && storageName != null && storageName.length() != 0) { - try { - storage = (ProvisioningStorage) Class.forName(storageName).newInstance(); - if (storage instanceof BundleActivator) { - ((BundleActivator) storage).start(bc); - destroyStorageOnStop = true; - } - } catch (Exception e) { - Log.debug("Can't instantiate or start storage \"" + storage + "\"!"); - throw e; - } - } - - info = new ProvisioningData(); - - if (storage == null) { - synchronized (this) { - bc.addServiceListener(this, "(|" + '(' + Constants.OBJECTCLASS + '=' + ProvisioningStorage.class.getName() + ")" + '(' + Constants.OBJECTCLASS + '=' + ProvisioningInfoProvider.class.getName() + ")" + '(' + Constants.OBJECTCLASS + '=' + Timer.class.getName() + ')' + ")"); - - storage = getStorage(); - } - } else { - bc.addServiceListener(this, "(|" + '(' + Constants.OBJECTCLASS + '=' + ProvisioningInfoProvider.class.getName() + ')' + '(' + Constants.OBJECTCLASS + '=' + Timer.class.getName() + ')' + ")"); - } - - synchronized (this) { - if (timer == null) { - ServiceReference sRef = bc.getServiceReference(Timer.class.getName()); - if (sRef != null) { - timer = (Timer) bc.getService(sRef); - } - } - } - - if (storage != null) { - Log.debug("Loads from " + storage + " storage."); - try { - Dictionary storedInfo = storage.getStoredInfo(); - if (storedInfo != null && storedInfo.size() != 0) { - info.add(storedInfo); - } - } catch (Exception e) { // NPE or storage specific exception can be - // thrown - Log.debug(e); - setError(ERROR_LOAD_STORE_DATA, e.toString()); - if (destroyStorageOnStop) { - Log.debug("Warning: the storage could be unavailable!"); - } else { - storage = null; - } - } - } - - if (getHasFailedPrv() && !reAfterPrvFailureDisabled) { - reprovision = true; - } - - boolean hasLoadedInfo = false; - - ServiceReference[] srefs = bc.getServiceReferences(ProvisioningInfoProvider.class.getName(), null); - if (srefs != null) { - sort(srefs); - for (int i = 0; i < srefs.length; i++) { - ProvisioningInfoProvider provider = ((ProvisioningInfoProvider) bc.getService(srefs[i])); - try { - synchronized (info) { - if (!info.providers.contains(provider)) { - Log.debug("Loads from " + provider + " provider."); - info.providers.addElement(provider); - Dictionary toAdd = provider.init(this); - if (toAdd != null && toAdd.size() != 0) { - String prvref = (String) toAdd.get(ProvisioningService.PROVISIONING_REFERENCE); - if (prvref != null && prvref.trim().length() != 0) { // reference - // is - // changed - // by - // loader - reprovision = true; - } - info.add(toAdd); - hasLoadedInfo = true; - } - } - } - } catch (Exception e) { - Log.debug(e); - } - } - } - - if (!isFrameworkStarted()) { - bc.addFrameworkListener(this); - } else { - wfs = false; - } - - if (hasLoadedInfo) { - store(); - } - active = true; - processStart(); - - // Join GW to a multicast host. - try { - String host = "225.0.0.0"; - if (bc.getProperty(MULTICAST_HOST) != null) - host = bc.getProperty(MULTICAST_HOST); - String port = Integer.toString(getInteger(MULTICAST_PORT, 7777)); - if (host.length() != 0 && port.length() != 0) { - Class dscAgentClass = Class.forName("org.eclipse.equinox.internal.ip.impl.dscagent.DiscoveryAgent"); - Constructor constr = dscAgentClass.getConstructor(new Class[] {String.class, int.class, BundleContext.class, ProvisioningAgent.class}); - new Thread(da = (Runnable) constr.newInstance(new Object[] {host, new Integer(Integer.parseInt(port)), bc, this}), "Discovery Agent").start(); - } // "info" is already initialized - } catch (Throwable t) { - Log.debug("Can't create discovery agent!"); - } - Log.debug("Provisioning agent started ..."); - } - - /** - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bc) throws Exception { - Log.debug("Stopping provisionig agent ..."); - - if (timer != null) { - try { - timer.removeListener(this, PROVISIONING); - } catch (Throwable _) { - } - timer = null; - } - - registered = false; - - try { - bc.removeServiceListener(this); - } catch (Exception _) { - } - - try { - bc.removeFrameworkListener(this); - } catch (Exception _) { - } - - if (sreg != null) { - try { - sreg.unregister(); - } catch (Exception _) { - } - sreg = null; - } // Unregisters ProvisioningService - - if (da != null) { - try { - Method close = da.getClass().getMethod("close", new Class[] {}); - close.invoke(da, new Object[0]); - } catch (Exception e) { - Log.debug(e); - } - da = null; - } // Closes DiscoveryAgent - - if (storage != null) { - if (destroyStorageOnStop) { - try { - if (storage instanceof BundleActivator) { - ((BundleActivator) storage).stop(bc); - } - } catch (Exception e) { - Log.debug(e); - } - destroyStorageOnStop = false; - } - storage = null; - } // Stores data - - if (providers != null) { - for (int i = providers.size(); i-- > 0;) { - try { - ((BundleActivator) providers.elementAt(i)).stop(bc); - } catch (Exception e) { - Log.debug(e); - } - } - providers = null; - } // Stops providers - - if (urlHandlers != null) { - for (int i = urlHandlers.size(); i-- > 0;) { - try { - ((BundleActivator) urlHandlers.elementAt(i)).stop(bc); - } catch (Exception e) { - Log.debug(e); - } - } - urlHandlers = null; - } // Stops providers - - info = null; - Log.debug("Provisioning agent stopped ..."); - Log.log.close(); - Log.log = null; - } - - public Dictionary getInformation() { - return info; - } - - public void setInformation(Dictionary info) { - boolean refChanged = info.get(ProvisioningService.PROVISIONING_REFERENCE) != null; - synchronized (this.info) { - Integer version = (Integer) this.info.get(ProvisioningService.PROVISIONING_UPDATE_COUNT); - Integer newVersion = new Integer(version.intValue() + 1); - this.info.set(info); - incrementUC(newVersion); - } - modify(); - updated(refChanged); - } - - public void addInformation(Dictionary info) { - addInformation(info, null); - } - - private static final ByteArrayOutputStream baos = new ByteArrayOutputStream(); - private static final byte[] buffer = new byte[1024]; - - private static byte[] readStream(InputStream is) throws IOException { - synchronized (buffer) { - baos.reset(); - int read; - while ((read = is.read(buffer, 0, buffer.length)) != -1) { - baos.write(buffer, 0, read); - } - return baos.toByteArray(); - } - } - - private Bundle installBundle(String name, InputStream is) { - Bundle bundle = null; - try { - bundle = getBundle(name); - if (bundle == null) { /* install the bundle */ - if (Log.debug) - Log.debug("Installing management bundle '" + name + "'"); - bundle = bc.installBundle(name, is); - } else { /* just update it */ - if (Log.debug) - Log.debug("Updating management bundle '" + name + "'"); - bundle.update(is); - } - } catch (Throwable t) { - setHasFailedPrv(true); - Log.debug("WARNING: Failed to install management bundle '" + name + "'", t); - } - return bundle; - } - - public void addInformation(ZipInputStream zis) { - Log.debug("Add Information form ZIS."); - Hashtable entries = new Hashtable(2);//cache for unprocessed entries - boolean manifestFound = false; - Dictionary info = new Hashtable(5); - Dictionary entriesFromHeader = null; - Dictionary extraFileds = null; - Vector bundlesToStart = new Vector(5); - String header = null; - try { - ZipEntry ze; - String name, type; - /* read the rest of the entries */ - while ((ze = zis.getNextEntry()) != null) { - /* read name */ - name = ze.getName(); - if (name.endsWith("/")) {// path entry - zis.closeEntry(); - continue; - - } - if (name.charAt(0) == '/') - name = name.substring(1); - /* read extra */ - byte[] extra = ze.getExtra(); - type = extra == null ? null : new String(extra).toLowerCase(); - if (extra != null && !"META-INF/MANIFEST.MF".equals(name)) { - if (extraFileds == null) { - extraFileds = new Hashtable(3, 3); - } - extraFileds.put(name, type); - } //the extra field is null or the entry is the manifest - if (!manifestFound) { - if ("META-INF/MANIFEST.MF".equals(name)) {//the entry is the manifest - manifestFound = true; - header = getHeaderFromManifest(zis); - entriesFromHeader = filterAttributes(TYPE, parseEntries(header)); - } else {//no manifest yet, so cache the entry - System.out.println("---put : " + name); - entries.put(name, readStream(zis)); - } - } else {//the manifest is found so we process the entry - processEntry(extraFileds, name, null, zis, info, entriesFromHeader, bundlesToStart); - } - zis.closeEntry(); - } - - /*process the cached entries*/ - Enumeration names = entries.keys(); - while (names.hasMoreElements()) { - processEntry(extraFileds, name = (String) names.nextElement(), (byte[]) entries.get(name), null, info, entriesFromHeader, bundlesToStart); - } - } catch (Throwable e) { - this.info.setError(ERROR_CORRUPTED_ZIP, e.toString()); - Log.debug("Error reading provisioning package", e); - setHasFailedPrv(true); - } - - /* close the zip file */ - if (closeZip) { - try { - zis.close(); - } catch (Exception _) { - } - } - - /* update info and start all required bundles */ - addInformation(info, bundlesToStart); // bundle should - } - - private void processEntry(Dictionary extraFileds, String name, byte[] content, InputStream is, Dictionary info, Dictionary entriesFromHeader, Vector bundlesToStart) throws IOException { - /* - * first try the InitialProvisioning-Entries header - * if the zip file had a manifest entry - */ - String type = entriesFromHeader == null ? null : (String) entriesFromHeader.get(name); - /* - * If there is no value in the InitialProvisioning-Entries header for that path - * try to initialize the type from the entry's extra field. - * If this ZIP entry field is present, the Initial Provisioning service should not - * look further, even if the extra field contains an erroneous value. - */ - if (type == null) { - if (extraFileds != null) { - type = (String) extraFileds.get(name); - } - } - /* - * if type is still null try to to initialize it - * according to the extension of the entry's name - */ - if (type == null) { - type = getMIMEfromExtension(name); - } - - /* process entry */ - if (Log.debug) { - Log.debug("Processing entry '" + name + "' of type " + type); - } - if (MIME_BUNDLE.equals(type) || MIME_BUNDLE_ALT.equals(type)) { - installBundle(name, content == null ? new ISWrapper(is) : new ISWrapper(new ByteArrayInputStream(content))); - } else if (MIME_BYTE_ARRAY.equals(type)) { - info.put(name, content == null ? readStream(is) : content); - } else if (MIME_STRING.equals(type)) { - String value = getUTF8String(content == null ? readStream(is) : content); - info.put(name, value); - /* - * FIXME: actually there can be only ONE key of that type! - so why - * using vector - */ - if (PROVISIONING_START_BUNDLE.equals(name)) { - /* Make management agent bundle deployment. Sets java.security.AllPermission - * if PermissionAdmin is available..*/ - try { - grantAllPermissions(value); - } catch (Throwable e) { - Log.debug("Failed to grant all permissions", e); - } - bundlesToStart.addElement(value); - } - } else if (MIME_BUNDLE_URL.equals(type)) { - String value = getUTF8String(content == null ? readStream(is) : content); - installBundle(name, new URL(value).openStream()); - } else { - this.info.setError(ERROR_CORRUPTED_ZIP, // - "Unknown MIME type (" + type + ") for entry '" + name + "'"); - setHasFailedPrv(true); - } - } - - public void serviceChanged(ServiceEvent se) { - Object service = bc.getService(se.getServiceReference()); - if (service instanceof ProvisioningStorage) { - if (se.getType() == ServiceEvent.REGISTERED) { - synchronized (this) { - if (storage == null) { // If there is a storage it won't be - // replaced. - storage = (ProvisioningStorage) service; - } else { - return; - } - } - try { - Object oldUC = info.get(ProvisioningService.PROVISIONING_UPDATE_COUNT); - int iOldUC = 0; - if (oldUC != null && oldUC instanceof Integer) { - iOldUC = ((Integer) oldUC).intValue(); - } - - Dictionary toAdd = storage.getStoredInfo(); - Object newUC = toAdd.get(ProvisioningService.PROVISIONING_UPDATE_COUNT); - int iNewUC = 0; - if (newUC != null && newUC instanceof Integer) { - iNewUC = ((Integer) newUC).intValue(); - } - - boolean refChanged = toAdd.get(ProvisioningService.PROVISIONING_REFERENCE) != null && (iNewUC == 0 || reprovision); - - boolean increment = iNewUC > iOldUC; // In this case it - // is assummed that - // is most probably - // that this - // is the original version but storage is started after the - // provisioning bundle. - - synchronized (info) { - info.set(toAdd); - if (increment) { - incrementUC(new Integer(iNewUC)); - modify(); - } - } - - updated(refChanged); - } catch (Exception e) { - Log.debug(e); - } - Log.debug("Storage is available."); - } else if (se.getType() == ServiceEvent.UNREGISTERING) { - if (storage == bc.getService(se.getServiceReference())) { - Log.debug("Storage is removed!"); - try { - storage.store(info); - } catch (Exception e) { - Log.debug("Can't store provisioning info!", e); - } - storage = null; // No more than one Storage service should - // be registered on the FW - } - } - } - - if (service instanceof ProvisioningInfoProvider) { // a Storage could - // be a Provider - if (se.getType() == ServiceEvent.REGISTERED) { - ProvisioningInfoProvider provider = (ProvisioningInfoProvider) service; - Log.debug("Loads from " + provider + " provider."); - try { - if (!info.providers.contains(provider)) { - Dictionary toAdd = provider.init(this); - boolean refChanged = false; - if (toAdd != null) { - String prvref = (String) toAdd.get(ProvisioningService.PROVISIONING_REFERENCE); - if (prvref != null && prvref.trim().length() != 0) { // reference - // is - // changed - // by - // loader - refChanged = true; - } - } - boolean added = true; - synchronized (info) { - if (!info.providers.contains(provider)) { - info.providers.addElement(provider); - info.add(toAdd); - if (refChanged) { - reprovision = true; - } - Integer version = (Integer) info.get(ProvisioningService.PROVISIONING_UPDATE_COUNT); - Integer newVersion = new Integer(version.intValue() + 1); - incrementUC(newVersion); - } else { - added = false; - } - } - if (added) { - modify(); - updated(refChanged); - } - } - } catch (Exception e) { - Log.debug(e); - } - } else if (se.getType() == ServiceEvent.UNREGISTERING) { - info.providers.removeElement(service); - } - } - - if (service instanceof Timer) { // timer is expected to be single - // service - switch (se.getType()) { - case ServiceEvent.REGISTERED : { - synchronized (this) { - if (timer == null) { - timer = (Timer) service; - if (getHasFailedPrv() && !reAfterPrvFailureDisabled) { - try { - timer.notifyAfterMillis(this, nextPrvAfter(), PROVISIONING); // TO DO - Won't be - // updated with newer - // method - it will not - // run on older FW - } catch (Exception e) { - Log.debug(e); - } - } - } - } - break; - } - case ServiceEvent.UNREGISTERING : { - timer = null; - break; - } - } - } - } - - public synchronized void timer(int event) { - Log.debug("Timer event " + event); - try { - switch (event) { - case PROVISIONING : { - Log.debug("Remake failed provisioning."); - if (getHasFailedPrv()) { - processPrvAssignment(); - } - break; - } - } - } catch (Exception e) { - Log.debug(e); - } - } - - public void frameworkEvent(FrameworkEvent event) { - if (event.getType() == FrameworkEvent.STARTED) { - wfs = false; - processStart(); - } - } - - public boolean getHttpAllowed() { - return httpAllowed; - } - - // Synchronize frameworkEvent and start(BundleContext) initial reactions - private void processStart() { - synchronized (this) { - try { - Log.debug("Reprovision = " + reprovision + ", update counter = " + info.get(ProvisioningService.PROVISIONING_UPDATE_COUNT) + ", provisioning reference = " + info.get(ProvisioningService.PROVISIONING_REFERENCE)); - if ((reprovision || ((Integer) info.get(ProvisioningService.PROVISIONING_UPDATE_COUNT)).intValue() == 0) && info.get(ProvisioningService.PROVISIONING_REFERENCE) != null) { - if (!startProcessed) { - if (processPrvAssignment()) { - startProcessed = true; - } - } - } - } catch (Throwable t) { - Log.debug(t); - } - } - - synchronized (this) { - if (active && !wfs && !registered) { - registered = true; - } else { - return; - } - } - Log.debug("Registering ProvisioningService."); - sreg = bc.registerService(ProvisioningService.class.getName(), this, getRegProps()); - } - - /** - * This is called by ProvisioningData when one puts new - * ProvisioningService.PROVISIONING_UPDATE_COUNT. - * - * @param refChanged - * if ProvisioningService.PROVISIONING_REFERENCE changed - */ - private void updated(boolean refUpdated) { - Log.debug("ProvisioingDictionary updated. Reference updated = " + refUpdated); - - store(); - - synchronized (this) { - if (refUpdated) { - if (!processPrvAssignment()) { - reprovision = true; - } - } - } - } - - private void store() { - if (storage != null) { - try { - Dictionary info = this.info; - if (info != null) { - storage.store(info); - } - } catch (Exception e) { - Log.debug(e); - } - } else { - Log.debug("Warning: No storage available."); - } - } - - private boolean processPrvAssignment() { - if (active && !wfs) { - new Thread() { - public void run() { - try { - process(); - } catch (Exception e) { - Log.debug(e); - } - } - }.start(); - return true; - } - return false; - } - - /** - * Make provisioning data assignement to nextRef. - * - * @param nextRef - * next reference. - */ - synchronized void process() { - if (info == null) - return; // the bundle is stopped - setHasFailedPrv(false); - String ref = (String) info.get(ProvisioningService.PROVISIONING_REFERENCE); - Log.debug("Reference = \"" + ref + '"'); - if (ref != null && (ref = ref.trim()).length() != 0) { - String spid = (String) info.get(ProvisioningService.PROVISIONING_SPID); - Log.debug("Setup from \"" + ref + "\", SPID = " + spid); - - if (!httpAllowed) { - if (ref.startsWith("http://")) { - Log.debug("Won't make setup to " + ref + " because http is forbidden!"); - setError(ERROR_MALFORMED_URL, "Provisioning reference is a HTTP URL, but non-secure HTTP is forbidden!"); - setHasFailedPrv(true); - return; - } - } - - if (!ref.startsWith("file:") && ref.indexOf("service_platform_id") == -1) { - if (ref.indexOf('?') == -1) { - ref += '?'; - } else { - ref += '&'; - } - ref += "service_platform_id" + '=' + URLEncoder.encode(spid == null ? "" : spid); - } - Log.debug("Setup url = \"" + ref); - - URLConnection conn = null; - - try { - URL url = new URL(ref); - InputStream is = null; - - try { - conn = url.openConnection(); - if (conn == null) { - throw new IOException("Can't open connection to " + url + "!"); - } - conn.setRequestProperty("Connection", "close"); - - conn.connect(); - String error = conn.getHeaderField("error"); // Such - // error - // message - // is not by - // specification - // and is - // returned - // by - // Provisioining - // Service - // Backend - if (error == null) { - if ((conn instanceof HttpURLConnection) && ((HttpURLConnection) conn).getResponseCode() != HttpURLConnection.HTTP_OK) { - String errorMsg = "Warning! ResponseCode = " + ((HttpURLConnection) conn).getResponseCode() + "!"; - Log.debug(errorMsg); - setError(ERROR_IO_EXCEPTION, errorMsg); - } else { - is = conn.getInputStream(); - } - } else { - setError(ERROR_IO_EXCEPTION, error); - Log.debug("Error from Backend: " + error + "! Setup failed!"); - } - } catch (IOException e) { - setError(ERROR_IO_EXCEPTION, e.toString()); - Log.debug(e); - } - - if (is == null) { - setHasFailedPrv(true); - } else { - try { - ZipInputStream zis = new ZipInputStream(is); - try { - addInformation(zis); // the addInformation method - // closes stream - Log.debug("Setup ended."); - } finally { - if (!closeZip) { - try { - zis.close(); - } catch (Exception _) { - } - } - } - } catch (Exception e) { - setError(ERROR_CORRUPTED_ZIP, e.toString()); - setHasFailedPrv(true); - Log.debug(e); - } - } - } catch (IOException e) { // new URL ---> MalformedURLException - setError(ERROR_MALFORMED_URL, "Invalid Provisioning Reference: " + ref); - } finally { - if (conn != null && conn instanceof HttpURLConnection) { - try { - ((HttpURLConnection) conn).disconnect(); - } catch (Exception _) { - } - } - } - } - - if (getHasFailedPrv()) { - if (!reAfterPrvFailureDisabled) { - try { - if (timer != null) { - timer.notifyAfterMillis(this, nextPrvAfter(), PROVISIONING); // TO DO - Won't be updated with - // newer method - it will not - // run on older FW - } - } catch (Exception e) { - Log.debug(e); - } - } - } else { - times = 0; - nextProvisioningAfter = a; - } - } - - private synchronized long nextPrvAfter() { - times++; - if (nextProvisioningAfter < maxPeriod && nextProvisioningAfter * times > changePeriod) { - nextProvisioningAfter += b; - times = 0; - } - Log.debug("Next bootstrap after " + nextProvisioningAfter + "ms"); - return nextProvisioningAfter; - } - - // bundlesToStart is null on addInfo from provider/storage, and != null on - // add from ZIS - // pending error must be cleared only in second case! - private void addInformation(Dictionary info, Vector bundlesToStart) { - boolean refChanged = info.get(ProvisioningService.PROVISIONING_REFERENCE) != null; - synchronized (this.info) { - this.info.add(info); - Integer version = (Integer) this.info.get(ProvisioningService.PROVISIONING_UPDATE_COUNT); - Integer newVersion = new Integer(version.intValue() + 1); - incrementUC(newVersion); - } - - Log.debug("Bundles to start: " + bundlesToStart); - if (bundlesToStart != null) { - for (int i = 0; i < bundlesToStart.size(); i++) { - Object next = bundlesToStart.elementAt(i); - try { - if (next instanceof Bundle) { - ((Bundle) next).start(); - } else { - Bundle b = getBundle((String) next); - if (b != null) { - b.start(); - } else { - Log.debug("Can't find '" + next + "' bundle to start it!"); - } - } - } catch (Exception e) { - Log.debug("Exception while starting " + (next instanceof Bundle ? ((Bundle) next).getLocation() : next), e); - setHasFailedPrv(true); - return; - } - } - - clearError(); - } - - modify(); - updated(refChanged); - } - - private boolean isFrameworkStarted() { - if (!wfs) - return true; - Bundle system = bc.getBundle(0); - return system != null ? system.getState() == Bundle.ACTIVE : true; - } - - /** - * Make management agent bundle deployment. Sets java.security.AllPermission - * if PermissionAdmin is available.. - * - * @param maRef - * management agent reference. - */ - private void grantAllPermissions(String location) { - try { - ServiceReference sref = bc.getServiceReference("org.osgi.service.permissionadmin.PermissionAdmin"); // the - // org.osgi.service.permissionadmin is not imported for R1 - if (sref != null) { - Method method = Class.forName("org.osgi.service.permissionadmin.PermissionAdmin").getMethod("setPermissions", new Class[] {String.class, Class.forName("[Lorg.osgi.service.permissionadmin.PermissionInfo;")}); - Object[] allPerms = (Object[]) Array.newInstance(Class.forName("org.osgi.service.permissionadmin.PermissionInfo"), 1); - Constructor constr = Class.forName("org.osgi.service.permissionadmin.PermissionInfo").getConstructor(new Class[] {String.class, String.class, String.class}); - allPerms[0] = constr.newInstance(new String[] {"java.security.AllPermission", "", ""}); - method.invoke(bc.getService(sref), new Object[] {location, allPerms}); - } - } catch (Exception e) { - Log.debug(e); - } - } - - private ProvisioningStorage getStorage() { - ServiceReference sref = bc.getServiceReference(ProvisioningStorage.class.getName()); - return sref != null ? (ProvisioningStorage) bc.getService(sref) : null; - } - - private Bundle getBundle(String location) { - Bundle[] bundles = bc.getBundles(); - for (int i = bundles.length; i-- > 0;) { - if (location.equalsIgnoreCase(bundles[i].getLocation())) { - return bundles[i]; - } - } - return null; - } - - private void incrementUC(Integer uc) { - if (!active) { - return; - } - info.putUC(uc); - } - - private void modify() { - if (!active || sreg == null) { - return; - } - try { - sreg.setProperties(getRegProps()); - } catch (Exception e) { - } - } - - private Dictionary getRegProps() { - Hashtable prvsprops = new Hashtable(1, 1.0F); - prvsprops.put("Vendor", "ProSyst"); - prvsprops.put(ProvisioningService.PROVISIONING_UPDATE_COUNT, info.get(ProvisioningService.PROVISIONING_UPDATE_COUNT)); - return prvsprops; - } - - private void sort(ServiceReference[] srefs) { - for (int i = srefs.length - 1; i > 0; i--) { - for (int j = 0; j < i; j++) { - if (less(srefs[j + 1], srefs[j])) { - ServiceReference temp = srefs[j]; - srefs[j] = srefs[j + 1]; - srefs[j + 1] = temp; - } - } - } - } - - private boolean less(ServiceReference sref1, ServiceReference sref2) { - return getRanking(sref1) < getRanking(sref2); - } - - private int getRanking(ServiceReference sref) { - Integer ranking = (Integer) sref.getProperty(Constants.SERVICE_RANKING); - return ranking == null ? 0 : ranking.intValue(); - } - - private String getUTF8String(byte[] body) { - try { - return new String(body, "UTF-8"); - } catch (Exception _0) { - try { - return new String(body, "UTF8"); // for personal java - // problems - } catch (Exception _1) { - return new String(body); - } - } - } - - private void setError(int code, String message) { - ProvisioningData data = this.info; - if (data == null) { - return; - } - - data.setError(code, message); - - Integer version = (Integer) data.get(ProvisioningService.PROVISIONING_UPDATE_COUNT); - Integer newVersion = new Integer(version.intValue() + 1); - info.putUC(newVersion); - - modify(); - } - - private void clearError() { - ProvisioningData data = this.info; - if (data == null) { - return; - } - - data.clearError(); - } - - private boolean getHasFailedPrv() { - return "true".equals(info.get(HAS_FAILED_PROVISIONG)); - } - - private void setHasFailedPrv(boolean hasFailedPrv) { - if (getHasFailedPrv() != hasFailedPrv) { - info.putPrivate(HAS_FAILED_PROVISIONG, hasFailedPrv ? "true" : null); - store(); - } - } - - /** - * Parses the InitialProvisioning-Entries manifest header. - * @param header the contents of the InitialProvisioning-Entries manifest header, if any - * @return Dictionary which maps entry paths to Dictionary representing the attributes - * or null, if no header is found. - */ - private static Dictionary parseEntries(String header) { - Dictionary entries = null; - Dictionary attributes = null; - header = removeWhiteSpaces(header); - if (header == null || header.length() == 0) - return null; - int begin = 0, end = 1, length = header.length(); - boolean quoted = false; - String path, attribute, value; - - entry: while (end != -1 && begin < length - 1) { - end = readToken(header, begin, false, false); //read the path - if (end == -1) - break; //end of header, or only path - - switch (header.charAt(end)) { - case ';' ://end of path , read attribute - if (begin == end) { - end = readToken(header, end + 1, false, true); - begin = end + 1; - continue; - } - path = header.substring(begin, end); - begin = end + 1; - //read the attributes - while (end != -1 && begin < length - 1) { - end = readToken(header, begin, quoted, false); - if (end == -1) - break entry; - if (header.charAt(end) != '=' || begin == end) { - //invalid syntax - end = readToken(header, begin, false, true); //read the attribute name - begin = end + 1; - continue entry; - } - attribute = header.substring(begin, end); - if (header.charAt(begin) == '\"') { - quoted = true; - begin = end + 2; - } else - begin = end + 1; - - if (begin >= length - 1) - break entry; - - end = readToken(header, begin, quoted, false); //read the attribute value - if (end == -1) { - if (quoted) { - //invalid syntax - end = readToken(header, begin, false, true); - begin = end + 1; - continue entry; - } - //end of header or last attribute-value - value = header.substring(begin, length); - if (attributes == null) - attributes = new Hashtable(2, 3); - attributes.put(attribute, value); - begin = end + 1; - break; - } - switch (header.charAt(end)) { - case ',' : //end of parameters list - value = header.substring(begin, end); - if (attributes == null) - attributes = new Hashtable(2, 3); - attributes.put(attribute, value); - if (entries == null) - entries = new Hashtable(3, 3); - entries.put(path, attributes); - attributes = null; - continue entry; - case ';' : //another parameter - value = header.substring(begin, end); - if (attributes == null) - attributes = new Hashtable(2, 3); - attributes.put(attribute, value); - begin = end + 1; - continue; - case '\"' : //endof quoted part - quoted = false; - value = header.substring(begin, end - 1); - if (attributes == null) - attributes = new Hashtable(2, 3); - attributes.put(attribute, value); - begin = end + 1; - continue; - default : //invalid syntax - end = readToken(header, begin, false, true); - begin = end + 1; - continue entry; - } - } - break; - case ',' : //no description - if (begin == end) - begin = end + 2; - else - begin = end + 1; - continue; - default :// invalid syntax - end = readToken(header, end + 1, false, true); - begin = end + 1; - continue; - } - - if (attributes != null) { - if (entries == null) - entries = new Hashtable(3, 3); - entries.put(path, attributes); - attributes = null; - } - } - return entries; - } - - /** - * Reads the next token from the manifest header. - * @param token the valiue of the manifest header. - * @param begin index of the char from which to start - * @param quoted if the consequent part of teh string is guoted - * @param skipInvalidPath if true all chars till the first comma are skipped - * @return the index of the first character from the string which is - * different from the expected, or -1 if not found - */ - private static int readToken(String token, int begin, boolean quoted, boolean skipInvalidPath) { - char c = 0; - int len = token.length(); - if (begin >= len) - return -1; - if (quoted) { - while ((c = token.charAt(begin)) != '\"') { - if (++begin == len) - return -1; - } - return begin; - } - if (skipInvalidPath) { - while ((c = token.charAt(begin)) != ',') { - if (++begin == len) - return -1; - } - return begin; - } - while ((c = token.charAt(begin)) >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c == '_' || c == '-' || c == '/' || c == '.' || c == ':') { - if (++begin == len) - return -1; - } - return begin; - } - - static final String TYPE = "type"; - - /** - * Filters the Dictionary returned from {@link #parseEntries(String)}. - * Returns Dictionary which maps entry paths to values of the attribute, - * which name is given as argument. - */ - private static Dictionary filterAttributes(String attribute, Dictionary entries) { - if (entries == null) - return null; - Dictionary filtered = null; - Enumeration paths = entries.keys(); - Dictionary attributes = null; - String path = null, type = null, mime = null; - while (paths.hasMoreElements()) { - path = (String) paths.nextElement(); - attributes = (Dictionary) entries.get(path); - if ((type = (String) attributes.get(attribute)) != null && (mime = typeToMIME(type)) != null) { - if (filtered == null) - filtered = new Hashtable(3, 3); - filtered.put(path, mime); - } - } - return filtered; - } - - /** - * Maps type to an appropriate mime type constant - * @param type the value of the type attribute from the InitialProvisioning-Entries header - * @return the mime type for the string type or null if type is not a valid type - */ - private static String typeToMIME(String type) { - if ("text".equals(type)) - return ProvisioningService.MIME_STRING; - if ("binary".equals(type)) - return ProvisioningService.MIME_BYTE_ARRAY; - if ("bundle".equals(type)) - return ProvisioningService.MIME_BUNDLE; - if ("bundle-url".equals(type)) - return ProvisioningService.MIME_BUNDLE_URL; - return null; - } - - /** - * @param filename the name of the zip entry - * @return the MIME type of the entry according to its extension - * or null if the mime type cannot be defined - */ - static String getMIMEfromExtension(String filename) { - int index = filename.lastIndexOf("."); - //no extension -> we cannot identify the type - if (index == -1) - return null; - String extension = filename.substring(index + 1); - if (extension.equals("jar")) - return ProvisioningService.MIME_BUNDLE; - if (extension.equals("txt")) - return ProvisioningService.MIME_STRING; - if (extension.equals("url")) - return ProvisioningService.MIME_BUNDLE_URL; - return ProvisioningService.MIME_BYTE_ARRAY; - } - - /** - * @param is the InputStream containing the information in the manifest - * @return the contents of the InitialProvisioning-Entries header if any or null otherwise - */ - private static String getHeaderFromManifest(InputStream is) { - boolean blank = false; - StringBuffer header = new StringBuffer(); - BufferedReader br = new BufferedReader(new InputStreamReader(is)); - String line = null; - boolean loop = true; - try { - while ((line = br.readLine()) != null && loop) { - if (line.length() == 0) { - if (blank) { - break; - } - blank = true; - continue; - } else { - blank = false; - } - if (line.startsWith(ProvisioningService.INITIALPROVISIONING_ENTRIES)) { - header.append(removeWhiteSpaces(line.substring(ProvisioningService.INITIALPROVISIONING_ENTRIES.length() + 1))); - line = br.readLine();//next line - if (line == null) - return null; - while (loop = (line.length() != 0 && Character.isWhitespace(line.charAt(0)))) { - header.append(removeWhiteSpaces(line)); - line = br.readLine(); - } - } - } - } catch (IOException ioe) { - return null; - } - return (header.length() == 0 ? null : header.toString()); - } - - private static String removeWhiteSpaces(String s) { - if (s == null) - return null; - char curr; - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < s.length(); i++) { - if (!Character.isWhitespace(curr = s.charAt(i))) { - sb.append(curr); - } - } - return sb.toString(); - } - - private static class ISWrapper extends InputStream { - - private InputStream is; - - ISWrapper(InputStream is) { - this.is = is; - } - - public int read() throws IOException { - return is.read(); - } - - public int read(byte[] src, int off, int len) throws IOException { - return is.read(src, off, len); - } - - public void close() { - } - } - - public static boolean getBoolean(String property) { - String prop = (bc != null) ? bc.getProperty(property) : System.getProperty(property); - return ((prop != null) && prop.equalsIgnoreCase("true")); - } - - public static int getInteger(String property, int defaultValue) { - String prop = (bc != null) ? bc.getProperty(property) : System.getProperty(property); - if (prop != null) { - try { - return Integer.decode(prop).intValue(); - } catch (NumberFormatException e) { - //do nothing - } - } - return defaultValue; - } -} diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/impl/ProvisioningData.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/impl/ProvisioningData.java deleted file mode 100644 index bfe05ceed7..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/impl/ProvisioningData.java +++ /dev/null @@ -1,155 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.ip.impl; - -import java.util.*; -import org.eclipse.equinox.internal.ip.ProvisioningInfoProvider; -import org.osgi.service.provisioning.ProvisioningService; - -/** - * Provisioning data implementation. This Dictionary do not store a Strings with - * length 0 (skips them). Also skips on put values "null". - * - * @author Avgustin Marinov - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class ProvisioningData extends Hashtable { - - private static final long serialVersionUID = 1L; - - /** List of all providers used for data load. The highest ranking is last. */ - Vector providers = new Vector(); - - public final static String PROVISIONING_ERROR = "provisioning.error"; - - /** - * Constructs ProvisioningData. - * - * @param bc - * bundle context. - * @param agent - * ProvisioningAgent. - */ - ProvisioningData() { - super.put(ProvisioningService.PROVISIONING_UPDATE_COUNT, new Integer(0)); - } - - /** - * @see java.util.Hashtable#put(java.lang.Object, java.lang.Object) - */ - public Object put(Object key, Object value) { - throw newUnsupportedOperation("put"); - } - - public Object remove(Object key) { - throw newUnsupportedOperation("remove"); - } - - /** - * Gets value for key using all providers. The service with highest ranking. - * - * @see java.util.Hashtable#get(java.lang.Object) - */ - public synchronized Object get(Object key) { - Object value = super.get(key); - Object emptyCash = null; - // if somewhere have "" or byte[0] it will be overiden next ocurence of - // the - // value is found - for CM set "" when there is not value set - boolean hasEmptyString = value != null && isEmpty(value); - if (hasEmptyString) - emptyCash = value; - if (value == null || hasEmptyString) { - synchronized (providers) { - for (int i = providers.size(); i-- > 0;) { - value = ((ProvisioningInfoProvider) providers.elementAt(i)).get(key); - if (value != null && !isEmpty(value)) { - break; - } - if (value != null && !hasEmptyString && isEmpty(value)) { - if (!hasEmptyString) - emptyCash = value; - hasEmptyString = true; - } - } - } - } - if (value == null && hasEmptyString) { - value = emptyCash; - } - return value; - } - - void set(Dictionary newData) { - super.clear(); - add(newData); - } - - void add(Dictionary toAdd) { - if (toAdd == null) { - return; - } - for (Enumeration e = toAdd.keys(); e.hasMoreElements();) { - Object key = e.nextElement(); - if (key instanceof String) { - Object value = toAdd.get(key); - if (value instanceof String || value instanceof byte[] || (key.equals(ProvisioningService.PROVISIONING_UPDATE_COUNT) && value instanceof Integer)) { - if (ProvisioningService.PROVISIONING_REFERENCE.equals(key)) { - value = ((String) value).trim(); - } - super.put(key, value); - } - } - } - } - - void putUC(Integer uc) { - super.put(ProvisioningService.PROVISIONING_UPDATE_COUNT, uc); - } - - void putPrivate(String key, String value) { - if (value == null) { - super.remove(key); - } else { - super.put(key, value); - } - } - - void setError(int code, String message) { - String value = code + " " + ((message != null) ? message : " No details."); - super.put(PROVISIONING_ERROR, value); - } - - void clearError() { - super.remove(PROVISIONING_ERROR); - } - - private final boolean isEmpty(Object value) { - return (value instanceof String && ((String) value).length() == 0) || (value instanceof byte[] && ((byte[]) value).length == 0); - } - - private final RuntimeException newUnsupportedOperation(String methodName) { - RuntimeException e; - try { - e = (RuntimeException) Class.forName("java.lang.UnsupportedOperationException").newInstance(); - } catch (Throwable t) { - e = new IllegalStateException(methodName + " is unsupported method for provisioning dictionary!"); - } - return e; - } - -} diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/package.html b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/package.html deleted file mode 100644 index 8291ee3122..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/package.html +++ /dev/null @@ -1,9 +0,0 @@ - - -This package contains ProSyst specific interfaces for Provisioning process. Implementation of these interfaces can customize provisioning agent behavior. This can be done by registering on the service gateway one ( or both) of the following interfaces:
-
    -
  • {@link org.eclipse.equinox.ip.ProvisioningInfoProvider org.eclipse.equinox.ip.ProvisioningInfoProvider} -
  • {@link org.eclipse.equinox.ip.ProvisioningStorage org.eclipse.equinox.ip.ProvisioningStorage} -
- - \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/BaseProvider.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/BaseProvider.java deleted file mode 100644 index 6da04e878e..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/BaseProvider.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.ip.provider; - -import java.util.Hashtable; -import org.eclipse.equinox.internal.ip.ProvisioningInfoProvider; -import org.eclipse.equinox.internal.ip.impl.Log; -import org.eclipse.equinox.internal.ip.impl.ProvisioningAgent; -import org.osgi.framework.*; - -/** - * Base class for inner providers. Implements their registering and - * unregistering as services, their common debug. - * - * @author Avgustin Marinov - * @author Pavlin Dobrev - * @version 1.0 - */ -public class BaseProvider implements BundleActivator { - - /** Service Registration of ConfigurationLoader service. */ - private ServiceRegistration reg; - - /** - * Invoked from ProvisioningAgent if provider is packed in provisioning - * agent bundle or by FW when it is packed as standalone bundle. Registers - * itself as ProvisioningInfoProvider service with - * Constants.SERVICE_RANKING get from manifest. Puts in provisioning - * dictionary entire stored data. - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bc) throws Exception { - Log.debug = ProvisioningAgent.getBoolean("equinox.provisioning.debug"); - String providers = (String) bc.getBundle().getHeaders().get(ProvisioningInfoProvider.PROVIDERS); - - if (providers != null) { - String className = this.getClass().getName(); - int index = (providers = providers.trim()).indexOf(className); - if (index != -1) { - index += className.length(); - index = providers.indexOf(';', index); - if (index != -1) { - int end = providers.indexOf(',', index); - if (end == -1) { - end = providers.length(); - } - Integer ranking = null; - try { - ranking = new Integer(providers.substring(index + 1, end).trim()); - } catch (NumberFormatException nfe) { - throw new Exception("Bad \"" + ProvisioningInfoProvider.PROVIDERS + "\" header format in manifest! " + toString() + "'s ranking \"" + providers.substring(index + 1, end).trim() + "\" is not valid integer!"); - } - - Log.debug("Registers " + this + " provider with ranking = " + ranking + "."); - Hashtable props = new Hashtable(1, 1.0F); - props.put(Constants.SERVICE_RANKING, ranking); - reg = bc.registerService(ProvisioningInfoProvider.class.getName(), this, props); - return; - } - } - } - throw new Exception("Bad \"" + ProvisioningInfoProvider.PROVIDERS + "\" header format in manifest! Loader " + toString() + " can't be loaded!"); - } - - /** - * Invoked from ProvisioningAgent if provider is packed in provisioning - * agent bundle or by FW when it is packed as standalone bundle. Unregister - * service. - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bc) { - if (reg != null) { - try { - reg.unregister(); - } catch (Exception _) { - } - } - } -} diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/env/EnvironmentInfoProvider.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/env/EnvironmentInfoProvider.java deleted file mode 100644 index 0e8e9601e1..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/env/EnvironmentInfoProvider.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.ip.provider.env; - -import java.util.*; -import org.eclipse.equinox.internal.ip.ProvisioningInfoProvider; -import org.eclipse.equinox.internal.ip.impl.Log; -import org.eclipse.equinox.internal.ip.impl.ProvisioningAgent; -import org.eclipse.equinox.internal.ip.provider.BaseProvider; -import org.osgi.framework.BundleContext; -import org.osgi.service.provisioning.ProvisioningService; - -/** - * Implements ConfiguratorLoader. Reads from system properties and - * BundleContext. Acts as provider. - * - * @author Avgustin Marinov, - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class EnvironmentInfoProvider extends BaseProvider implements ProvisioningInfoProvider { - - /** - * This is a key for property that points if manual setting of info is - * allowed. - */ - public static final String MANUAL_SUPPORT = "equinox.provisioning.env.provider.allowed"; - - /** - * This is a system properties key that points that the system properties - * starting with this key should be pushed into ProvisioningService If value - * for the key is not set or is "" no system properties are pushed. If "*" - * all are pushed. Else -> only the properties with key started with the - * PUSH_STARTING_WITH are pushed. - */ - public static final String PUSH_STARTING_WITH = "equinox.provisioning.env.provider.push.starting.with"; - - /** Properties that are to be loaded into dictionary. */ - private static final String[] props = {ProvisioningService.PROVISIONING_REFERENCE}; - - private BundleContext bc; - - /** - * If manual support is available starts it. - * - * @see org.eclipse.equinox.internal.ip.impl.provider.BaseProvider#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bc) throws Exception { - boolean manualsupport = true; - if (bc.getProperty(MANUAL_SUPPORT) != null) - if (bc.getProperty(MANUAL_SUPPORT).equals("false")) - manualsupport = false; - if (!manualsupport) { - Log.debug(this + " is not an allowed provider."); - return; - } - this.bc = bc; - super.start(bc); - } - - /** - * @see org.eclipse.equinox.internal.ip.ProvisioningInfoProvider#init(org.osgi.service.provisioning.ProvisioningService) - */ - public Dictionary init(ProvisioningService prvSrv) { - Dictionary info = new Hashtable(); - for (int i = props.length; i-- > 0;) { - String value = ProvisioningAgent.bc.getProperty(props[i]); - if (value != null) { - info.put(props[i], value); - } - } - if (ProvisioningAgent.bc.getProperty(PUSH_STARTING_WITH) != null) { - String prefix = ProvisioningAgent.bc.getProperty(PUSH_STARTING_WITH).trim(); - if (prefix.length() != 0) { - boolean all = "*".equals(prefix); - Dictionary sprops = System.getProperties(); - for (Enumeration e = sprops.keys(); e.hasMoreElements();) { - try { - String key = (String) e.nextElement(); - if (all || key.startsWith(prefix)) { - info.put(key, sprops.get(key)); - } - } catch (Exception _) { - } - } - } - } - return info; - } - - /** - * Gets system property - * - * @param key - * the key. - * @return the value. - */ - public Object get(Object key) { - Object value = null; - if (key instanceof String) { - value = ProvisioningAgent.bc.getProperty((String) key); - if (value == null) { - value = bc.getProperty((String) key); - } - } - return value; - } - - /** - * Returns name of this provider. - * - * @return the name. - */ - public String toString() { - return "Environment"; - } -} diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/file/FileProvider.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/file/FileProvider.java deleted file mode 100644 index aeff6e5e37..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/file/FileProvider.java +++ /dev/null @@ -1,192 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.ip.provider.file; - -import java.io.*; -import java.util.Dictionary; -import java.util.Hashtable; -import org.eclipse.equinox.internal.ip.ProvisioningInfoProvider; -import org.eclipse.equinox.internal.ip.impl.Log; -import org.eclipse.equinox.internal.ip.impl.ProvisioningAgent; -import org.eclipse.equinox.internal.ip.provider.BaseProvider; -import org.osgi.framework.BundleContext; -import org.osgi.service.provisioning.ProvisioningService; - -/** - * Loads data from inner (in jar) file or from file on hard disk. Only string - * "TEXT" data is loaded directly into provisioning dictionary. All binaries are - * load into inner dictionary only and are delivered only to when get method is - * invoked. - * - * @author Avgustin Marinov - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class FileProvider extends BaseProvider implements ProvisioningInfoProvider { - - /** Name of configuration file. */ - public static final String PROPS_FILE = "/props.txt"; - - /** This line points start of TEXT section in props.txt file */ - public static final String TEXT = "#[TEXT]"; - - /** This line points start of BINARY section in props.txt file */ - public static final String BINARY = "#[BINARY]"; - - /** This property is used to be determined if to be used this allowed. */ - public static final String FILE_SUPPORT = "equinox.provisioning.file.provider.allowed"; - - /** - * This property is used to be determined if to be provider only if this - * provider is started for first. - */ - public static final String LOAD_ONCE = "equinox.provisioning.file.load.once"; - - /** - * This dictionary keeps data that is provided by provider but is not put - * into provisioning data. - */ - private Dictionary innerDict = new Hashtable(); - - /** File that is used as flag if this is first start of provider. */ - private File file; - - /** - * @see org.eclipse.equinox.internal.ip.impl.provider.BaseProvider#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bc) throws Exception { - boolean filesupport = true; - if (bc.getProperty(FILE_SUPPORT) != null) - if (bc.getProperty(FILE_SUPPORT).equals("false")) - filesupport = false; - if (!filesupport) { - Log.debug(this + " is not an allowed provider."); - return; - } - - file = bc.getDataFile("_mark123"); - boolean loadonce = true; - if (bc.getProperty(LOAD_ONCE) != null) - if (bc.getProperty(LOAD_ONCE).equals("false")) - loadonce = false; - if (file.exists() && loadonce) { - Log.debug("File provider have loaded data already!"); - return; - } - super.start(bc); - } - - /** - * Loads data from inner (in jar) file or from file on hard disk. Data from - * "props" is put into provisioning data dictionary but others entries are - * put into "innerDict" and are available if someone request them. - * - * @see org.eclipse.equinox.internal.ip.ProvisioningInfoProvider#init(org.osgi.service.provisioning.ProvisioningService) - */ - public Dictionary init(ProvisioningService prvSrv) throws Exception { - boolean loadonce = true; - if (ProvisioningAgent.bc.getProperty(LOAD_ONCE) != null) - if (ProvisioningAgent.bc.getProperty(LOAD_ONCE).equals("false")) - loadonce = false; - if (file.exists() && loadonce) { - Log.debug("File provider have loaded data already!"); - return null; - } - String externalFileLocation = ProvisioningAgent.bc.getProperty("equinox.provisioning.file.provider.specfile.location"); - BufferedReader reader = new BufferedReader(new InputStreamReader(externalFileLocation == null ? FileProvider.class.getResourceAsStream(PROPS_FILE) : new FileInputStream(externalFileLocation))); - Dictionary dictionary = new Hashtable(10, 1.0F); - try { - ByteArrayOutputStream baos = null; - byte[] buffer = null; - int i; - - String line; - boolean stringMode = true; - while ((line = reader.readLine()) != null) { - if (!(line = line.trim()).startsWith("#")) { - if ((i = line.indexOf('=')) != -1) { - if (stringMode) { - dictionary.put(line.substring(0, i), line.substring(i + 1)); - } else { - if (baos == null) { - baos = new ByteArrayOutputStream(); - buffer = new byte[256]; - } - - String key = line.substring(0, i); - String entryName = line.substring(i + 1); - InputStream is; - if (externalFileLocation == null) { - is = FileProvider.class.getResourceAsStream(entryName); - if (is == null && entryName.length() != 0 && entryName.charAt(0) != '/') { - is = FileProvider.class.getResourceAsStream('/' + entryName); - } - } else - is = new FileInputStream(entryName); - for (; // - (i = is.read(buffer, 0, buffer.length)) != -1; // - baos.write(buffer, 0, i)) { - } - - innerDict.put(key, baos.toByteArray()); - - baos.reset(); - } - } - } else { - if (line.equalsIgnoreCase(TEXT)) { - stringMode = true; - } else if (line.equalsIgnoreCase(BINARY)) { - stringMode = false; - } - } - } - if (!file.exists()) { - FileOutputStream fos = new FileOutputStream(file); - try { - fos.write(ZERO_BYTE_ARRAY); - } finally { - fos.close(); - } - } - } finally { - reader.close(); - } - return dictionary; - } - - private static final byte[] ZERO_BYTE_ARRAY = new byte[] {0}; - - /** - * Provides value for this key form "innnerDict". - * - * @param key - * the key. - * @return the value. - */ - public Object get(Object key) { - return innerDict.get(key); - } - - /** - * Returns name of this provider. - * - * @return name of provider. - */ - public String toString() { - return "File"; - } -} diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/http/Context.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/http/Context.java deleted file mode 100644 index 0632005379..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/http/Context.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.ip.provider.http; - -import java.net.URL; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.osgi.service.http.HttpContext; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -final class Context implements HttpContext { - - private Context() { - // prevent instantiation - } - - private static Context singleton; - - public static final Context getInstance() { - if (singleton == null) { - singleton = new Context(); - } - return singleton; - } - - /** - * @see org.osgi.service.http.HttpContext#getResource(java.lang.String) - */ - public URL getResource(String name) { - return this.getClass().getResource(name); - } - - /** - * @see org.osgi.service.http.HttpContext#getMimeType(java.lang.String) - */ - public String getMimeType(String name) { - return null; - } - - /** - * @see org.osgi.service.http.HttpContext#handleSecurity(javax.servlet.http.HttpServletRequest, - * javax.servlet.http.HttpServletResponse) - */ - public boolean handleSecurity(HttpServletRequest request, HttpServletResponse response) { - return true; - } - -} diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/http/HttpProvider.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/http/HttpProvider.java deleted file mode 100644 index b61bc3c68a..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/provider/http/HttpProvider.java +++ /dev/null @@ -1,290 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.ip.provider.http; - -import java.util.*; -import javax.servlet.http.*; -import org.eclipse.equinox.internal.ip.ProvisioningInfoProvider; -import org.eclipse.equinox.internal.ip.impl.Log; -import org.eclipse.equinox.internal.ip.impl.ProvisioningAgent; -import org.eclipse.equinox.internal.ip.provider.BaseProvider; -import org.osgi.framework.*; -import org.osgi.service.http.HttpService; -import org.osgi.service.provisioning.ProvisioningService; -import org.osgi.service.useradmin.*; - -/** - * Implements ProvisioningInfoProvider. Allows remote data loading through HTTP. - * Acts as dynamic provider. On load(Dictionary) it just get reference - * to provisioning data. - * - * @author Avgustin Marinov - * @author Pavlin Dobrev - * @version 1.0 - */ -public class HttpProvider extends BaseProvider implements ProvisioningInfoProvider, ServiceListener { - - /** Alias this servlet will be registered if remote configuration is allowed. */ - public static final String ALIAS = "/rminit"; - /** - * This is a key for property that points if remote setting of info is - * allowed. - */ - public static final String HTTP_SUPPORT = "equinox.provisioning.http.provider.allowed"; - /** - * This system property is used to be determined if to accepts only - * HttpServletRequest-s with scheme "https". - */ - public static final String SECURE = "equinox.provisioning.http.provider.secure"; - /** This system property determines if to requires authentication. */ - public static final String REQUIRE_AUTH = "equinox.provisioning.require.auth"; - - /** If to accepts only HttpServletRequests with scheme "https". */ - static boolean secure; - /** Reference to provisioning service. */ - ProvisioningService prvSrv; - /** Bundle context reference. */ - private BundleContext bc; - /** HTTP service that is used for registration of servlet. */ - private HttpService http; - /** Servlet that is registered. */ - private HttpServlet servlet = new HttpServletImpl(); - - /** - * @see org.eclipse.equinox.internal.ip.impl.provider.BaseProvider#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bc) throws Exception { - boolean httpsupport = true; - if (bc.getProperty(HTTP_SUPPORT) != null) - if (bc.getProperty(HTTP_SUPPORT).equals("false")) - httpsupport = false; - if (!httpsupport) { - Log.debug(this + " is not an allowed provider."); - return; - } - - this.bc = bc; - super.start(bc); - } - - /** - * Stops provider. Unregister servlet. - * - * @see org.eclipse.equinox.internal.ip.impl.provider.BaseProvider#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bc) { - super.stop(bc); - if (http != null) { - try { - http.unregister(ALIAS); - } catch (Exception e) { - // Not fatal - } - http = null; - } - } - - /** - * @see org.eclipse.equinox.internal.ip.ProvisioningInfoProvider#init(org.osgi.service.provisioning.ProvisioningService) - */ - public Dictionary init(ProvisioningService prvSrv) { - this.prvSrv = prvSrv; - secure = false; - if (ProvisioningAgent.bc.getProperty(SECURE) != null) - if (ProvisioningAgent.bc.getProperty(SECURE).equals("true")) - secure = true; - try { - bc.addServiceListener(this, '(' + "objectClass" + '=' + HttpService.class.getName() + ')'); - } catch (Exception e) { - Log.debug(e); - } - - synchronized (this) { - if (http == null) { - ServiceReference sref = bc.getServiceReference(HttpService.class.getName()); - if (sref != null) { - http = (HttpService) bc.getService(sref); - registerServlet(); - } - } - } - return null; // Do not loads - } - - /** - * @see org.eclipse.equinox.internal.ip.ProvisioningInfoProvider#get(java.lang.Object) - */ - public Object get(Object key) { - return null; - } - - /** - * Manages servlet (un)registration. - * - * @see org.osgi.framework.ServiceListener#serviceChanged(org.osgi.framework.ServiceEvent) - */ - public synchronized void serviceChanged(ServiceEvent se) { - if (se.getType() == ServiceEvent.REGISTERED) { - if (http == null) { - http = (HttpService) bc.getService(se.getServiceReference()); - registerServlet(); - } - } else if (se.getType() == ServiceEvent.UNREGISTERING) { - if (http != null) { - try { - http.unregister(ALIAS); - } catch (Exception e) { - // Not fatal - } - http = null; - ServiceReference sref = bc.getServiceReference(HttpService.class.getName()); - if (sref != null) { - http = (HttpService) bc.getService(sref); - registerServlet(); - } - } - } - } - - // Registers servlet with ALIAS. - private void registerServlet() { - try { - http.registerServlet(ALIAS, servlet, null, Context.getInstance()); - Log.debug("Servlet \"" + ALIAS + "\" registered."); - } catch (Exception e) { - // Servlet won't be registered - Log.debug("Error registering HTTP provider servlet!", e); - } - } - - /** - * Return name of provider. - * - * @return name. - */ - public String toString() { - return "Http"; - } - - /** - * Class implements servlet which enables (un)secure remote configuration. - */ - class HttpServletImpl extends HttpServlet { - - private static final long serialVersionUID = 1L; - - // If supports remote configuration - /** - * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, - * javax.servlet.http.HttpServletResponse) - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) { - Log.debug("doGet ..."); - if (request.getHeader("Get-Id") == null) { - Log.debug("Redirect to doPost."); - doPost(request, response); - } else { - Log.debug("Request for spid."); - if (secure && !request.getScheme().equals("https")) { - Log.debug("Request to secure HttpLoader must be via https!"); - response.setHeader("error", "Request to secure HttpLoader must be via https!"); - response.setStatus(HttpServletResponse.SC_OK); - return; - } - String spid = (String) prvSrv.getInformation().get(ProvisioningService.PROVISIONING_SPID); - if (spid != null && spid.length() != 0) { - response.setHeader("Gw-Id", spid); - } - response.setStatus(HttpServletResponse.SC_OK); - } - } - - // If supports remote configuration - /** - * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, - * javax.servlet.http.HttpServletResponse) - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) { - Log.debug("doPost ..."); - if (secure && !request.getScheme().equals("https")) { - Log.debug("Request to secure HttpLoader must be via https!"); - response.setHeader("error", "Request to secure HttpLoader must be via https!"); - response.setStatus(HttpServletResponse.SC_OK); - return; - } - - String user = request.getParameter("user"); - String pass = request.getParameter("pass"); - - boolean req_auth = false; - if (ProvisioningAgent.bc.getProperty(REQUIRE_AUTH) != null) - if (ProvisioningAgent.bc.getProperty(REQUIRE_AUTH).equals("true")) - req_auth = true; - - if (!req_auth && !checkAccount(user, pass)) { - Log.debug("Incorrect Account!"); - response.setHeader("error", "Incorrect account!"); - return; - } - - Dictionary info = new Hashtable(); - Log.debug("HttpLoader loads:"); - for (Enumeration e = request.getParameterNames(); e.hasMoreElements();) { - String name = (String) e.nextElement(); - if (!"user".equals(name) && !"pass".equals(name)) { - String param = request.getParameter(name); - if (ProvisioningInfoProvider.GM_HOST.equals(name) && "no".equals(param)) { - continue; - } - Log.debug(" " + name + '=' + param); - info.put(name, param); - } - } - - prvSrv.addInformation(info); - response.setStatus(HttpServletResponse.SC_OK); - } - } - - /* - * Returns if account is correct. - * - * TODO: add user admin to tracked services - */ - boolean checkAccount(String user, String pass) { - if (user == null || pass == null) { - return false; - } - - ServiceReference sref = bc.getServiceReference(UserAdmin.class.getName()); - if (sref == null) { - return false; - } - UserAdmin userAdmin = (UserAdmin) bc.getService(sref); - if (userAdmin != null) { - try { - User userRole = (User) userAdmin.getRole(user); - if (userRole != null && userRole.hasCredential("password", pass)) { - Authorization authorization = userAdmin.getAuthorization(userRole); - return authorization.hasRole("administration"); - } - } catch (Exception e) { - Log.debug(e); - } - } - return false; - } - -} diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/storage/cm/CMStorage.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/storage/cm/CMStorage.java deleted file mode 100644 index 1381bc1092..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/storage/cm/CMStorage.java +++ /dev/null @@ -1,242 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.ip.storage.cm; - -import java.io.IOException; -import java.util.Dictionary; -import java.util.Hashtable; -import org.eclipse.equinox.internal.ip.ProvisioningStorage; -import org.eclipse.equinox.internal.ip.impl.Log; -import org.eclipse.equinox.internal.ip.impl.ProvisioningAgent; -import org.osgi.framework.*; -import org.osgi.service.cm.*; -import org.osgi.service.provisioning.ProvisioningService; -import org.osgi.util.tracker.ServiceTracker; - -/** - * Implements Storage by using CM. - * - * @author Avgustin Marinov - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class CMStorage implements ProvisioningStorage, ManagedService, BundleActivator { - - /** PID for Configuration Manager */ - public static final String PID = "equinox.provisioning.provisioning.pid"; - /** - * This system property is used for determining if to be used this - * storage/provider. - */ - public static final String CM_SUPPORT = "equinox.provisioning.cm.support"; - - /** Registration as Managed Service. */ - private ServiceRegistration msSReg; - /** Registration as Storage Service. */ - private ServiceRegistration sSReg; - - /** Tracker for ProvisioningService. */ - private ServiceTracker prvSrvTracker; - /** Tracker for ConfigurationAdmin. */ - private ServiceTracker cmTracker; - - // /** Initial data data.*/ - // private Dictionary info; - /** BundleContext. */ - private BundleContext bc; - - /** Counter is used for skipping "own update()-s". */ - private int counter; - - private boolean infoLoaded; - private boolean skipStore; - - private boolean registering; - - /** - * Opens tracker an register itself as ManagedService. - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bc) throws Exception { - Log.debug = ProvisioningAgent.getBoolean("equinox.provisioning.debug"); - boolean cmsupport = true; - if (ProvisioningAgent.bc.getProperty(CM_SUPPORT) != null) - if (ProvisioningAgent.bc.getProperty(CM_SUPPORT).equals("false")) - cmsupport = false; - if (!cmsupport) { - Log.debug(this + " is not supported provider/storage!"); - return; - } // Do not be used as provider or storage - - this.bc = bc; - counter = 0; - registering = false; - - prvSrvTracker = new ServiceTracker(bc, ProvisioningService.class.getName(), null); - prvSrvTracker.open(); - - cmTracker = new ServiceTracker(bc, ConfigurationAdmin.class.getName(), null); - cmTracker.open(); - - Dictionary props = new Hashtable(1, 1.0F); - props.put(Constants.SERVICE_PID, PID); - msSReg = bc.registerService(ManagedService.class.getName(), this, props); - Log.debug("Managed Service Registered."); - } - - /** - * Closes cmTracker and unregister service. - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bc) { - Log.debug("Close " + this + '.'); - bc = null; - try { - if (sSReg != null) { - sSReg.unregister(); - sSReg = null; - } - } catch (Exception _) { - } - try { - if (msSReg != null) { - msSReg.unregister(); - msSReg = null; - } - } catch (Exception _) { - } - - prvSrvTracker.close(); - prvSrvTracker = null; - - cmTracker.close(); - cmTracker = null; - } - - /** - * @see org.eclipse.equinox.internal.ip.ProvisioningStorage#getStoredInfo() - */ - public Dictionary getStoredInfo() { - try { - ConfigurationAdmin cm = (ConfigurationAdmin) cmTracker.getService(); - if (cm == null) { - return null; - } - Configuration config = cm.getConfiguration(PID); - Dictionary info = config.getProperties(); - infoLoaded = true; - return info; - } catch (IOException ioe) { - Log.debug(ioe); - } - return null; - } - - /** - * @see org.eclipse.equinox.internal.ip.ProvisioningStorage#store(java.util.Dictionary) - */ - public void store(Dictionary provisioningData) { - try { - synchronized (this) { - if (skipStore) { - skipStore = false; - return; - } - } - ConfigurationAdmin cm = (ConfigurationAdmin) cmTracker.getService(); - if (cm == null) { - return; - } - Configuration config = cm.getConfiguration(PID); - - synchronized (this) { - Log.debug("Store data into CM"); - config.update(provisioningData); - counter++; - } - } catch (IOException e) { - // Should be impossible - Log.debug(e); - } - } - - /** - * @see org.osgi.service.cm.ManagedService#updated(java.util.Dictionary) - */ - public void updated(Dictionary props) { - boolean register = false; - synchronized (this) { - if (registering) { - try { - wait(); - } catch (InterruptedException ioe) { - } // Should not happened - } - if (sSReg == null && bc != null) { - registering = true; - register = true; - } - } - - if (register) { - try { - sSReg = bc.registerService(ProvisioningStorage.class.getName(), this, null); - Log.debug(this + " Registered."); - } catch (Exception e) { - Log.debug(e); - } - synchronized (this) { - registering = false; - notifyAll(); - } - return; - } - - Log.debug("CM Storage Updated : counter = " + counter); - synchronized (this) { - if (counter != 0) { - counter--; - return; - } // This is an own update() so one updated() will be skipped - } - - if (props == null) { - return; - } - - ProvisioningService prvSrv = (ProvisioningService) prvSrvTracker.getService(); - if (prvSrv != null) { - synchronized (this) { - if (!infoLoaded) { - skipStore = true; - infoLoaded = true; - } - } - prvSrv.addInformation(props); - } - } - - /** - * Returns name of Storage. - * - * @return name. - */ - public String toString() { - return "CM Storage"; - } -} diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/storage/file/FileStorage.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/storage/file/FileStorage.java deleted file mode 100644 index 64e3abb241..0000000000 --- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/storage/file/FileStorage.java +++ /dev/null @@ -1,188 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.ip.storage.file; - -import java.io.*; -import java.util.*; -import java.util.zip.*; -import org.eclipse.equinox.internal.ip.ProvisioningStorage; -import org.eclipse.equinox.internal.ip.impl.Log; -import org.eclipse.equinox.internal.ip.impl.ProvisioningAgent; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.service.provisioning.ProvisioningService; - -/** - * File Storage. - * - * @author Avgustin Marinov, - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class FileStorage implements ProvisioningStorage, BundleActivator { - - /** Name of data file used for storing configuration. */ - public static final String FILE_NAME = "_storage.zip"; - - /** Bundle context. */ - private BundleContext bc; - - /** - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bc) throws Exception { - Log.debug = ProvisioningAgent.getBoolean("equinox.provisioning.debug"); - this.bc = bc; - } - - /** - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bc) throws Exception { - } - - /** - * @see org.eclipse.equinox.internal.ip.ProvisioningStorage#getStoredInfo() - */ - public Dictionary getStoredInfo() { - FileInputStream fis = null; - try { - fis = new FileInputStream(bc.getDataFile(FILE_NAME)); - } catch (Exception e) { - return null; - } - try { - Dictionary toAdd = new Hashtable(); - getInfo(fis, toAdd); - fis.close(); - return toAdd; - } catch (Exception e) { - Log.debug(e); - return null; - } - } - - /** - * @see org.eclipse.equinox.internal.ip.ProvisioningStorage#store(java.util.Dictionary) - */ - public void store(Dictionary dictionary) { - try { - FileOutputStream fos = new FileOutputStream(bc.getDataFile(FILE_NAME)); - saveInfo(fos, dictionary); - fos.close(); - } catch (Exception e) { - Log.debug(e); - } - } - - /** - * Returns string name of storage. - * - * @see java.lang.Object#toString() - */ - public String toString() { - return "File Storage"; - } - - /** - * Decodes data from input stream and loads it in passed dictionary. - * - * @param is - * input stream in specific format. - * @param info - * dictionary. - */ - private void getInfo(InputStream is, Dictionary info) { - if (is != null) { - try { - ZipInputStream zis = new ZipInputStream(is); - ZipEntry ze; - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - int read; - byte[] buff = new byte[256]; - while ((ze = zis.getNextEntry()) != null) { - if ("props.txt".equals(ze.getName())) { - BufferedReader reader = new BufferedReader(new InputStreamReader(zis)); - String line; - int index; - while ((line = reader.readLine()) != null) { - if (!(line = line.trim()).startsWith("#")) { - if ((index = line.indexOf("=")) != -1) { - String key = line.substring(0, index); - if (ProvisioningService.PROVISIONING_UPDATE_COUNT.equals(key)) { - int uc = 0; - try { - uc = Integer.parseInt(line.substring(index + 1).trim()); - } catch (Exception _) { - } - info.put(key, new Integer(uc)); - } else { - info.put(key, line.substring(index + 1)); - } - } - } - } - } else { - while ((read = zis.read(buff)) != -1) { - baos.write(buff, 0, read); - } - info.put(ze.getName(), baos.toByteArray()); - baos.reset(); - } - zis.closeEntry(); - } - } catch (Exception e) { - Log.debug(e); - // What is loaded is loaded. - } - } - } - - /** - * Encodes "info" and saves it into an output stream. - * - * @param os - * output stream where to be saved data. - */ - private void saveInfo(OutputStream os, Dictionary info) { - try { - ZipOutputStream zos = new ZipOutputStream(os); - ByteArrayOutputStream strings = new ByteArrayOutputStream(); - Object key; - Object value; - for (Enumeration e = info.keys(); e.hasMoreElements();) { - key = e.nextElement(); - value = info.get(key); - if (value instanceof String || ProvisioningService.PROVISIONING_UPDATE_COUNT.equals(key)) { - strings.write((key + "=" + value + "\r\n").getBytes()); - } else if (value instanceof byte[]) { - ZipEntry ze = new ZipEntry((String) key); - zos.putNextEntry(ze); - zos.write((byte[]) value); - zos.closeEntry(); - } - } - ZipEntry ze = new ZipEntry("props.txt"); - zos.putNextEntry(ze); - zos.write(strings.toByteArray()); - zos.closeEntry(); - zos.close(); - } catch (Exception e) { - Log.debug(e); - // What is load is load. - } - } -} diff --git a/bundles/org.eclipse.equinox.log.stream/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.log.stream/META-INF/MANIFEST.MF index 64bfa8deff..e2d33fa58e 100644 --- a/bundles/org.eclipse.equinox.log.stream/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.log.stream/META-INF/MANIFEST.MF @@ -10,6 +10,7 @@ Bundle-Localization: plugin Import-Package: org.osgi.framework;version="[1.9.0,2.0.0)", org.osgi.service.log;version="[1.4.0,2.0.0)", org.osgi.service.log.stream;version="[1.0,1.1)", + org.osgi.util.function;version="1.2.0", org.osgi.util.promise;version="[1.0.0,2.0.0)", org.osgi.util.pushstream;version="[1.0,1.1)", org.osgi.util.tracker;version="[1.5.0,2.0.0)" diff --git a/bundles/org.eclipse.equinox.util/.classpath b/bundles/org.eclipse.equinox.util/.classpath deleted file mode 100644 index 098194ca4b..0000000000 --- a/bundles/org.eclipse.equinox.util/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/bundles/org.eclipse.equinox.util/.project b/bundles/org.eclipse.equinox.util/.project deleted file mode 100644 index 25f0d0c179..0000000000 --- a/bundles/org.eclipse.equinox.util/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.equinox.util - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/bundles/org.eclipse.equinox.util/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.equinox.util/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/bundles/org.eclipse.equinox.util/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/bundles/org.eclipse.equinox.util/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.util/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 5c82e1bf18..0000000000 --- a/bundles/org.eclipse.equinox.util/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,528 +0,0 @@ -eclipse.preferences.version=1 -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.annotation.inheritNullAnnotations=disabled -org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull -org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= -org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable -org.eclipse.jdt.core.compiler.annotation.nullable.secondary= -org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -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.APILeak=warning -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=error -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled -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.includeNullInfoFromAsserts=disabled -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=warning -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.missingDefaultCase=ignore -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=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=warning -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -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.nonnullParameterAnnotationDropped=warning -org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning -org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning -org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled -org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info -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.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled -org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedImport=error -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=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error -org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.7 -org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false -org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false -org.eclipse.jdt.core.formatter.align_with_spaces=false -org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=0 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=49 -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_assertion_message=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_bitwise_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 -org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 -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_record_components=16 -org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 -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_shift_operator=0 -org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=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_record_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_type_annotations=0 -org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 -org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 -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_last_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=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_statement_group_in_switch=0 -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_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_record_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.align_tags_descriptions_grouped=true -org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false -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.count_line_length_from_starting_position=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=true -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=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=false -org.eclipse.jdt.core.formatter.comment.indent_tag_description=false -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not 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.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=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_record_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=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert -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_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_after_type_annotation=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_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=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_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not 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_record_components=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=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_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not 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_record_declaration=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_relational_operator=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_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert -org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=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_bitwise_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_record_declaration=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_record_components=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_switch_case_expressions=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_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=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_record_constructor=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_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_record_declaration=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_relational_operator=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_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=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_annotation_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never -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_enum_constant_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false -org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never -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_after_code_block=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.text_block_indentation=0 -org.eclipse.jdt.core.formatter.use_on_off_tags=true -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true -org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator=true -org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true -org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true -org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true -org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true -org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true -org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error -org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/bundles/org.eclipse.equinox.util/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.util/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 950790ec0b..0000000000 --- a/bundles/org.eclipse.equinox.util/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,65 +0,0 @@ -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile -formatter_settings_version=21 -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_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_functional_interfaces=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=true -sp_cleanup.format_source_code_changes_only=false -sp_cleanup.insert_inferred_type_arguments=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_redundant_type_arguments=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_anonymous_class_creation=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_lambda=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/bundles/org.eclipse.equinox.util/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.equinox.util/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index 5ead3a631c..0000000000 --- a/bundles/org.eclipse.equinox.util/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Fri Mar 30 10:11:50 EEST 2007 -eclipse.preferences.version=1 -pluginProject.extensions=false -resolve.requirebundle=false diff --git a/bundles/org.eclipse.equinox.util/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.util/META-INF/MANIFEST.MF deleted file mode 100644 index 4e73243193..0000000000 --- a/bundles/org.eclipse.equinox.util/META-INF/MANIFEST.MF +++ /dev/null @@ -1,29 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.equinox.util -Bundle-Name: %bundleName -Bundle-Version: 1.1.400.qualifier -Bundle-Vendor: %bundleVendor -Bundle-Activator: org.eclipse.equinox.internal.util.UtilActivator -Bundle-Description: The Equinox Util Bundle contains services to facilitate bundle developers in their programming, and to lighten resource usage at runtime. -Import-Package: - org.osgi.framework;version="1.3", - org.osgi.service.cm;version="1.0", - org.osgi.service.log;version="1.0.0", - org.osgi.util.tracker;version="1.2" -Export-Package: - org.eclipse.equinox.internal.util;x-internal:=true, - org.eclipse.equinox.internal.util.event;version="1.0";x-friends:="org.eclipse.equinox.ds", - org.eclipse.equinox.internal.util.hash;version="1.0";x-friends:="org.eclipse.equinox.ds,org.eclipse.equinox.io,org.eclipse.equinox.wireadmin", - org.eclipse.equinox.internal.util.impl.tpt;x-internal:=true, - org.eclipse.equinox.internal.util.impl.tpt.threadpool;x-internal:=true, - org.eclipse.equinox.internal.util.impl.tpt.timer;x-internal:=true, - org.eclipse.equinox.internal.util.pool;version="1.0";x-friends:="org.eclipse.equinox.ds,org.eclipse.equinox.io", - org.eclipse.equinox.internal.util.ref;version="1.0";x-friends:="org.eclipse.equinox.ds,org.eclipse.equinox.io,org.eclipse.equinox.ip,org.eclipse.equinox.wireadmin", - org.eclipse.equinox.internal.util.security;x-internal:=true, - org.eclipse.equinox.internal.util.threadpool;version="1.0";x-friends:="org.eclipse.equinox.ds", - org.eclipse.equinox.internal.util.timer;version="1.0";x-friends:="org.eclipse.equinox.ds,org.eclipse.equinox.ip" -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Bundle-ActivationPolicy: lazy -Bundle-Localization: plugin -Automatic-Module-Name: org.eclipse.equinox.util diff --git a/bundles/org.eclipse.equinox.util/OSGI-INF/permissions.perm b/bundles/org.eclipse.equinox.util/OSGI-INF/permissions.perm deleted file mode 100644 index 5a965875d0..0000000000 --- a/bundles/org.eclipse.equinox.util/OSGI-INF/permissions.perm +++ /dev/null @@ -1 +0,0 @@ -(java.security.AllPermission "*" "*") \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.util/about.html b/bundles/org.eclipse.equinox.util/about.html deleted file mode 100644 index 164f781a8f..0000000000 --- a/bundles/org.eclipse.equinox.util/about.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - -About - - -

About This Content

- -

November 30, 2017

-

License

- -

- 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 2.0 ("EPL"). A copy of the EPL is - available at http://www.eclipse.org/legal/epl-2.0. - For purposes of the EPL, "Program" will mean the Content. -

- -

- 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 http://www.eclipse.org. -

- - - \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.util/build.properties b/bundles/org.eclipse.equinox.util/build.properties deleted file mode 100644 index 41490f2f19..0000000000 --- a/bundles/org.eclipse.equinox.util/build.properties +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################### -# Copyright (c) 1997-2009 by ProSyst Software GmbH -# http://www.prosyst.com -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# ProSyst Software GmbH - initial API and implementation -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - OSGI-INF/ -src.includes = about.html diff --git a/bundles/org.eclipse.equinox.util/forceQualifierUpdate.txt b/bundles/org.eclipse.equinox.util/forceQualifierUpdate.txt deleted file mode 100644 index 56f1032a8a..0000000000 --- a/bundles/org.eclipse.equinox.util/forceQualifierUpdate.txt +++ /dev/null @@ -1,2 +0,0 @@ -# To force a version qualifier update add the bug here -Bug 403352 - Update all parent versions to match our build stream diff --git a/bundles/org.eclipse.equinox.util/plugin.properties b/bundles/org.eclipse.equinox.util/plugin.properties deleted file mode 100644 index 4b6309e1b8..0000000000 --- a/bundles/org.eclipse.equinox.util/plugin.properties +++ /dev/null @@ -1,17 +0,0 @@ -############################################################################### -# Copyright (c) 1997-2009 by ProSyst Software GmbH -# http://www.prosyst.com -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# ProSyst Software GmbH - initial API and implementation -############################################################################### -#Properties file for org.eclipse.equinox.util -bundleVendor = Eclipse.org - Equinox -bundleName = Equinox Util Bundle \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.util/pom.xml b/bundles/org.eclipse.equinox.util/pom.xml deleted file mode 100644 index da554180b8..0000000000 --- a/bundles/org.eclipse.equinox.util/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - 4.0.0 - - rt.equinox.bundles - org.eclipse.equinox.bundles - 4.24.0-SNAPSHOT - ../../ - - org.eclipse.equinox - org.eclipse.equinox.util - 1.1.400-SNAPSHOT - eclipse-plugin - diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/TracerMap.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/TracerMap.java deleted file mode 100644 index 58707edcc3..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/TracerMap.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util; - -import org.eclipse.equinox.internal.util.hash.HashIntObjNS; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class TracerMap { - - public static HashIntObjNS getMap() { - HashIntObjNS map = new HashIntObjNS(29); - - map.put(1, "[BEGIN - start method]"); - map.put(1001, "[BEGIN - Log instance] Loading referent classes took"); - map.put(101, "Getting system props, bundle id and log service took "); - map.put(102, "Getting Trace Service took "); - map.put(3001, "Loading tracer map took "); - map.put(2001, "[END - Log instance] Creating log instance took "); - map.put(3, "Creating Thread Pool service took "); - map.put(4, "Registering Thread Pool service took "); - map.put(33, "Creating Timer service took "); - map.put(5, "Registering Timer service took "); - map.put(16, "[END - start method] PutilActivator.start() method executed for "); - map.put(0, "Putil Activator"); - map.put(-0x0100, "Threadpool"); - map.put(10001, "Registering commands with groupname "); - map.put(10002, "Unregistering commands with groupname "); - map.put(10003, "START Running: "); - map.put(10004, "END Running: "); - map.put(10005, "Going to run: "); - return map; - } - - public static HashIntObjNS getStarts() { - return null; - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/UtilActivator.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/UtilActivator.java deleted file mode 100644 index 2e2c8da6c4..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/UtilActivator.java +++ /dev/null @@ -1,200 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util; - -import org.eclipse.equinox.internal.util.impl.tpt.ServiceFactoryImpl; -import org.eclipse.equinox.internal.util.impl.tpt.threadpool.ThreadPoolFactoryImpl; -import org.eclipse.equinox.internal.util.impl.tpt.timer.TimerFactory; -import org.eclipse.equinox.internal.util.ref.Log; -import org.eclipse.equinox.internal.util.ref.TimerRef; -import org.eclipse.equinox.internal.util.threadpool.ThreadPoolFactory; -import org.eclipse.equinox.internal.util.threadpool.ThreadPoolManager; -import org.eclipse.equinox.internal.util.timer.Timer; -import org.osgi.framework.*; - -/** - * Bundle activator for the Utility Bundle. This class is responsible to the - * registration of ProSyst utility services as Parser Service, Thread Pool - * Service, etc. - * - * @author Maria Ivanova - * @author Daniel Yanev - * @author Plamen K. Kosseff - * @author Pavlin Dobrev - * @version 1.0 - */ -public class UtilActivator implements BundleActivator { - - public static ThreadPoolFactoryImpl thMan; - private ServiceRegistration thManReg; - - public static TimerFactory timer; - private ServiceRegistration timerReg; - public static Log log; - public static int debugLevel = 1; - public static BundleContext bc; - public static boolean LOG_DEBUG; - public static boolean startup; - - static long time[] = null; - - static void timeLog(int id) { - time[1] = time[0]; - log.debug(0, id, String.valueOf((time[0] = System.currentTimeMillis()) - time[1]), null, false, true); - } - - public static long[] points = null; - - /** - * This is implementation of BundleActivator start method. Thsi method is - * responsible to the registering of the thread pool, system, pasrser and - * timer services. Also adds the framework and system pluggable commands to - * the parser service pluggable commands. - * - * @param context - * The execution context of the bundle being started. - * @exception BundleException - * If this method throws an exception, the bundle is marked - * as stopped and the framework will remove the bundle's - * listeners, unregister all service's registered by the - * bundle, release all services used by the bundle. - */ - @Override - public void start(BundleContext context) throws BundleException { - UtilActivator.bc = context; - startup = getBoolean("equinox.measurements.bundles"); - if (startup) { - long tmp = System.currentTimeMillis(); - time = new long[] {tmp, 0, tmp}; - points = new long[3]; - } - - UtilActivator.bc = context; - try { - log = new Log(context, false); - LOG_DEBUG = getBoolean("equinox.putil.debug"); - log.setDebug(LOG_DEBUG); - log.setPrintOnConsole(getBoolean("equinox.putil.console")); - debugLevel = getInteger("equinox.putil.debug.level", 1); - - if (startup) { - if (LOG_DEBUG) - log.setMaps(TracerMap.getMap(), TracerMap.getStarts()); - - /* 1 = "[BEGIN - start method]" */ - log.debug(0, 1, null, null, false, true); - /* 1001 = "[BEGIN - Log instance] Loading referent classes took" */ - log.debug(0, 1001, String.valueOf(points[0] - time[0]), null, false, true); - /* 101 = "Getting system props, bundle id and log service took " */ - log.debug(0, 101, String.valueOf(points[1] - points[0]), null, false, true); - /* 102 = "Getting Trace Service took " */ - log.debug(0, 102, String.valueOf(points[2] - points[1]), null, false, true); - time[1] = time[0]; - /* 3001 = "Loading tracer map took " */ - log.debug(0, 3001, String.valueOf((time[0] = System.currentTimeMillis()) - points[2]), null, false, true); - /* 2001 = "[END - Log instance] Creating log instance took " */ - log.debug(0, 2001, String.valueOf(time[0] - time[1]), null, false, true); - } - - String bundleName = ServiceFactoryImpl.getName(context.getBundle()); - thMan = new ThreadPoolFactoryImpl(bundleName, log); - if (startup) - timeLog(3); /* 3 = "Creating Thread Pool service took " */ - - thManReg = context.registerService(new String[] {ThreadPoolManager.class.getName(), ThreadPoolFactory.class.getName()}, thMan, null); - if (startup) - timeLog(4); /* 4 = "Registering Thread Pool service took " */ - - timer = new TimerFactory(bundleName, thMan, log); - if (startup) - timeLog(33); /* 33 = "Creating Timer service took " */ - - int i = getInteger("equinox.util.threadpool.inactiveTime", 30); - timerReg = context.registerService(Timer.class, timer, null); - timer.addNotifyListener(ThreadPoolFactoryImpl.threadPool, Thread.NORM_PRIORITY, Timer.PERIODICAL_TIMER, (i * 1000L), 0); - - TimerRef.timer = timer; - - if (startup) - timeLog(5); /* 5 = "Registering Timer service took " */ - - if (startup) { - - /* - * 16 = "[END - start method] PutilActivator.start() method - * executed for " - */ - log.debug(0, 16, String.valueOf(time[0] - time[2]), null, false, true); - time = points = null; - } - - } catch (Throwable ee) { - ee.printStackTrace(); - System.out.println("log1: " + log); - log.error("[UtilActivator] An error has occurred while starting ProSyst Utility Bundle.", ee); - throw new BundleException("Error while starting ProSyst Utililty Bundle!", ee); - } - } - - /** - * This is implementation of BundleActivator stop method. This method - * unregisteres the thread pool, system, parser and timer services. - * - * @param bc - * The execution context of the bundle being stopped. - * @exception BundleException - * If this method throws an exception, the bundle is still - * marked as stopped and the framework will remove the - * bundle's listeners, unregister all service's registered by - * the bundle, release all service's used by the bundle. - */ - @Override - public void stop(BundleContext bc) throws BundleException { - try { - thManReg.unregister(); - - timerReg.unregister(); - TimerFactory.stopTimer(); - TimerRef.timer = timer = null; - - ThreadPoolFactoryImpl.stopThreadPool(); - thMan = null; - } catch (Throwable e) { - log.error("[UtilActivator] An error has occurred while stopping ProSyst Utility Bundle.", e); - throw new BundleException("Error while stopping ProSyst Utililty Bundle!", e); - } finally { - log.close(); - log = null; - } - } - - public static boolean getBoolean(String property) { - String prop = (bc != null) ? bc.getProperty(property) : System.getProperty(property); - return ((prop != null) && prop.equalsIgnoreCase("true")); - } - - public static int getInteger(String property, int defaultValue) { - String prop = (bc != null) ? bc.getProperty(property) : System.getProperty(property); - if (prop != null) { - try { - return Integer.decode(prop).intValue(); - } catch (NumberFormatException e) { - //do nothing - } - } - return defaultValue; - } - -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/EventThread.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/EventThread.java deleted file mode 100644 index 100e9f7a44..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/EventThread.java +++ /dev/null @@ -1,315 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.event; - -import java.security.AccessController; -import java.security.PrivilegedAction; -import org.eclipse.equinox.internal.util.UtilActivator; - -/** - * Abstract class for asynchronous event dispatching - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public abstract class EventThread implements Runnable { - - /** - * The last callbacked listener. If the events thread is not responding, - * subclasses can take the appropriate actions - remove the listener for - * example - */ - public Object bad; - - /** - * The event queue. This object must be used for synchronization with the - * events thread's state - */ - protected Queue queue; - - /** - * The state of the thread. - *
  • bit 0: 0 = started / 1 = stopped; - *
  • bit 1: 0 not waiting / 1 = waiting - */ - protected int state; - - /** - * The time spent in the current callback, or 0 if the thread is not in a - * callback - */ - protected long time = 0; - /** - * Instancies counter. Subclasses must not modify it. - */ - protected int counter = 1; - - /** - * The event to be dispatched - */ - protected Object element; - protected String baseName; - protected String name; - protected Thread thread; - protected ThreadGroup group; - private static PrivilegedActionImpl privilegedAction = null; - - /** - * Constructs the first instance of the EventThread - * - * @param group - * The ThreadGroup of the thread, or null for the current thread - * group - * @param name - * The base name of the thread. The counter value - * will be added at the end of the string to construct the full - * name. - * @param size - * The initial number of elements of the events queue - */ - public EventThread(ThreadGroup group, String name, int size) { - makeThread(this.group = group, this.name = name + '0'); - baseName = name; - queue = new Queue(size); - int priority = getThreadPriority(); - if (priority != Thread.NORM_PRIORITY) - thread.setPriority(priority); - } - - /** - * Constructs the first instance of the EventThread - * - * @param group - * The ThreadGroup of the thread, or null for the current thread - * group - * @param name - * The base name of the thread. The counter value - * will be added at the end of the string to construct the full - * name. - * @param queue - * The events queue - */ - public EventThread(ThreadGroup group, String name, Queue queue) { - makeThread(this.group = group, this.name = name + '0'); - baseName = name; - this.queue = queue; - int priority = getThreadPriority(); - if (priority != Thread.NORM_PRIORITY) - thread.setPriority(priority); - } - - /** - * Constructs a new EventThread, after the old event thread - * has stopped responding - * - * @param old - * The previous instance - */ - protected EventThread(EventThread old) { - makeThread(group = old.thread.getThreadGroup(), name = old.baseName + old.counter++); - baseName = old.baseName; - counter = old.counter; - queue = old.queue; - int priority = getThreadPriority(); - if (priority != Thread.NORM_PRIORITY) - thread.setPriority(priority); - } - - public void start() { - thread.start(); - } - - /** - * Adds an event in the event queue. The method must be synchronized - * outside, on the queue field. - * - * @param event - * The event to add - * @param check - * If true, the method will check if the EventThread is still - * responding - */ - public void addEvent(Object event, boolean check) { - try { - queue.put(event); - } catch (Throwable t) { - print(t); - return; - } - if ((state & 2) != 0) - queue.notify(); - else if (check && checkTime()) - try { - state |= 1; - newEventDispatcher(); // must call start - } catch (Throwable t) { - print(t); - state &= 254; - } - } - - /** - * Processes the event queue. Sets the event to be dispathed in the - * element field and calls processEvent - */ - @Override - public void run() { - synchronized (queue) { - queue.notifyAll(); - } - while (true) { - try { - synchronized (queue) { - if ((state & 1) != 0) - return; // closed - while ((element = queue.get()) == null) - try { - state |= 2; // waiting - queue.wait(); - if ((state & 1) != 0) - return; // closed - state &= 253; // not waiting - } catch (InterruptedException ie) { - } - } - processEvent(); - - } catch (Throwable t) { - print(t); - try { // fix memory leak - throw new Exception(); - } catch (Exception _) { - } - } - } - } - - private void makeThread(ThreadGroup threadGroup, String threadName) { - try { - if (privilegedAction == null) { - privilegedAction = new PrivilegedActionImpl(); - } - privilegedAction.set(threadGroup, this, threadName); - thread = AccessController.doPrivileged(privilegedAction); - // thread = new Thread(group, this, name); - // thread.setDaemon(false); - // if (!disableContextClassLoader) - // thread.setContextClassLoader(null); - } catch (RuntimeException re) { - throw re; - } catch (Exception exc) { - throw new RuntimeException(exc.toString()); - } - } - - public Thread getThread() { - return thread; - } - - public String getName() { - return name; - } - - /** - * Returns the desired thread priority. Called in the constructors of the - * class in order to set the returned value to the thread. - * - * @return priority of the thread - */ - public abstract int getThreadPriority(); - - /** - * Performs the actual event delivery. The event is stored in the - * element field. The method is supposed to perform the - * following for every listener: - *
  • synchronized on queue check the state of the thread - - * if it si closed - return - *
  • set the fields bad and time - *
  • callback - *
  • set bad to null and time to 0 - */ - public abstract void processEvent(); - - /** - * Checks if the thread is still active. The fields time and - * bad must be used. The method is called from the addEvent - * method - thus should be synchronizes on the queue field - * outside and additional synchronization is not needed. - */ - public abstract boolean checkTime(); - - /** - * The method must create a new EventThread instance, using - * super.EventThread(this) and start it. - */ - public abstract void newEventDispatcher(); - - /** - * Logs the error. - * - * @param t - */ - public abstract void print(Throwable t); -} - -class PrivilegedActionImpl implements PrivilegedAction { - private ThreadGroup group; - private Runnable runnable; - private String name; - - private boolean locked = false; - private int waiting = 0; - - void set(ThreadGroup group, Runnable runnable, String name) { - lock(); - this.group = group; - this.runnable = runnable; - this.name = name; - } - - @Override - public Thread run() { - ThreadGroup group1 = this.group; - Runnable runnable1 = this.runnable; - String name1 = this.name; - unlock(); - Thread th = new Thread(group1, runnable1, name1); - if (!UtilActivator.getBoolean("equinox.disableContextClassLoader")) //$NON-NLS-1$ - th.setContextClassLoader(null); - th.setDaemon(false); - return th; - } - - private synchronized void lock() { - while (locked) - try { - waiting++; - wait(); - waiting--; - } catch (Exception exc) { - } - locked = true; - } - - private synchronized void unlock() { - locked = false; - group = null; - runnable = null; - name = null; - if (waiting > 0) - notifyAll(); - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/Queue.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/Queue.java deleted file mode 100644 index 4ec3772e8d..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/Queue.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ - -package org.eclipse.equinox.internal.util.event; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class Queue { - - protected Object[] queue; - protected int first, last = -1; - protected int initial, count; - protected int increment; - protected int decrement; - - public Queue(int size) { - queue = new Object[initial = size]; - increment = initial / 2; - decrement = increment + (increment / 2); - } - - public void put(Object element) { - if (count == queue.length) - resize(true); - queue[++last == queue.length ? last = 0 : last] = element; - count++; - } - - public void unget(Object element) { - if (count == queue.length) - resize(true); - queue[--first == -1 ? first = queue.length - 1 : first] = element; - count++; - } - - public Object get() { - if (count == 0) - return null; - if (queue.length > initial && queue.length - count > decrement) - resize(false); - Object element = queue[first]; - queue[first++] = null; - if (first == queue.length) - first = 0; - count--; - return element; - } - - public void clear() { - if (queue.length > initial) { - queue = new Object[initial]; - count = 0; - } else - for (; count > 0; count--) { - queue[first++] = null; - if (first == queue.length) - first = 0; - } - first = 0; - last = -1; - } - - public int size() { - return count; - } - - protected void resize(boolean up) { - Object[] tmp = new Object[queue.length + (up ? increment : -increment)]; - if (first <= last) - System.arraycopy(queue, first, tmp, 0, count); - else { - int count1 = queue.length - first; - if (count1 > 0) - System.arraycopy(queue, first, tmp, 0, count1); - if (count > count1) - System.arraycopy(queue, 0, tmp, count1, count - count1); - } - queue = tmp; - first = 0; - last = count - 1; - - increment = queue.length / 2; - decrement = increment + (increment / 2); - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/SystemListener.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/SystemListener.java deleted file mode 100644 index 468a882c05..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/SystemListener.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.event; - -/** - * This interface marks any listener implementation as system listener. System - * listener are very important for the correct functionality of the system. When - * the execution of user implemented listener's methods is too slow this - * listener is presumed as "bad" listener and it is removed automatically by the - * framework unless it is implementing the SystemListener interface. Instead of - * removing it automatically as a bad listener, the system dispatchers will - * notify the listener by calling timeoutOccured(). - * - * @author Stoyan Boshev - * @author Pavlin Dobrev - * @version 1.0 - * - */ -public interface SystemListener { - - /** - * Notifies the listener that a timeout has occured while processing one of - * its methods. The listeners logic may decide whether it has to be removed - * as listener or not - * - * @return true, if the listener has to be removed from the list of - * listeners - */ - public boolean timeoutOccured(); - -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/package.html b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/package.html deleted file mode 100644 index ef2d0dda5b..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/package.html +++ /dev/null @@ -1 +0,0 @@ -

    This package provides APIs for event dispatching.

    Bundles wishing to use this package must list the package in the Import-Package header of the bundle's manifest. For example:

    Import-Package: org.eclipse.equinox.util.framework.event; specification-version=1.0
    
    \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashIntObjNS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashIntObjNS.java deleted file mode 100644 index 81b5e16e99..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashIntObjNS.java +++ /dev/null @@ -1,276 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.hash; - -/** - * Hashtable for mapping int keys to Object values. The methods of this - * hashtable are not synchronized, and if used concurently must be externally - * synchronized - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class HashIntObjNS { - - static final float LOAD_FACTOR = 0.75f; - - // count of elements available in table - private int count = 0; - // used for computation of next position - private int step = 499979; - - /** - * Used to enumerate the keys in the hash table. The key at index - * i is valid only if - *
      - * values[i] != null - *
    - */ - public int[] keys; - - /** - * Used to enumerate the values in the hash table. The value at index - * i is valid only if - *
      - * values[i] != null - *
    - */ - public Object[] values; - - /** - * Can be used to check if a key or value is valid. The value or key at - * index i is valid if the following expression is true - *
      - * next[i] != -1 && next[i] < next.length - *
    - */ - public int[] next; - - private int limit; - private double loadFactor; - - /** - * Constructs an empty hash table with keys of type int and values af type - * Object. Uses default load factor (0.75) and default capacity (89) - * - */ - public HashIntObjNS() { - this(101, LOAD_FACTOR); - } - - /** - * Constructs an empty hash table with keys of type int and values af type - * Object. Uses default load factor (0.75). - * - * @param capacity - * initial capacity of the table - * - * @exception IllegalArgumentException - * if capacity < 1. - */ - public HashIntObjNS(int capacity) { - this(capacity, LOAD_FACTOR); - } - - /** - * Constructs an empty hash table with keys of type int and values of type - * Object. - * - * @param capacity - * initial capacity of the table - * @param lf - * load factor ot the table - * - * @exception IllegalArgumentException - * if capacity < 1 or lf < 0.0 - */ - public HashIntObjNS(int capacity, double lf) { - if (capacity < 0) { - throw new IllegalArgumentException("Invalid hashtable capacity: " + capacity + "."); - } - - if (capacity == 0) - capacity = 101; - - if (lf < 0) { - throw new IllegalArgumentException("Invalid load factor: " + lf + "."); - } - - if (lf > 1.0) { - lf = 1.0; - } - loadFactor = lf; - limit = (int) (capacity * lf); - count = 0; - - keys = new int[capacity]; - values = new Object[capacity]; - next = new int[capacity]; - for (int i = 0; i < capacity; i++) { - keys[i] = 0; - next[i] = -1; - } - } - - /** - * Adds in the hashtable an element with key key and - * value value. If an element with the specified key is - * already in the table only change it's value. - * - * @param key - * the key of the inserted element - * @param value - * the value of the inserted element - */ - public void put(int key, Object value) { - if (count >= limit) { - rehash(); - } - if (_put(key, value)) { - count++; - } - } - - /** - * Returns an value which is mapped to the key key. - * - * @param key - * the key we are searching for - * @return the value this key is mapped to in the table, or null - */ - public Object get(int key) { - int pos = find(key); - return (pos == -1) ? null : values[pos]; - } - - /** - * Removes an element with the specified key from the table. Does nothing if - * there is no element with this key. - * - * @param key - * the key of the element we want to remove - * @return the removed value, or null if there was nothing to remove - */ - public Object remove(int key) { - int pos = find(key); - if (pos == -1) - return null; - next[pos] += next.length; // mark this field as empty - count--; - Object tmp = values[pos]; - values[pos] = null; - return tmp; - } - - /** - * Empties the hash table - */ - public void removeAll() { - for (int i = 0; i < values.length; i++) { - values[i] = null; - keys[i] = 0; - next[i] = -1; - } - count = 0; - } - - /** - * Rehashes the contents of the hashtable into a hashtable with a larger - * capacity. This method is called automatically when the number of keys in - * the hashtable exceeds this hashtable's capacity and load factor. - */ - public void rehash() { - int[] tmpKeys = keys; - Object[] tmpValues = values; - int[] tmpNext = next; - - int capacity = keys.length * 2 + 1; - - // polzwame temp array-i za da ne se namaje hashtable-a pri OutOfMemory - int[] keys = new int[capacity]; - Object[] values = new Object[capacity]; - int[] next = new int[capacity]; - for (int i = 0; i < next.length; i++) { - next[i] = -1; - } - - this.keys = keys; - this.values = values; - this.next = next; - - for (int i = 0; i < tmpNext.length; i++) { - if ((tmpNext[i] >= 0) && (tmpNext[i] < tmpNext.length)) { - _put(tmpKeys[i], tmpValues[i]); - } - } - - limit = (int) (capacity * loadFactor); - } - - /** - * Returns the count of elements currently in the table - * - * @return the count of elements - */ - public int size() { - return count; - } - - private int find(int key) { - int pos = (key & 0x7fffffff) % keys.length; - int i = 0; - - while (next[pos] >= 0) { - if (keys[pos] == key) { - if (next[pos] < next.length) { - return pos; - } - } - if ((pos = next[pos]) >= next.length) { - pos -= next.length; - } - if (++i > next.length) { - return -1; - } - } - - return -1; - } // find - - private boolean _put(int key, Object value) { - int index = find(key); - if (index != -1) { - values[index] = value; - return false; - } - - int pos = (key & 0x7fffffff) % keys.length; - - while ((next[pos] >= 0) && (next[pos] < next.length)) { - pos = next[pos]; - } - - keys[pos] = key; - values[pos] = value; - if (next[pos] < 0) { - next[pos] = (pos + step) % next.length; - } else { - next[pos] -= next.length; - } - return true; - } // _put - -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashIntObjS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashIntObjS.java deleted file mode 100644 index 54c41defcc..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashIntObjS.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.hash; - -/** - * Synchronized extension of org.eclipse.equinox.internal.util.hash.HashIntObjNS - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public final class HashIntObjS extends HashIntObjNS { - - public HashIntObjS() { - super(101, LOAD_FACTOR); - } - - public HashIntObjS(int capacity) { - super(capacity, LOAD_FACTOR); - } - - public HashIntObjS(int capacity, double lf) { - super(capacity, lf); - } - - @Override - public synchronized void put(int key, Object value) { - super.put(key, value); - } - - @Override - public synchronized Object get(int key) { - return super.get(key); - } - - @Override - public synchronized Object remove(int key) { - return super.remove(key); - } - - @Override - public synchronized int size() { - return super.size(); - } - - @Override - public synchronized void removeAll() { - super.removeAll(); - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashLongObjNS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashLongObjNS.java deleted file mode 100644 index 9f72d430da..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashLongObjNS.java +++ /dev/null @@ -1,276 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.hash; - -/** - * Hashtable for mapping long keys to Object values. The methods of this - * hashtable are not synchronized, and if used concurently must be externally - * synchronized - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class HashLongObjNS { - - static final float LOAD_FACTOR = 0.75f; - - // count of elements available in table - private int count = 0; - // used for computation of next position - private int step = 499979; - - /** - * Used to enumerate the keys in the hash table. The key at index - * i is valid only if - *
      - * values[i] != null - *
    - */ - public long[] keys; - - /** - * Used to enumerate the values in the hash table. The value at index - * i is valid only if - *
      - * values[i] != null - *
    - */ - public Object[] values; - - /** - * Can be used to check if a key or value is valid. The value or key at - * index i is valid if the following expression is true - *
      - * next[i] != -1 && next[i] < next.length - *
    - */ - public int[] next; - - private int limit; - private double loadFactor; - - /** - * Constructs an empty hash table with keys of type long and values af type - * int. Uses default load factor (0.75) and default capacity (89) - * - */ - public HashLongObjNS() { - this(101, LOAD_FACTOR); - } - - /** - * Constructs an empty hash table with keys of type long and values af type - * int. Uses default load factor (0.75). - * - * @param capacity - * initial capacity of the table - * - * @exception IllegalArgumentException - * if capacity < 1. - */ - public HashLongObjNS(int capacity) { - this(capacity, LOAD_FACTOR); - } - - /** - * Constructs an empty hash table with keys of type long and values of type - * int. - * - * @param capacity - * initial capacity of the table - * @param lf - * load factor ot the table - * - * @exception IllegalArgumentException - * if capacity < 1 or lf < 0.0 - */ - public HashLongObjNS(int capacity, double lf) { - if (capacity < 0) { - throw new IllegalArgumentException("Invalid hashtable capacity: " + capacity + "."); - } - - if (capacity == 0) - capacity = 101; - - if (lf < 0) { - throw new IllegalArgumentException("Invalid load factor: " + lf + "."); - } - - if (lf > 1.0) { - lf = 1.0; - } - loadFactor = lf; - limit = (int) (capacity * lf); - count = 0; - - keys = new long[capacity]; - values = new Object[capacity]; - next = new int[capacity]; - for (int i = 0; i < capacity; i++) { - keys[i] = 0; - next[i] = -1; - } - } - - /** - * Adds in hashtable an element with key key and - * value value. If an element with the specified key is - * already in the table only change it's value. - * - * @param key - * the key of the inserted element - * @param value - * the value of the inserted element - */ - public void put(long key, Object value) { - if (count >= limit) { - rehash(); - } - if (_put(key, value)) { - count++; - } - } - - /** - * Returns an value which is mapped to the key key. - * - * @param key - * the key we are searching for - * @return the value this key is mapped to in the table, or null - */ - public Object get(long key) { - int pos = find(key); - return (pos == -1) ? null : values[pos]; - } - - /** - * Removes an element with the specified key from the table. Does nothing if - * there is no element with this key. - * - * @param key - * the key of the element we want to remove - * @return the removed value, or null if there was nothing to remove - */ - public Object remove(long key) { - int pos = find(key); - if (pos == -1) - return null; - next[pos] += next.length; // mark this field as empty - count--; - Object tmp = values[pos]; - values[pos] = null; - return tmp; - } - - /** - * Empties the hash table - */ - public void removeAll() { - for (int i = 0; i < values.length; i++) { - values[i] = null; - keys[i] = 0; - next[i] = -1; - } - count = 0; - } - - /** - * Rehashes the contents of the hashtable into a hashtable with a larger - * capacity. This method is called automatically when the number of keys in - * the hashtable exceeds this hashtable's capacity and load factor. - */ - public void rehash() { - long[] tmpKeys = keys; - Object[] tmpValues = values; - int[] tmpNext = next; - - int capacity = keys.length * 2 + 1; - - // polzwame temp array-i za da ne se namaje hashtable-a pri OutOfMemory - long[] keys = new long[capacity]; - Object[] values = new Object[capacity]; - int[] next = new int[capacity]; - for (int i = 0; i < next.length; i++) { - next[i] = -1; - } - - this.keys = keys; - this.values = values; - this.next = next; - - for (int i = 0; i < tmpNext.length; i++) { - if ((tmpNext[i] >= 0) && (tmpNext[i] < tmpNext.length)) { - _put(tmpKeys[i], tmpValues[i]); - } - } - - limit = (int) (capacity * loadFactor); - } - - /** - * Returns the count of elements currently in the table - * - * @return the count of elements - */ - public int size() { - return count; - } - - private int find(long key) { - int pos = (int) (key & 0x7fffffff) % keys.length; - int i = 0; - - while (next[pos] >= 0) { - if (keys[pos] == key) { - if (next[pos] < next.length) { - return pos; - } - } - if ((pos = next[pos]) >= next.length) { - pos -= next.length; - } - if (++i > next.length) { - return -1; - } - } - - return -1; - } // find - - private boolean _put(long key, Object value) { - int index = find(key); - if (index != -1) { - values[index] = value; - return false; - } - - int pos = (int) (key & 0x7fffffff) % keys.length; - - while ((next[pos] >= 0) && (next[pos] < next.length)) { - pos = next[pos]; - } - - keys[pos] = key; - values[pos] = value; - if (next[pos] < 0) { - next[pos] = (pos + step) % next.length; - } else { - next[pos] -= next.length; - } - return true; - } // _put - -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashLongObjS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashLongObjS.java deleted file mode 100644 index c026af8d53..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashLongObjS.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.hash; - -/** - * Synchronized extension of org.eclipse.equinox.internal.util.hash.HashLongObjNS - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public final class HashLongObjS extends HashLongObjNS { - - public HashLongObjS() { - super(101, LOAD_FACTOR); - } - - public HashLongObjS(int capacity) { - super(capacity, LOAD_FACTOR); - } - - public HashLongObjS(int capacity, double lf) { - super(capacity, lf); - } - - @Override - public synchronized void put(long key, Object value) { - super.put(key, value); - } - - @Override - public synchronized Object get(long key) { - return super.get(key); - } - - @Override - public synchronized Object remove(long key) { - return super.remove(key); - } - - @Override - public synchronized int size() { - return super.size(); - } - - @Override - public synchronized void removeAll() { - super.removeAll(); - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjIntNS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjIntNS.java deleted file mode 100644 index 8cc336d660..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjIntNS.java +++ /dev/null @@ -1,298 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.hash; - -import java.util.NoSuchElementException; - -/** - * Hashtable for mapping Object keys to int values. The methods of this - * hashtable are not synchronized, and if used concurently must be externally - * synchronized - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class HashObjIntNS { - - static final float LOAD_FACTOR = 0.75f; - - // count of elements available in table - private int count = 0; - // used for computation of next position - private int step = 499979; - - /** - * Used to enumerate the keys in the hash table. The key at index - * i is valid only if - *
      - * keys[i] != null - *
    - */ - public Object[] keys; - - /** - * Used to enumerate the values in the hash table. The value at index - * i is valid only if - *
      - * keys[i] != null - *
    - */ - public int[] values; - - /** - * Can be used to check if a key or value is valid. The value or key at - * index i is valid if the following expression is true - *
      - * next[i] != -1 && next[i] < next.length - *
    - */ - public int[] next; - - private int limit; - private double loadFactor; - - /** - * Constructs an empty hash table with keys of type int and values af type - * Object. Uses default load factor (0.75) and default capacity (89) - * - */ - public HashObjIntNS() { - this(101, LOAD_FACTOR); - } - - /** - * Constructs an empty hash table with keys of type int and values af type - * Object. Uses default load factor (0.75). - * - * @param capacity - * initial capacity of the table - * - * @exception IllegalArgumentException - * if capacity < 1. - */ - public HashObjIntNS(int capacity) { - this(capacity, LOAD_FACTOR); - } - - /** - * Constructs an empty hash table with keys of type int and values of type - * Object. - * - * @param capacity - * initial capacity of the table - * @param lf - * load factor ot the table - * - * @exception IllegalArgumentException - * if capacity < 1 or lf < 0.0 - */ - public HashObjIntNS(int capacity, double lf) { - if (capacity < 0) { - throw new IllegalArgumentException("Invalid hashtable capacity: " + capacity + "."); - } - - if (capacity == 0) - capacity = 101; - - if (lf < 0) { - throw new IllegalArgumentException("Invalid load factor: " + lf + "."); - } - - if (lf > 1.0) { - lf = 1.0; - } - loadFactor = lf; - limit = (int) (capacity * lf); - count = 0; - - keys = new Object[capacity]; - values = new int[capacity]; - next = new int[capacity]; - for (int i = 0; i < capacity; i++) { - next[i] = -1; - } - } - - /** - * Adds in hashtable an element with key key and - * value value. If an element with the specified key is - * already in the table only change it's value. - * - * @param key - * the key of the inserted element - * @param value - * the value of the inserted element - */ - public void put(Object key, int value) { - if (count >= limit) { - rehash(); - } - if (_put(key, value)) { - count++; - } - } - - /** - * Returns an value which is mapped to the key key. If there - * is no such a key, throws NoSuchElementException. - * - * @param key - * the key we are searching for - * @return the value this key is mapped to in the table. - * - * @exception NoSuchElementException - * if there is no element with the specified key. - */ - public int get(Object key) { - int pos = find(key); - if (pos == -1) - throw new NoSuchElementException(); - return values[pos]; - } - - /** - * Removes an element with the specified key from the table. throws - * NoSuchElementException if there is no element with this - * key. - * - * @param key - * the key of the element we want to remove - * @exception NoSuchElementException - * if there is no element with the specified key. - */ - public int remove(Object key) { - int pos = find(key); - if (pos == -1) - throw new NoSuchElementException(); - next[pos] += next.length; // mark this field as empty - count--; - keys[pos] = null; - return values[pos]; - } - - /** - * Empties the hash table - */ - public void removeAll() { - for (int i = 0; i < values.length; i++) { - keys[i] = null; - next[i] = -1; - } - } - - /** - * Rehashes the contents of the hashtable into a hashtable with a larger - * capacity. This method is called automatically when the number of keys in - * the hashtable exceeds this hashtable's capacity and load factor. - */ - public void rehash() { - Object[] tmpKeys = keys; - int[] tmpValues = values; - int[] tmpNext = next; - - int capacity = keys.length * 2 + 1; - - // polzwame temp array-i za da ne se namaje hashtable-a pri OutOfMemory - Object[] keys = new Object[capacity]; - int[] values = new int[capacity]; - int[] next = new int[capacity]; - for (int i = 0; i < next.length; i++) { - next[i] = -1; - } - - this.keys = keys; - this.values = values; - this.next = next; - - for (int i = 0; i < tmpNext.length; i++) { - if ((tmpNext[i] >= 0) && (tmpNext[i] < tmpNext.length)) { - _put(tmpKeys[i], tmpValues[i]); - } - } - - limit = (int) (capacity * loadFactor); - } - - /** - * Returns the count of elements currently in the table - * - * @return the count of elements - */ - public int size() { - return count; - } - - public Object[] getKeys() { - return keys; - } - - private int find(Object key) { - return find(key, (key.hashCode() & 0x7fffffff) % keys.length); - } // find - - private int find(Object key, int pos) { - int i = 0; - - // System.out.println("In Zarko's code"); - // - // if (key == null) - // System.out.println("key is null"); - // - while (next[pos] >= 0) { - - if (keys[pos] != null) { - // System.out.println("is null"); - - if (key.equals(keys[pos])) { - if (next[pos] < next.length) { - return pos; - } - } - } - if ((pos = next[pos]) >= next.length) { - pos -= next.length; - } - if (++i > next.length) { - return -1; - } - } - - return -1; - } - - private boolean _put(Object key, int value) { - int pos = (key.hashCode() & 0x7fffffff) % keys.length; - int index = find(key, pos); - if (index != -1) { - values[index] = value; - return false; - } - - while ((next[pos] >= 0) && (next[pos] < next.length)) { - pos = next[pos]; - } - - keys[pos] = key; - values[pos] = value; - if (next[pos] < 0) { - next[pos] = (pos + step) % next.length; - } else { - next[pos] -= next.length; - } - return true; - } // _put - -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjIntS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjIntS.java deleted file mode 100644 index 95f07f8830..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjIntS.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.hash; - -/** - * Synchronized extension of org.eclipse.equinox.internal.util.hash.HashObjIntNS - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public final class HashObjIntS extends HashObjIntNS { - - public HashObjIntS() { - super(101, LOAD_FACTOR); - } - - public HashObjIntS(int capacity) { - super(capacity, LOAD_FACTOR); - } - - public HashObjIntS(int capacity, double lf) { - super(capacity, lf); - } - - @Override - public synchronized void put(Object key, int value) { - super.put(key, value); - } - - @Override - public synchronized int get(Object key) { - return super.get(key); - } - - @Override - public synchronized int remove(Object key) { - return super.remove(key); - } - - @Override - public synchronized int size() { - return super.size(); - } - - @Override - public synchronized void removeAll() { - super.removeAll(); - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjLongNS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjLongNS.java deleted file mode 100644 index bb411959ec..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjLongNS.java +++ /dev/null @@ -1,284 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.hash; - -import java.util.NoSuchElementException; - -/** - * Hashtable for mapping Object keys to long values. The methods of this - * hashtable are not synchronized, and if used concurently must be externally - * synchronized - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class HashObjLongNS { - - static final float LOAD_FACTOR = 0.75f; - - // count of elements available in table - private int count = 0; - // used for computation of next position - private int step = 499979; - - /** - * Used to enumerate the keys in the hash table. The key at index - * i is valid only if - *
      - * keys[i] != null - *
    - */ - public Object[] keys; - - /** - * Used to enumerate the values in the hash table. The value at index - * i is valid only if - *
      - * keys[i] != null - *
    - */ - public long[] values; - - /** - * Can be used to check if a key or value is valid. The value or key at - * index i is valid if the following expression is true - *
      - * next[i] != -1 && next[i] < next.length - *
    - */ - public int[] next; - - private int limit; - private double loadFactor; - - /** - * Constructs an empty hash table with keys of type int and values af type - * Object. Uses default load factor (0.75) and default capacity (89) - * - */ - public HashObjLongNS() { - this(101, LOAD_FACTOR); - } - - /** - * Constructs an empty hash table with keys of type int and values af type - * Object. Uses default load factor (0.75). - * - * @param capacity - * initial capacity of the table - * - * @exception IllegalArgumentException - * if capacity < 1. - */ - public HashObjLongNS(int capacity) { - this(capacity, LOAD_FACTOR); - } - - /** - * Constructs an empty hash table with keys of type int and values of type - * Object. - * - * @param capacity - * initial capacity of the table - * @param lf - * load factor ot the table - * - * @exception IllegalArgumentException - * if capacity < 1 or lf < 0.0 - */ - public HashObjLongNS(int capacity, double lf) { - if (capacity < 0) { - throw new IllegalArgumentException("Invalid hashtable capacity: " + capacity + "."); - } - - if (capacity == 0) - capacity = 101; - - if (lf < 0) { - throw new IllegalArgumentException("Invalid load factor: " + lf + "."); - } - - if (lf > 1.0) { - lf = 1.0; - } - loadFactor = lf; - limit = (int) (capacity * lf); - count = 0; - - keys = new Object[capacity]; - values = new long[capacity]; - next = new int[capacity]; - for (int i = 0; i < capacity; i++) { - next[i] = -1; - } - } - - /** - * Adds in hashtable an element with key key and - * value value. If an element with the specified key is - * already in the table only change it's value. - * - * @param key - * the key of the inserted element - * @param value - * the value of the inserted element - */ - public void put(Object key, long value) { - if (count >= limit) { - rehash(); - } - if (_put(key, value)) { - count++; - } - } - - /** - * Returns an value which is mapped to the key key. If there - * is no such a key, throws NoSuchElementException. - * - * @param key - * the key we are searching for - * @return the value this key is mapped to in the table. - * - * @exception NoSuchElementException - * if there is no element with the specified key. - */ - public long get(Object key) { - int pos = find(key); - if (pos == -1) - throw new NoSuchElementException(); - return values[pos]; - } - - /** - * Removes an element with the specified key from the table. throws - * NoSuchElementException if there is no element with this - * key. - * - * @param key - * the key of the element we want to remove - * @exception NoSuchElementException - * if there is no element with the specified key. - */ - public long remove(Object key) { - int pos = find(key); - if (pos == -1) - throw new NoSuchElementException(); - next[pos] += next.length; // mark this field as empty - keys[pos] = null; - count--; - return values[pos]; - } - - /** - * Empties the hash table - */ - public void removeAll() { - for (int i = 0; i < values.length; i++) { - keys[i] = null; - next[i] = -1; - } - } - - /** - * Rehashes the contents of the hashtable into a hashtable with a larger - * capacity. This method is called automatically when the number of keys in - * the hashtable exceeds this hashtable's capacity and load factor. - */ - public void rehash() { - Object[] tmpKeys = keys; - long[] tmpValues = values; - int[] tmpNext = next; - - int capacity = keys.length * 2 + 1; - - // polzwame temp array-i za da ne se namaje hashtable-a pri OutOfMemory - Object[] keys = new Object[capacity]; - long[] values = new long[capacity]; - int[] next = new int[capacity]; - for (int i = 0; i < next.length; i++) { - next[i] = -1; - } - - this.keys = keys; - this.values = values; - this.next = next; - - for (int i = 0; i < tmpNext.length; i++) { - if ((tmpNext[i] >= 0) && (tmpNext[i] < tmpNext.length)) { - _put(tmpKeys[i], tmpValues[i]); - } - } - - limit = (int) (capacity * loadFactor); - } - - /** - * Returns the count of elements currently in the table - * - * @return the count of elements - */ - public int size() { - return count; - } - - private int find(Object key) { - return find(key, (key.hashCode() & 0x7fffffff) % keys.length); - } // find - - private int find(Object key, int pos) { - int i = 0; - - while (next[pos] >= 0) { - if (key.equals(keys[pos])) { - if (next[pos] < next.length) { - return pos; - } - } - if ((pos = next[pos]) >= next.length) { - pos -= next.length; - } - if (++i > next.length) { - return -1; - } - } - - return -1; - } - - private boolean _put(Object key, long value) { - int pos = (key.hashCode() & 0x7fffffff) % keys.length; - int index = find(key, pos); - if (index != -1) { - values[index] = value; - return false; - } - - while ((next[pos] >= 0) && (next[pos] < next.length)) { - pos = next[pos]; - } - - keys[pos] = key; - values[pos] = value; - if (next[pos] < 0) { - next[pos] = (pos + step) % next.length; - } else { - next[pos] -= next.length; - } - return true; - } // _put - -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjLongS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjLongS.java deleted file mode 100644 index a6934fcc17..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjLongS.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.hash; - -/** - * Synchronized extension of org.eclipse.equinox.internal.util.hash.HashObjLongNS - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public final class HashObjLongS extends HashObjLongNS { - - public HashObjLongS() { - super(101, LOAD_FACTOR); - } - - public HashObjLongS(int capacity) { - super(capacity, LOAD_FACTOR); - } - - public HashObjLongS(int capacity, double lf) { - super(capacity, lf); - } - - @Override - public synchronized void put(Object key, long value) { - super.put(key, value); - } - - @Override - public synchronized long get(Object key) { - return super.get(key); - } - - @Override - public synchronized long remove(Object key) { - return super.remove(key); - } - - @Override - public synchronized int size() { - return super.size(); - } - - @Override - public synchronized void removeAll() { - super.removeAll(); - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/package.html b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/package.html deleted file mode 100644 index 9f23940ea4..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/package.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -org.eclipse.equinox.util.hash - - -

    Provides hashing utilities among which are several Hashtables accepting primitive data types for keys or values.

    - - diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/ServiceFactoryImpl.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/ServiceFactoryImpl.java deleted file mode 100644 index 3aceab3fef..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/ServiceFactoryImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ - -package org.eclipse.equinox.internal.util.impl.tpt; - -import org.eclipse.equinox.internal.util.UtilActivator; -import org.eclipse.equinox.internal.util.ref.Log; -import org.osgi.framework.*; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public abstract class ServiceFactoryImpl implements ServiceFactory { - - public String bundleName; - public static Log log; - - private static Bundle systemBundle = null; - static { - try { - systemBundle = UtilActivator.bc.getBundle(0); - } catch (Exception e) { - } - } - static boolean emptyStorage; - - private static boolean security = Log.security(); - - public static boolean privileged() { - emptyStorage = UtilActivator.bc.getProperty("equinox.storage.empty") != null; - return ((systemBundle.getState() != Bundle.STARTING) || emptyStorage) && security; - } - - public static boolean useNames = true; - static String suseNames; - - public ServiceFactoryImpl(String bundleName, Log log) { - this.bundleName = bundleName; - ServiceFactoryImpl.log = log; - - String tmp = UtilActivator.bc.getProperty("equinox.util.threadpool.useNames"); - if (suseNames != tmp) - useNames = tmp == null || !tmp.equals("false"); - } - - public ServiceFactoryImpl(String bundleName) { - this.bundleName = bundleName; - } - - @Override - public T getService(Bundle caller, ServiceRegistration sReg) { - return getInstance(useNames ? getName(caller) : null); - } - - public static String getName(Bundle caller) { - StringBuilder bf = new StringBuilder(13); - bf.append(" (Bundle "); - bf.append(caller.getBundleId()); - bf.append(')'); - return bf.toString(); - } - - /** - * Nothing to be done here. - * - * @param caller - * caller bundle, which releases the factory instance - * @param sReg - * @param service - * object that is released - */ - @Override - public void ungetService(Bundle caller, ServiceRegistration sReg, T service) { - } - - public abstract T getInstance(String bundleName); -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/Executor.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/Executor.java deleted file mode 100644 index c7d1e52556..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/Executor.java +++ /dev/null @@ -1,157 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ - -package org.eclipse.equinox.internal.util.impl.tpt.threadpool; - -import java.security.*; -import org.eclipse.equinox.internal.util.UtilActivator; -import org.eclipse.equinox.internal.util.impl.tpt.ServiceFactoryImpl; -import org.eclipse.equinox.internal.util.threadpool.ThreadContext; - -/** - * @author Pavlin Dobrev - */ -public class Executor extends Thread implements ThreadContext { - - public static final String iname = "[ThreadPool Manager] - Idle Thread"; - public static final String nullname = "[ThreadPool Manager] - Occupied Thread "; - public static final String xname = "ThreadPool Manager Thread"; - - ThreadPoolFactoryImpl factory; - boolean accessed = false; - - private Runnable job = null; - - private boolean terminated = false; - - AccessControlContext acc; - PEA pea; - static ClassLoader defaultTCCL; - - static { - defaultTCCL = Thread.currentThread().getContextClassLoader(); - } - - public synchronized void setRunnable(Runnable job, String name, ThreadPoolFactoryImpl factory, AccessControlContext acc) { - this.job = job; - this.factory = factory; - - if (ServiceFactoryImpl.useNames) - setName(name == null ? nullname : name); - - this.acc = acc; - - notify(); - } - - @Override - public void run() { - while (!terminated) { - if (job != null) { - try { - if (UtilActivator.debugLevel == 2 && UtilActivator.LOG_DEBUG) { - UtilActivator.log.debug(0x0100, 10003, getName(), null, false); - } - accessed = true; - if (acc != null) { - if (pea == null) - pea = new PEA(); - pea.job = job; - AccessController.doPrivileged(pea, acc); - } else - job.run(); - } catch (Throwable t) { - try { // fix memory leak - throw new Exception(); - } catch (Exception _) { - } - if (ServiceFactoryImpl.log != null) { - ServiceFactoryImpl.log.error("[ThreadPool Manager]\r\nException while executing: \r\nNAME: " + this + "\r\nJOB: " + job + "\r\n", t); - } - - } finally { - if (getContextClassLoader() != defaultTCCL) { - setContextClassLoader(defaultTCCL); - } - } - if (UtilActivator.debugLevel == 2 && UtilActivator.LOG_DEBUG) { - UtilActivator.log.debug(0x0100, 10004, getName(), null, false); - } - job = null; - if (ServiceFactoryImpl.useNames) - setName(iname); - if (ThreadPoolManagerImpl.threadPool == null || (!ThreadPoolManagerImpl.threadPool.releaseObject(this))) { - terminated = true; - continue; - } - } - - if (this.job != null) { - continue; - } - synchronized (this) { - if (this.job != null || terminated) { - continue; - } - - try { - wait(); - } catch (InterruptedException ie) { - } - } - } - - clear(); - } - - void clear() { - job = null; - } - - public synchronized void terminate() { - terminated = true; - notify(); - } - - public Executor() { - super(ServiceFactoryImpl.useNames ? iname : xname); - if (getContextClassLoader() != defaultTCCL) { - setContextClassLoader(defaultTCCL); - } - start(); - } - - @Override - public Runnable getRunnable() { - return job; - } - - public void setPriorityI(int p) { - if (this.getPriority() != p) { - setPriority(p); - } - } -} - -class PEA implements PrivilegedAction { - - Runnable job; - - @Override - public Object run() { - job.run(); - return null; - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/Job.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/Job.java deleted file mode 100644 index d8fee4b47e..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/Job.java +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ - -package org.eclipse.equinox.internal.util.impl.tpt.threadpool; - -import java.security.AccessControlContext; -import org.eclipse.equinox.internal.util.pool.ObjectCreator; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -class Job implements ObjectCreator { - - public Runnable run; - - public String name; - - public String context; - - public int priority = -1; - public ThreadPoolFactoryImpl factory; - - AccessControlContext acc; - - private void setJob(Runnable run, String name, int priority, ThreadPoolFactoryImpl factory, AccessControlContext acc) { - this.run = run; - this.name = name; - this.priority = priority; - this.factory = factory; - this.acc = acc; - } - - @Override - public Object getInstance() { - return new Job(); - } - - public Job root = null; - - public Job last = null; - - private Job next; - - int counter = 0; - - public Job addJob(Runnable run, String name, int priority, ThreadPoolFactoryImpl factory, AccessControlContext acc) { - Job tmp = (Job) (ThreadPoolManagerImpl.jobPool.getObject()); - counter++; - tmp.setJob(run, name, priority, factory, acc); - if (root == null) { - root = tmp; - last = tmp; - return tmp; - } - last.next = tmp; - last = tmp; - return tmp; - } - - public void addJob(Job j) { - counter++; - if (root == null) { - root = j; - last = j; - return; - } - last.next = j; - last = j; - } - - private void clear() { - next = null; - } - - public void fullClear() { - next = null; - run = null; - name = null; - context = null; - acc = null; - } - - public Job getJob() { - Job r = null; - if (root == null) { - return null; - } - counter--; - r = root; - root = root.next; - if (root == null) - last = root; - r.clear(); - return r; - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/ThreadPoolFactoryImpl.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/ThreadPoolFactoryImpl.java deleted file mode 100644 index 7f397d7f60..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/ThreadPoolFactoryImpl.java +++ /dev/null @@ -1,168 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ - -package org.eclipse.equinox.internal.util.impl.tpt.threadpool; - -import java.security.AccessControlContext; -import java.security.AccessController; -import org.eclipse.equinox.internal.util.UtilActivator; -import org.eclipse.equinox.internal.util.impl.tpt.ServiceFactoryImpl; -import org.eclipse.equinox.internal.util.ref.Log; -import org.eclipse.equinox.internal.util.threadpool.ThreadPoolFactory; -import org.eclipse.equinox.internal.util.threadpool.ThreadPoolManager; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class ThreadPoolFactoryImpl extends ServiceFactoryImpl implements ThreadPoolManager, ThreadPoolFactory { - - public static ThreadPoolManagerImpl threadPool; - private int limit; - private int used = 0; - private Job queue; - private static int defaultPercent; - - public ThreadPoolFactoryImpl(String bundleName, Log log) { - - super(bundleName, log); - threadPool = ThreadPoolManagerImpl.getThreadPool(); - defaultPercent = UtilActivator.getInteger("equinox.util.threadpool.percent", 30); - limit = (ThreadPoolManagerImpl.tMaximum * defaultPercent) / 100; - if (limit == 0) - limit = 1; - queue = new Job(); - } - - public ThreadPoolFactoryImpl(String bundleName, int size) { - super(bundleName); - limit = size; - if (limit == 0) - limit = 1; - queue = new Job(); - } - - public ThreadPoolFactoryImpl(String bundleName) { - this(bundleName, (ThreadPoolManagerImpl.tMaximum * defaultPercent) / 100); - } - - @Override - public ThreadPoolFactory getInstance(String bundleName) { - if (threadPool == null) - throw new RuntimeException("ServiceFactory is currently off!"); - return new ThreadPoolFactoryImpl(bundleName); - } - - public static void stopThreadPool() { - ThreadPoolManagerImpl tmp = threadPool; - threadPool = null; - tmp.clear(); - } - - @Override - public ThreadPoolManager getThreadPool(int size, boolean sizeIsInPercents) { - if (threadPool == null) - throw new RuntimeException("[ThreadPool] ThreadPool is inaccessible"); - - if (sizeIsInPercents) { - size = (ThreadPoolManagerImpl.tMaximum * size) / 100; - } - if (size <= 0) { - size = 1; - } - return new ThreadPoolFactoryImpl(bundleName, size); - } - - @Override - public void execute(Runnable job, String name) { - execute(job, Thread.NORM_PRIORITY, name); - } - - public void execute0(Runnable job, int priority, String name, AccessControlContext acc) { - if (job == null || name == null) { - throw new IllegalArgumentException("the job or the name parameter is/are null"); - } - - if (ServiceFactoryImpl.useNames) - name = name + bundleName; - - ThreadPoolManagerImpl tmp = threadPool; - - if (tmp != null) { - synchronized (tmp.getSyncMonitor()) { - if (used >= limit) { - if (UtilActivator.LOG_DEBUG) { - UtilActivator.log.debug("In Bundle Queue: " + name + ", bundle queue size: " + queue.counter, null); - } - queue.addJob(job, name, priority, this, acc); - - return; - } - - used++; - } - - tmp.execute(job, priority, name, this, acc - - ); - } else - throw new RuntimeException("[ThreadPool] ThreadPool is inaccessible"); - } - - public void execute(Runnable job, int priority, String name, AccessControlContext acc) { - execute0(job, priority, name, acc); - } - - @Override - public void execute(Runnable job, int priority, String name) { - execute0(job, priority, name, (Log.security() ? AccessController.getContext() : null)); - } - - public Executor getExecutor() { - ThreadPoolManagerImpl tmp = threadPool; - if (tmp != null) { - synchronized (tmp.getSyncMonitor()) { - if (used < limit) { - Executor ex = tmp.getExecutor(); - if (ex != null) - used++; - return ex; - } - } - } - return null; - } - - void finished() { - Job job = queue.getJob(); - - if (job != null) { - if (UtilActivator.LOG_DEBUG) { - UtilActivator.log.debug("To threadpool queue: " + job.name + ", queue size: " + threadPool.waiting.counter, null); - } - threadPool.waiting.addJob(job); - } else { - used--; - } - } - - @Override - public void reset() { - if (threadPool != null) { - threadPool.reset(); - } - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/ThreadPoolManagerImpl.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/ThreadPoolManagerImpl.java deleted file mode 100644 index a593f1299f..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/ThreadPoolManagerImpl.java +++ /dev/null @@ -1,267 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ - -package org.eclipse.equinox.internal.util.impl.tpt.threadpool; - -import java.security.*; -import org.eclipse.equinox.internal.util.UtilActivator; -import org.eclipse.equinox.internal.util.impl.tpt.ServiceFactoryImpl; -import org.eclipse.equinox.internal.util.pool.ObjectPool; -import org.eclipse.equinox.internal.util.timer.TimerListener; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class ThreadPoolManagerImpl extends ObjectPool implements TimerListener, PrivilegedAction { - - static ThreadPoolManagerImpl threadPool = null; - - static ObjectPool jobPool; - - private int used = 0; - static int tMaximum = 0; - - Job waiting = new Job(); - - private static String pAutoMaximum = "equinox.util.threadpool.autoMaximum"; - - private static String pMin = "equinox.util.threadpool.minThreads"; - - private static String pMax = "equinox.util.threadpool.maxThreads"; - - private static String pIgnoreMax = "equinox.util.threadpool.ignoreMaximum"; - - private static int defMin = 1; - - private static int defMax = 48; - - private static int MAX_WAITING = 20; - - private static float MAX_OVERLOAD = 0.10F; - - private static boolean ignoreMax; - private static boolean autoMax; - - private ThreadPoolManagerImpl(int i, int j, int m) { - super((Class) null, i, j, m); - tMaximum = i * j; - ignoreMax = UtilActivator.getBoolean(pIgnoreMax); - autoMax = UtilActivator.getBoolean(pAutoMaximum); - jobPool = new ObjectPool(waiting, 5, 8, 4); - } - - public static ThreadPoolManagerImpl getThreadPool() { - if (threadPool == null) { - int intSize = UtilActivator.getInteger(pMin, defMin); - int minFill = intSize; - int factor = UtilActivator.getInteger(pMax, defMax); - intSize = intSize < 2 ? 2 : intSize; - if (intSize > factor) { - factor = (int) (intSize * 1.5 + 0.5); - } - threadPool = new ThreadPoolManagerImpl(intSize, (factor / intSize), minFill); - } - return threadPool; - } - - @Override - public void clear() { - shrink(-1); - threadPool = null; - } - - @Override - public Object getInstance() throws Exception { - if (ServiceFactoryImpl.privileged()) { - return AccessController.doPrivileged(this); - } - - return new Executor(); - } - - @Override - public Executor run() { - return new Executor(); - } - - @Override - public Object getObject() { - try { - return super.getObject(); - } catch (Throwable tw) { - if (ServiceFactoryImpl.log != null) { - ServiceFactoryImpl.log.error("Unable to create more threads!\r\nActive Thread Pool tasks: " + used, tw); - } - } - return null; - } - - public Executor getExecutor() { - synchronized (getSyncMonitor()) { - if (used < tMaximum || ignoreMax) { - Executor e = (Executor) getObject(); - if (e != null) { - used++; - return e; - } - } - } - return null; - } - - @Override - protected void shrink(int count) { - synchronized (getSyncMonitor()) { - dontExtend = true; - int x, y; - for (; nextFree > count; nextFree--) { - x = nextFree / factor; - y = nextFree % factor; - Executor e = (Executor) buff[x][y]; - buff[x][y] = null; - e.terminate(); - } - } - } - - @Override - public void shrink() { - shrink(minimumFill - 1); - dontExtend = false; - } - - @Override - public boolean releaseObject(Object obj) { - Job tmp = null; - Executor x = (Executor) obj; - - synchronized (getSyncMonitor()) { - x.factory.finished(); - - if (used <= tMaximum || ignoreMax) { - tmp = waiting.getJob(); - } - } - - if (tmp == null) { - used--; - x.clear(); - x.setPriorityI(Thread.NORM_PRIORITY); - return super.releaseObject(obj); - } - if (UtilActivator.LOG_DEBUG) { - UtilActivator.log.debug(0x0100, 10005, tmp.name, null, false); - } - x.setPriorityI(tmp.priority); - - x.setRunnable(tmp.run, tmp.name, tmp.factory, tmp.acc); - tmp.fullClear(); - jobPool.releaseObject(tmp); - return true; - } - - @Override - public void timer(int event) { - int count = 0; - int all = 0; - synchronized (getSyncMonitor()) { - for (Object[] b : buff) { - if (b != null) { - for (Object item : b) { - Executor e = (Executor) item; - if (e != null) { - all++; - if (!e.accessed) - count++; - else - e.accessed = false; - } - } - } - } - if (count > 0 && all > minimumFill - 1 && all > count) { - /* - * keep in mind current thread - shrinking one more, since the - * current thread will be back in pool - */ - if (count > minimumFill) - shrink(count - 2); - else - shrink(minimumFill - 2); - dontExtend = false; - } - } - } - - public void execute(Runnable job, int priority, String name, ThreadPoolFactoryImpl factory, AccessControlContext acc) { - Executor ex = null; - synchronized (getSyncMonitor()) { - if (used < tMaximum || ignoreMax) { - ex = (Executor) getObject(); - } - if (ex != null) { - used++; - } else { - addInTasksQueue(job, name, priority, factory, acc); - - return; - } - } - - ex.setPriorityI(priority); - ex.setRunnable(job, name, factory, acc); - } - - private void addInTasksQueue(Runnable job, String name, int priority, ThreadPoolFactoryImpl factory, AccessControlContext acc) { - - waiting.addJob(job, name, priority, factory, acc); - if (UtilActivator.LOG_DEBUG) { - UtilActivator.log.debug("In Threadpool Queue: " + name + ", queue size:" + waiting.counter, null); - } - if (autoMax && waiting.counter > MAX_WAITING) { - Executor ex = (Executor) getObject(); - if (ex != null) { - tMaximum += MAX_WAITING; - MAX_WAITING += (int) (MAX_WAITING * MAX_OVERLOAD); - for (Job j = waiting.getJob(); j != null; j = waiting.getJob()) { - if (ex == null) { - ex = (Executor) getObject(); - } - if (ex != null) { - used++; - ex.setPriorityI(j.priority); - ex.setRunnable(j.run, j.name, factory, acc); - ex = null; - } else { - waiting.addJob(j.run, j.name, j.priority, j.factory, acc); - break; - } - } - } - } - } - - public void reset() { - shrink(-1); - dontExtend = false; - } - - public Object getSyncMonitor() { - return buff; - } - -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/timer/TimerFactory.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/timer/TimerFactory.java deleted file mode 100644 index a00ead715a..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/timer/TimerFactory.java +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ - -package org.eclipse.equinox.internal.util.impl.tpt.timer; - -import org.eclipse.equinox.internal.util.impl.tpt.ServiceFactoryImpl; -import org.eclipse.equinox.internal.util.impl.tpt.threadpool.ThreadPoolFactoryImpl; -import org.eclipse.equinox.internal.util.ref.Log; -import org.eclipse.equinox.internal.util.timer.Timer; -import org.eclipse.equinox.internal.util.timer.TimerListener; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class TimerFactory extends ServiceFactoryImpl implements Timer { - private static TimerImpl timer; - - public TimerFactory(String bundleName, ThreadPoolFactoryImpl factory, Log log) { - - super(bundleName, log); - timer = new TimerImpl(factory); - } - - public TimerFactory(String bundleName) { - super(bundleName); - } - - @Override - public Timer getInstance(String bundleName) { - if (timer == null) - throw new RuntimeException("ServiceFactory is currently off!"); - return new TimerFactory(bundleName); - } - - @Override - @Deprecated - public void notifyAfterMillis(TimerListener listener, long timePeriod, int event) throws IllegalArgumentException { - addNotifyListener(listener, Thread.NORM_PRIORITY, Timer.ONE_SHOT_TIMER, timePeriod, event); - } - - @Override - @Deprecated - public void notifyAfterMillis(TimerListener listener, int priority, long timePeriod, int event) throws IllegalArgumentException { - addNotifyListener(listener, priority, Timer.ONE_SHOT_TIMER, timePeriod, event); - } - - @Override - @Deprecated - public void notifyAfter(TimerListener listener, int timePeriod, int event) throws IllegalArgumentException { - addNotifyListener(listener, Thread.NORM_PRIORITY, Timer.ONE_SHOT_TIMER, timePeriod * 1000, event); - } - - @Override - @Deprecated - public void notifyAfter(TimerListener listener, int priority, int timePeriod, int event) throws IllegalArgumentException { - addNotifyListener(listener, priority, Timer.ONE_SHOT_TIMER, timePeriod * 1000, event); - } - - @Override - public void addNotifyListener(TimerListener listener, int priority, int timerType, long periodMilis, int event) { - TimerImpl tmp = timer; - if (tmp == null) - throw new RuntimeException("This is a zombie!"); - tmp.addNotifyListener(listener, priority, timerType, periodMilis, event, bundleName); - } - - public static void stopTimer() { - if (timer != null) { - timer.terminate(); - timer = null; - } - } - - @Override - public void removeListener(TimerListener listener, int event) { - TimerImpl tmp = timer; - if (tmp == null) - throw new RuntimeException("This is a zombie!"); - tmp.removeListener(listener, event); - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/timer/TimerImpl.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/timer/TimerImpl.java deleted file mode 100644 index 30b27a6d93..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/timer/TimerImpl.java +++ /dev/null @@ -1,282 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ - -package org.eclipse.equinox.internal.util.impl.tpt.timer; - -import java.security.*; -import java.util.Hashtable; -import org.eclipse.equinox.internal.util.UtilActivator; -import org.eclipse.equinox.internal.util.impl.tpt.ServiceFactoryImpl; -import org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor; -import org.eclipse.equinox.internal.util.impl.tpt.threadpool.ThreadPoolFactoryImpl; -import org.eclipse.equinox.internal.util.pool.ObjectPool; -import org.eclipse.equinox.internal.util.ref.Log; -import org.eclipse.equinox.internal.util.timer.Timer; -import org.eclipse.equinox.internal.util.timer.TimerListener; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class TimerImpl implements Runnable { - - static Hashtable nodes; - static ObjectPool nodePool; - - static ThreadPoolFactoryImpl threadPool; - - private TimerQueue queue; - private boolean terminated = false; - private Object sync = new Object(); - private Thread th; - - public TimerImpl(ThreadPoolFactoryImpl threadPool) { - nodePool = new ObjectPool(new TimerQueueNode(), 2, 4, 2); - TimerImpl.threadPool = threadPool; - nodes = new Hashtable<>(10); - queue = new TimerQueue(); - try { - th = ((ServiceFactoryImpl.privileged()) ? getOne() : new Thread(this, "[Timer] - Main Queue Handler")); - try { - String str = UtilActivator.bc.getProperty("equinox.timer.priority"); - if (str != null) - th.setPriority(Integer.parseInt(str)); - } catch (Throwable ignored) { - } - th.start(); - } catch (Exception e) { - throw new RuntimeException("Can not start Timer thread!" + e); - } - } - - @Override - public void run() { - TimerQueueNode n = null; - while (!terminated) { - synchronized (sync) { - if (n == null && queue.isEmpty()) { - try { - sync.wait(); - } catch (Exception e) { - } - // todo check if isEmpty is necessary - if (queue.isEmpty() || terminated) { - continue; - } - } - } - synchronized (queue) { - n = queue.getMin(); - while (n != null && !n.enabled) { - queue.removeMin(); - n.returnInPool(); - n = queue.getMin(); - } - if (n == null) - continue; - long current = System.currentTimeMillis(); - if (n.runOn <= current) { - switch (n.type) { - case (Timer.ONE_SHOT_TIMER) : { - threadPool.execute0(n, n.priority, n.getEName(), n.acc); - queue.removeMin(); - nodes.remove(n); - break; - } - case (Timer.ONE_SHOT_TIMER_NO_DELAY) : { - Executor e = threadPool.getExecutor(); - if (e != null) { - e.setPriorityI(n.priority); - e.setRunnable(n, n.getEName(), threadPool, n.acc); - } else { - Thread th = new Thread(n, n.getEName()); - th.setPriority(n.priority); - th.start(); - } - queue.removeMin(); - nodes.remove(n); - break; - } - case (Timer.PERIODICAL_TIMER) : { - threadPool.execute0(n, n.priority, n.getEName(), n.acc); - n.runOn += n.period; - if (n.runOn < current) { // time changed - n.runOn = current + n.period; - } - queue.rescheduleMin(n.runOn); - break; - } - case (Timer.PERIODICAL_TIMER_NO_DELAY) : { - Executor e = threadPool.getExecutor(); - if (e != null) { - e.setPriorityI(n.priority); - e.setRunnable(n, n.getEName(), threadPool, n.acc); - } else { - Thread th = new Thread(n, n.getEName()); - th.setPriority(n.priority); - th.start(); - } - if (n.runOn < current) { // time changed - n.runOn = current + n.period; - } - queue.rescheduleMin(n.runOn); - } - } - continue; - } - } - synchronized (sync) { - long tmpWait; - if (n != null && (tmpWait = n.runOn - System.currentTimeMillis()) > 0) { - try { - sync.wait(tmpWait); - } catch (Exception e) { - e.printStackTrace(); - } - TimerQueueNode tmp = null; - synchronized (queue) { - tmp = queue.getMin(); - if (tmp != n) { - n = tmp; - } - } - /* what's this for - we'll continue in any case */ - continue; - } - } - } // while (!terminated) - nodePool.clear(); - nodePool = null; - nodes.clear(); - nodes = null; - queue = null; - } - - public void terminate() { - terminated = true; - synchronized (sync) { - sync.notify(); - } - try { - th.join(); - } catch (InterruptedException ie) { - } - } - - private void put(TimerListener listener, int priority, int timerType, long periodMilis, int event, String name, AccessControlContext acc) { - if (terminated || nodePool == null) { - throw new RuntimeException("This Instance is a ZOMBIE!!!" + terminated + " " + nodePool); - } - - TimerQueueNode n = (TimerQueueNode) nodePool.getObject(); - n.setEvent(listener, priority, timerType, System.currentTimeMillis() + periodMilis, periodMilis, event, name, acc); - TimerQueueNode tmp = nodes.remove(n); - if (tmp != null) { - synchronized (queue) { - queue.removeTimerNode(tmp); - } - tmp.returnInPool(); - } - nodes.put(n, n); - TimerQueueNode nx; - synchronized (queue) { - queue.add(n); - nx = queue.getMin(); - } - if (nx == n) { - synchronized (sync) { - sync.notifyAll(); - } - } - } - - void addNotifyListener(TimerListener listener, int priority, int timerType, long periodMilis, int event, String name) { - if (timerType < Timer.ONE_SHOT_TIMER || timerType > Timer.PERIODICAL_TIMER_NO_DELAY) { - throw new IllegalArgumentException("Invalid Timer Type"); - } - if (listener != null) { - if (priority >= Thread.MIN_PRIORITY && priority <= Thread.MAX_PRIORITY) { - if (periodMilis > 0) { - AccessControlContext acc = Log.security() ? AccessController.getContext() : null; - put(listener, priority, timerType, periodMilis, event, name, acc); - } else { - throw new IllegalArgumentException("Time period must be positive!"); - } - } else { - throw new IllegalArgumentException("Priority must be between Thread.MIN_PRIORITY and Thread.MAX_PRIORITY!"); - } - } else { - throw new IllegalArgumentException("The timer listener is null"); - } - } - - public void removeListener(TimerListener listener, int event) { - TimerQueueNode rmTmp = (TimerQueueNode) nodePool.getObject(); - rmTmp.setEvent(listener, 0, 0, 0, 0, event, null, null); - TimerQueueNode old = nodes.remove(rmTmp); - if (old != null) { - synchronized (queue) { - queue.removeTimerNode(old); - } - old.returnInPool(); - } - rmTmp.returnInPool(); - } - - private class PrivilegedActionImpl implements PrivilegedAction { - private Runnable runnable = null; - private boolean locked = false; - private boolean waiting = false; - - PrivilegedActionImpl() { - } - - public synchronized void set(Runnable runnable) { - while (locked) { - waiting = true; - try { - wait(); - } catch (Exception _) { - } - waiting = false; - } - locked = true; - this.runnable = runnable; - } - - @Override - public Thread run() { - Runnable runnableLocal = null; - synchronized (this) { - runnableLocal = this.runnable; - this.runnable = null; - locked = false; - if (waiting) - notifyAll(); - } - return new Thread(runnableLocal, "[Timer] - Main Queue Handler"); - } - } - - public Thread getOne() throws Exception { - if (action == null) - action = new PrivilegedActionImpl(); - action.set(this); - return AccessController.doPrivileged(action); - } - - PrivilegedActionImpl action = null; -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/timer/TimerQueue.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/timer/TimerQueue.java deleted file mode 100644 index 2525fb0dd0..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/timer/TimerQueue.java +++ /dev/null @@ -1,207 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.impl.tpt.timer; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -class TimerQueue { - - static final int POOL_SIZE = 20; - QueueElement[] pool = new QueueElement[POOL_SIZE]; - int filled = 0; - - QueueElement first; - QueueElement lastInserted; - - TimerQueue() { - } - - /** - * Adds a new task to the priority queue. - */ - void add(TimerQueueNode task) { - QueueElement toAdd = getQueueElement(); - toAdd.node = task; - - if (first == null) { - first = toAdd; - } else { - insertElement(toAdd); - } - } - - /** - * Return the "head task" of the priority queue. (The head task is an task - * with the lowest nextExecutionTime.) - */ - TimerQueueNode getMin() { - return (first != null) ? first.node : null; - } - - /** - * Remove the head task from the priority queue. - */ - void removeMin() { - if (first != null) { - if (lastInserted == first) { - lastInserted = null; - } - if (filled < POOL_SIZE) { - QueueElement toFree = first; - first = first.next; - freeQueueElement(toFree); - } else { - first = first.next; - } - } - } - - /** - * Sets the nextExecutionTime associated with the head task to the specified - * value, and adjusts priority queue accordingly. - */ - void rescheduleMin(long newTime) { - first.node.runOn = newTime; - if (first.next != null) { - if (lastInserted == first) { - lastInserted = null; - } - QueueElement el = first; - first = first.next; - el.next = null; - insertElement(el); - } - } - - /** - * Returns true if the priority queue contains no elements. - */ - boolean isEmpty() { - return first == null; - } - - /** - * Removes all elements from the priority queue. - */ - void clear() { - while (first != null) { - first.node.returnInPool(); - first = first.next; - } - lastInserted = null; - } - - void insertElement(QueueElement newElement) { - if (first.node.runOn >= newElement.node.runOn) { - /* private case - insert in the beginning of the queue */ - newElement.next = first; - first = newElement; - } else if (lastInserted != null) { - if (lastInserted.node.runOn == newElement.node.runOn) { - QueueElement tmp = lastInserted.next; - lastInserted.next = newElement; - newElement.next = tmp; - } else if (lastInserted.node.runOn > newElement.node.runOn) { - // System.out.println("insert 1"); - doInsertElement(first, newElement); - } else { - // System.out.println("insert 2"); - doInsertElement(lastInserted, newElement); - } - } else { - // System.out.println("insert 3"); - doInsertElement(first, newElement); - } - } - - /** - * elToInsert should not be placed before firstEl, because firstEl may not - * be the first element of the queue - */ - void doInsertElement(QueueElement firstEl, QueueElement elToInsert) { - QueueElement tmp = firstEl; - QueueElement prev = firstEl; - while (tmp != null && tmp.node.runOn < elToInsert.node.runOn) { - prev = tmp; - tmp = tmp.next; - } - if (tmp == null) { - /* reached the end of the queue */ - prev.next = elToInsert; - } else { - prev.next = elToInsert; - elToInsert.next = tmp; - } - lastInserted = elToInsert; - } - - void removeTimerNode(TimerQueueNode node) { - QueueElement tmp = first; - QueueElement prev = null; - while (tmp != null) { - if (node.listener == tmp.node.listener && node.event == tmp.node.event) { - if (prev != null) { - if (lastInserted == tmp) { - lastInserted = prev; - } - prev.next = tmp.next; - if (filled < POOL_SIZE) { - freeQueueElement(tmp); - } - } else { - /* removing the first element */ - if (lastInserted == first) { - lastInserted = null; - } - if (filled < POOL_SIZE) { - QueueElement toFree = first; - first = first.next; - freeQueueElement(toFree); - } else { - first = first.next; - } - } - break; - } - prev = tmp; - tmp = tmp.next; - } - } - - private QueueElement getQueueElement() { - return (filled > 0) ? pool[--filled] : new QueueElement(); - } - - private void freeQueueElement(QueueElement toFree) { - if (filled < POOL_SIZE) { - pool[filled] = toFree; - filled++; - toFree.next = null; - toFree.node = null; - } - } - - private class QueueElement { - QueueElement next; - TimerQueueNode node; - - public QueueElement() { - } - } - -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/timer/TimerQueueNode.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/timer/TimerQueueNode.java deleted file mode 100644 index cc11206bd2..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/timer/TimerQueueNode.java +++ /dev/null @@ -1,178 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ - -package org.eclipse.equinox.internal.util.impl.tpt.timer; - -import java.security.AccessControlContext; -import org.eclipse.equinox.internal.util.impl.tpt.ServiceFactoryImpl; -import org.eclipse.equinox.internal.util.pool.ObjectCreator; -import org.eclipse.equinox.internal.util.timer.Timer; -import org.eclipse.equinox.internal.util.timer.TimerListener; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -class TimerQueueNode implements Runnable, ObjectCreator { - public static final String PERIODICAL_TASK_NAME = "[Timer] - Periodical Task"; - - public static final String PERIODICAL_NO_DELAY_TASK_NAME = "[Timer] - Periodical No Delay Task"; - - public static final String ONE_SHOT_TASK_NAME = "[Timer] - One Shot Task"; - - public static final String ONE_SHOT_NO_DELAY_TASK_NAME = "[Timer] - One Shot No Delay Task"; - - public TimerQueueNode() { - } - - TimerListener listener = null; - - int event; - - long runOn = -1; - - int type = -1; - - int priority = -1; - - long period = -1; - - boolean running = false; - - private int theHash; - - String name; - - boolean named = false; - - String context; - - AccessControlContext acc; - - boolean enabled = false; - - public String getEName() { - if (ServiceFactoryImpl.useNames && !named) { - named = true; - String tmp = null; - switch (type) { - case Timer.ONE_SHOT_TIMER : { - tmp = ONE_SHOT_TASK_NAME; - break; - } - case Timer.ONE_SHOT_TIMER_NO_DELAY : { - tmp = ONE_SHOT_NO_DELAY_TASK_NAME; - break; - } - case Timer.PERIODICAL_TIMER : { - tmp = PERIODICAL_TASK_NAME; - break; - } - case Timer.PERIODICAL_TIMER_NO_DELAY : { - tmp = PERIODICAL_NO_DELAY_TASK_NAME; - break; - } - } - name = (name != null) ? tmp.concat(name) : tmp; - } - return ((name == null) ? "" : name); - } - - public void setEvent(TimerListener listener, int priority, int timerType, long runOn, long periodMilis, int event, String name, AccessControlContext acc) { - this.enabled = true; - this.listener = listener; - theHash = listener.hashCode() + event; - this.priority = priority; - type = timerType; - period = periodMilis; - this.runOn = runOn; - this.event = event; - this.name = name; - this.named = false; - this.acc = acc; - } - - void returnInPool() { - synchronized (this) { - if (!enabled || (running && type == Timer.ONE_SHOT_TIMER)) { - /* this node has already been put in pool or will be put */ - return; - } - clear(); - } - if (TimerImpl.nodePool != null) { - TimerImpl.nodePool.releaseObject(this); - } - } - - @Override - public void run() { - synchronized (this) { - running = true; - } - TimerListener tmp = listener; - try { - if (tmp != null && enabled) { - tmp.timer(event); - } - } catch (Throwable t) { - if (ServiceFactoryImpl.log != null) { - ServiceFactoryImpl.log.error("[Timer] - Error while notifying:\r\n" + tmp, t); - } - } - tmp = null; - if (type == Timer.ONE_SHOT_TIMER) - returnInPool(); - running = false; - } - - @Override - public Object getInstance() { - return new TimerQueueNode(); - } - - private void clear() { - named = false; - name = null; - enabled = false; - listener = null; - event = -1; - runOn = Long.MAX_VALUE; - type = -1; - acc = null; - - } - - @Override - public int hashCode() { - TimerListener lis = listener; - return (lis != null) ? (theHash = (lis.hashCode() + event)) : theHash; - } - - @Override - public String toString() { - return "QueueNode: " + super.toString() + "\r\n" + "\t\tListener: " + listener + "\r\n" + "\t\tEvent: " + event + "\r\n" + "\t\tType: " + type + "\r\n" + "\t\trunafter: " + (runOn - System.currentTimeMillis()) + "\r\n" + "\t\tEnabled: " + enabled; - } - - @Override - public boolean equals(Object a) { - if (a instanceof TimerQueueNode) { - TimerQueueNode b = (TimerQueueNode) a; - return b.listener == listener && b.event == event; - } - return false; - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/pool/ObjectCreator.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/pool/ObjectCreator.java deleted file mode 100644 index 333e35562b..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/pool/ObjectCreator.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.pool; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public interface ObjectCreator { - - public Object getInstance() throws Exception; -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/pool/ObjectPool.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/pool/ObjectPool.java deleted file mode 100644 index 9947b7ed76..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/pool/ObjectPool.java +++ /dev/null @@ -1,193 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ - -package org.eclipse.equinox.internal.util.pool; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class ObjectPool { - - private Class template; - - protected Object[][] buff; - - protected int nextFree; - - protected int size; - - protected int minimumFill; - - protected int factor; - - protected int minfSize; - - protected int minffactor; - - // protected int usageGet = 0; - - // protected int usageReleased = 0; - - protected boolean dontExtend = false; - - protected ObjectCreator oc; - - public Object getInstance() throws Exception { - return oc != null ? oc.getInstance() : template.getDeclaredConstructor().newInstance(); - } - - public ObjectPool(ObjectCreator oc, int size, int factor) { - this(null, oc, size, factor, size * factor); - } - - public ObjectPool(Class template, int size, int factor) { - this(template, null, size, factor, size * factor); - } - - public ObjectPool(Class template, int size, int factor, int minimumFill) { - this(template, null, size, factor, (minimumFill = (minimumFill > (size * factor)) ? (size * factor) : minimumFill)); - } - - public ObjectPool(ObjectCreator oc, int size, int factor, int minimumFill) { - this(null, oc, size, factor, (minimumFill = minimumFill > (size * factor) ? (size * factor) : minimumFill)); - } - - protected ObjectPool(Class template, ObjectCreator oc, int size, int factor, int minimumFill) { - - if (size <= 1 || factor < 1) { - throw new IllegalArgumentException(size + " is less or equal to 1"); - } - - this.minimumFill = minimumFill < 1 ? 1 : minimumFill; - this.oc = oc; - if (template != null) { - try { - template.getConstructor(); - this.template = template; - } catch (NoSuchMethodException nsm) { - throw new IllegalArgumentException(template + " don't have default constructor!"); - } - } - buff = new Object[size][]; - this.size = size; - this.factor = factor; - minfSize = this.minimumFill / factor; - minffactor = this.minimumFill % factor; - // System.out.println("minimumFill " + this.minimumFill); - // System.out.println("minfSize " + minfSize); - // System.out.println("minffactor " + minffactor); - if (minimumFill <= 1) { - nextFree = -1; - } else { - for (int i = 0; i < (minfSize == 0 ? 1 : minfSize); i++) { - buff[i] = new Object[factor]; - } - fill(); - } - // start(); - } - - private void fill() { - int i = 0; - synchronized (buff) { - for (; (i < minfSize); i++) { - put(i, factor); - } - if (minffactor > 0) { - put(i, minffactor); - } - } - nextFree = minimumFill - 1; - } - - private void put(int i, int count) { - for (int j = 0; j < count; j++) { - try { - if (buff[i] == null) { - buff[i] = new Object[factor]; - } - buff[i][j] = getInstance(); - nextFree = i * j; - } catch (Throwable t) { - throw new RuntimeException("buffer fill failed: " + t); - } - } - } - - public void clear() { - dontExtend = true; - shrink(-1); - } - - protected void shrink(int count) { - synchronized (buff) { - for (; nextFree > count; nextFree--) { - buff[(nextFree / factor)][nextFree % factor] = null; - } - } - } - - public void shrink() { - dontExtend = true; - shrink(minimumFill); - dontExtend = false; - } - - public Object getObject() { - Object tmp = null; - synchronized (buff) { - if (nextFree < 0) { - if (dontExtend) { - throw new RuntimeException(); - } - if (minimumFill <= 1) { - try { - return getInstance(); - } catch (Throwable e) { - throw new RuntimeException("buffer fill failed: " + e); - } - } - fill(); - } - tmp = buff[(nextFree / factor)][(nextFree % factor)]; - buff[(nextFree / factor)][nextFree % factor] = null; - nextFree--; - // usageGet++; - return tmp; - } - } - - public boolean releaseObject(Object obj) { - // usageReleased++; - if (dontExtend) { - return false; - } - synchronized (buff) { - int tmp = nextFree + 1; - int telement = tmp / factor; - if ((telement) < size) { - if (buff[telement] == null) { - buff[telement] = new Object[factor]; - } - buff[telement][tmp % factor] = obj; - nextFree = tmp; - return true; - } - return false; - } - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/pool/package.html b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/pool/package.html deleted file mode 100644 index af97828e6f..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/pool/package.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -org.eclipse.equinox.util.pool - - -

    The object pool utility creates pools of reusable objects of certain type.

    - - diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/ref/Log.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/ref/Log.java deleted file mode 100644 index 0e73cb6203..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/ref/Log.java +++ /dev/null @@ -1,834 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.ref; - -import java.io.*; -import java.util.Vector; -import org.eclipse.equinox.internal.util.UtilActivator; -import org.eclipse.equinox.internal.util.event.Queue; -import org.eclipse.equinox.internal.util.hash.HashIntObjNS; -import org.eclipse.equinox.internal.util.security.PrivilegedRunner; -import org.eclipse.equinox.internal.util.security.SecurityUtil; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.log.LogService; -import org.osgi.util.tracker.ServiceTracker; -import org.osgi.util.tracker.ServiceTrackerCustomizer; - -/** - * Log class is responsible for forwarding bundles's messages to the LogService - * or console output. - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class Log implements LogInterface, ServiceTrackerCustomizer, PrivilegedRunner.PrivilegedDispatcher { - - /** - * Flag, pointing if printingOnConsole is allowed - * - * @deprecated since osgilib verion 1.3.9 use set/get PrintOnConsole - */ - @Deprecated - public boolean printOnConsole = false; - - /** - * Flag, pointing whether printing on console should be done if log service - * is not available - */ - public boolean autoPrintOnConsole = false; - - /** - * Flag, pointing if logging debuging info is allowed - * - * @deprecated since osgilib verion 1.3.9 use set/get Debug - */ - @Deprecated - public boolean debug = false; - - /** - * Flag, pointing whether printing on console should be done for errors - * (exceptions) and warnings - */ - private boolean logErrorLevel = false; - - private ServiceTracker logTracker; - - protected static final SecurityUtil securityUtil = new SecurityUtil(); - - private boolean isClosed = false; - - private long bundleId; - /** BundleContext to get LogService and service owner of Log object BundleId */ - protected BundleContext bc; - private static Vector logs = new Vector<>(); - private static Log listener; - - public Log(BundleContext bc) { - this(bc, true); - } - - /** - * Constructs a log object, used for logging information in the LogService. - * If the LogService is unavailble, the information is printed on the - * server's console. - * - * @param bc - * BundleContext, necessary to get LogService, in case it is - * started. - */ - public Log(BundleContext bc, boolean initDebug) { - if (initDebug) { - debug = securityUtil.getBooleanProperty("equinox.util.ref.log.debug"); - logErrorLevel = securityUtil.getBooleanProperty("equinox.log.errorlevel"); - autoPrintOnConsole = securityUtil.getBooleanProperty("equinox.util.ref.log.autoPrintOnConsole"); - printOnConsole = securityUtil.getBooleanProperty("equinox.util.ref.log.printOnConsole"); - } - if (bc != null) { - this.bc = bc; - bundleId = bc.getBundle().getBundleId(); - - if (UtilActivator.startup && UtilActivator.points != null) - UtilActivator.points[0] = System.currentTimeMillis(); - - initSysServices(); - - if (UtilActivator.startup && UtilActivator.points != null) - UtilActivator.points[1] = System.currentTimeMillis(); - synchronized (logs) { - if (listener == null) - initListener(); - logs.addElement(this); - } - - if (UtilActivator.startup && UtilActivator.points != null) - UtilActivator.points[2] = System.currentTimeMillis(); - } else - printOnConsole = true; - } - - private void initListener() { - try { - securityUtil.doPrivileged(this, OPEN_TYPE, null); - } catch (IllegalStateException ise) { - /* must be rethrown */ - throw ise; - } catch (Throwable ignore) { - ignore.printStackTrace(); - } - } - - void initListener0() { - synchronized (logs) { - initListenerNS(); - } - } - - void initListenerNS() { - logTracker = new ServiceTracker<>(bc, org.osgi.service.log.LogService.class, this); - logTracker.open(); - listener = this; - } - - /** - * Logs error messages. If printOnConsole is true, or if the - * LogService is unavailable, log info is printed on console. - * - * @param str - * Message description of the error. - * @param ex - * Throwable object, containing the stack trace; may be null. - */ - @Override - public void error(String str, Throwable ex) { - if (isClosed) - return; - - boolean logResult = logMessage(LogService.LOG_ERROR, str, ex); - if (printOnConsole || (!logResult && autoPrintOnConsole) || logErrorLevel) { - dumpOnConsole("ERROR ", str, bundleId, ex); - } - } - - /** - * Logs error messages. If printOnConsole is true, or if the - * LogService is unavailable, log info is printed on console. - * - * @param moduleID - * @param msgID - * @param msg - * Message description of the error. - * @param t - * Throwable object, containing the stack trace; may be null. - * @param synch - * Weather tracer to work synchronious or not - */ - public void error(int moduleID, int msgID, String msg, Throwable t, boolean synch) { - if (isClosed) - return; - - boolean logResult = true; - if (msg != null || t != null) { - logResult = logMessage(LogService.LOG_ERROR, msg, t); - } - if (printOnConsole || (!logResult && autoPrintOnConsole) || logErrorLevel) { - dumpOnConsole(buildDebugString(moduleID, msgID, msg, "ERROR " + bundleId + " "), t); - } - } - - /** - * Logs warning messages. If printOnConsole is true, or if - * the LogService is unavailable, log info is printed on - * console. - * - * @param str - * Message description of the error. - * @param ex - * Throwable object, containing the stack trace; may be null. - */ - @Override - public void warning(String str, Throwable ex) { - if (isClosed) - return; - - boolean logResult = logMessage(LogService.LOG_WARNING, str, ex); - if (printOnConsole || (!logResult && autoPrintOnConsole) || logErrorLevel) { - dumpOnConsole("WARNING ", str, bundleId, ex); - } - } - - /** - * Logs warning messages. If printOnConsole is true, or if - * the LogService is unavailable, log info is printed on - * console. - * - * @param moduleID - * @param msgID - * @param msg - * Message description of the error. - * @param t - * Throwable object, containing the stack trace; may be null. - * @param synch - * Weather tracer to work synchronious or not - */ - public void warning(int moduleID, int msgID, String msg, Throwable t, boolean synch) { - if (isClosed) - return; - - boolean logResult = true; - if (msg != null || t != null) { - logResult = logMessage(LogService.LOG_WARNING, msg, t); - } - if (printOnConsole || (!logResult && autoPrintOnConsole) || logErrorLevel) { - dumpOnConsole(buildDebugString(moduleID, msgID, msg, "WARNING " + bundleId + " "), t); - } - } - - /** - * Logs info messages. If printOnConsole is true, or if the - * LogService is unavailable, message is printed on console. - * - * @param str - * Message to be logged. - */ - @Override - public void info(String str) { - if (isClosed) - return; - - boolean logResult = logMessage(LogService.LOG_INFO, str, null); - if (printOnConsole || (!logResult && autoPrintOnConsole)) { - dumpOnConsole("INFO ", str, bundleId, null); - } - } - - /** - * Logs info messages. If printOnConsole is true, or if the - * LogService is unavailable, log info is printed on console. - * - * @param moduleID - * @param msgID - * @param msg - * Message description of the error. - * @param synch - * Weather tracer to work synchronious or not - */ - public void info(int moduleID, int msgID, String msg, boolean synch) { - if (isClosed) - return; - - boolean logResult = true; - if (msg != null) { - logResult = logMessage(LogService.LOG_INFO, msg, null); - } - if (printOnConsole || (!logResult && autoPrintOnConsole)) { - dumpOnConsole(buildDebugString(moduleID, msgID, msg, "INFO " + bundleId + " "), null); - } - } - - /** - * Logs debug information if debug flag is true. If - * LogService is unaccessible or printOnConsole flag is true, log info is - * printed on console. - * - * @param str - * Message description. - * @param ex - * Throwable object, containing the stack trace; may be null. - */ - @Override - public void debug(String str, Throwable ex) { - if (!debug || isClosed) - return; - - boolean logResult = logMessage(LogService.LOG_DEBUG, str, ex); - if (printOnConsole || (!logResult && autoPrintOnConsole)) { - dumpOnConsole("DEBUG ", str, bundleId, ex); - } - } - - /** - * Logs debug messages. If printOnConsole is true, or if the - * LogService is unavailable, log info is printed on console. - * - * @param moduleID - * @param msgID - * @param msg - * Message description of the error. - * @param t - * Throwable object, containing the stack trace; may be null. - * @param synch - * Indicates whether tracer should log the message synchronously - * or not - */ - public void debug(int moduleID, int msgID, String msg, Throwable t, boolean synch) { - debug(moduleID, msgID, msg, t, synch, false, false, true); - } - - /** - * Logs debug messages. If printOnConsole is true, or if the - * LogService is unavailable, log info is printed on console. - * - * @param moduleID - * @param msgID - * @param msg - * Message description of the error. - * @param t - * Throwable object, containing the stack trace; may be null. - * @param synch - * Indicates whether tracer should log the message synchronously - * or not - * @param measurement - * Indicates whether the message is a measurement or not - */ - public void debug(int moduleID, int msgID, String msg, Throwable t, boolean synch, boolean measurement) { - debug(moduleID, msgID, msg, t, synch, measurement, false, true); - } - - /** - * Logs debug messages. If printOnConsole is true, or if the - * LogService is unavailable, log info is printed on console. - * - * @param moduleID - * @param msgID - * @param msg - * Message description of the error. - * @param t - * Throwable object, containing the stack trace; may be null. - * @param synch - * Indicates whether tracer should log the message synchronously - * or not - * @param measurement - * Indicates whether the message is a measurement or not - * @param display - * Indicates whether the message should be displayed in native - * GUI - */ - public void debug(int moduleID, int msgID, String msg, Throwable t, boolean synch, boolean measurement, boolean display) { - debug(moduleID, msgID, msg, t, synch, measurement, display, true); - } - - /** - * Logs debug messages. If printOnConsole is true, or if the - * LogService is unavailable, log info is printed on console. - * - * @param moduleID - * @param msgID - * @param msg - * Message description of the error. - * @param t - * Throwable object, containing the stack trace; may be null. - * @param synch - * Indicates whether tracer should log the message synchronously - * or not - * @param measurement - * Indicates whether the message is a measurement or not - * @param display - * Indicates whether the message should be displayed in native - * GUI - * @param logInFile - * Indicates whether the message should be logged into the log - * file or not. Used for measurements' logs. - */ - public void debug(int moduleID, int msgID, String msg, Throwable t, boolean synch, boolean measurement, boolean display, boolean logInFile) { - if (!debug && !measurement || isClosed) - return; - - String message = msg; - if (measurement) { - message = buildDebugString(moduleID, msgID, msg, "DEBUG " + bundleId + " "); - } - - boolean logResult = logInFile ? true : (message == null && t == null); - if (logInFile && (message != null || t != null)) { - logResult = logMessage(LogService.LOG_DEBUG, message, t); - } - - /* Checks are added for different framework implementations. */ - if (printOnConsole || (!logResult && autoPrintOnConsole)) { - message = buildDebugString(moduleID, msgID, msg, "DEBUG " + bundleId + " "); - dumpOnConsole(message, t); - } - } - - private void initSysServices() { - if (security) { - try { - securityUtil.doPrivileged(this, GET_SYS_SERVICES_TYPE, null); - } catch (Throwable ignore) { - ignore.printStackTrace(); - } - } - } - - LogService getService0() throws IllegalArgumentException { - synchronized (logs) { - ServiceReference logRef = listener.logTracker.getServiceReference(); - LogService ls = null; - if (logRef != null) { - ls = bc.getService(logRef); - } - return ls; - } - } - - private LogService getService() throws IllegalArgumentException { - if (bc == null) - return null; // standalone hack - try { - return (LogService) securityUtil.doPrivileged(this, GET_SERVICE_TYPE, null); - } catch (IllegalArgumentException e) { - throw e; - } catch (Exception e) { - /* this will not happen */ - e.printStackTrace(); - throw new IllegalArgumentException(e.toString()); - } - } - - private boolean logMessage(int messageType, String messageText, Throwable t) { - LogService ls = null; - - try { - ls = getService(); - } catch (IllegalStateException ise) { // invalid bundle context - synchronized (logs) { - close0(); - } - return false; - } - boolean result = true; - if (ls == null) { - result = false; - testClose(); // test the listener - } else { - try { - ls.log(messageType, messageText, t); - } catch (IllegalStateException ise) { // the log service instance - // is not valid - result = false; - testClose(); // test the listener - } - } - return result; - } - - private void dumpOnConsole(String prefix, String msg, long bundleId, Throwable t) { - System.out.println(prefix + bundleId + " " + msg); - if (t != null) { - t.printStackTrace(); - } - } - - /** - * Prints a message to the console or a log dispatcher - * - * @param msg - - * the message to print, which contains the prefix and the - * bundleID in itself - * @param t - * throwable object, which stack trace should be printed - */ - private void dumpOnConsole(String msg, Throwable t) { - System.out.println(msg); - if (t != null) { - t.printStackTrace(); - } - } - - private void testClose() { - synchronized (logs) { - if (listener != null) - try { - listener.bc.getBundle(); - return; - } catch (IllegalStateException ise) { - listener.close0(); - } - } - } - - /** - * Releases the Log's resources: ungets LogService, removes the - * ServiceListener from the framework and nulls references. After invocation - * of this method, this Log object can be used no longer. - */ - @Override - public void close() { - if (bc != null) { - synchronized (logs) { - close0(); - } - } - } - - private boolean close0() { - logs.removeElement(this); - isClosed = true; - if (listener == this) { - try { - logTracker.close(); - logTracker = null; - } catch (IllegalStateException ise) { - } - Log ls = null; - while (logs.size() > 0) { - ls = logs.elementAt(0); - try { - ls.initListener(); - break; - } catch (IllegalStateException ise) { - logs.removeElementAt(0); - ls = null; - } - } - listener = ls; - } - return (listener != null); - } - - /** - * enable/disable print on console - * - * @param value - * boolean if true enables print on console else disables it - */ - @Override - public void setPrintOnConsole(boolean value) { - printOnConsole = value; - } - - /** - * enable/disable loging of debug info - * - * @param value - * boolean if true enables loging of debug info else disables it - */ - @Override - public void setDebug(boolean value) { - debug = value; - } - - /** - * Gets the flag, which enables logging debug messages. - * - * @return true if debugging is enabled - */ - @Override - public boolean getDebug() { - return debug; - } - - /** - * Gets the flag, which enables printing log messages on the console. - * - * @return true if printingon console is enabled - */ - @Override - public boolean getPrintOnConsole() { - return printOnConsole; - } - - @Override - public LogService addingService(ServiceReference reference) { - return bc.getService(reference); - } - - @Override - public void modifiedService(ServiceReference reference, LogService service) { - } - - @Override - public void removedService(ServiceReference reference, LogService service) { - } - - private HashIntObjNS map = null; - private HashIntObjNS starts = null; - - public void setMaps(HashIntObjNS map0, HashIntObjNS starts0) { - map = map0; - starts = starts0; - } - - private String getModuleName(int moduleID) { - return (String) map.get(-moduleID); - } - - private String getMsgValue(int msgID) { - String res = (String) map.get(msgID); - if (res == null && starts != null) { - try { - int startID = ((Integer) starts.get(msgID)).intValue(); - res = "END OF " + (String) map.get(startID); - } catch (Exception e) { - } - } - return res; - } - - private static final char[] chars = {']', ' ', ':', ' '}; - - private String buildDebugString(int moduleID, int msgID, String message, String prefix) { - - if (map == null) { - return prefix + " [" + moduleID + "] " + msgID + " : " + (message == null ? "" : message); - } - - StringBuilder sBuf = new StringBuilder(prefix).append("["); - - String module = getModuleName(moduleID); - sBuf.append(module != null ? module : String.valueOf(moduleID)); - - sBuf.append(chars, 0, 2); - - if (msgID != 0) { - // map msgID to String - String msg = getMsgValue(msgID); - sBuf.append(msg != null ? msg : String.valueOf(msgID)); - } - - if (message != null) - sBuf.append(chars, 2, 2).append(message); - - return sBuf.toString(); - } - - // public String toString() { - // return bc.toString(); - // } - - private static boolean security = false; - - public static boolean security() { - if (UtilActivator.bc != null) { - try { - Object ssecurity = UtilActivator.bc.getProperty("equinox.security"); - security = ssecurity != null && !"none".equals(ssecurity); - } catch (Throwable t) { - // no security implementation. - } - } else { - try { - Object ssecurity = System.getProperty("equinox.security"); - security = ssecurity != null && !"none".equals(ssecurity); - } catch (Throwable t) { - // no security implementation. - } - } - return security; - } - - String baseName; - boolean synch; - FileOutputStream fos = null; - static String logsdir = null; - - static Queue queue; - static boolean running = false; - static Saver saver; - // boolean date = false; - long lastTime; - - // byte[] bdate; - - public Log(String baseName, boolean synch, BundleContext bc) { - this(bc); - this.baseName = baseName; - this.synch = synch; - if (!synch) - synchronized (Log.class) { - if (queue == null) { - queue = new Queue(20); - saver = new Saver(); - } - } - } - - public void trace(byte[] bytes) { - if (!synch) - synchronized (queue) { - queue.put(this); - queue.put(bytes); - if (!running) { - running = true; - UtilActivator.thMan.execute(saver, "File Log Thread"); - } - } - else - trace(bytes, 0, bytes.length); - } - - public void trace(byte[] bytes, int off, int len) { - if (logsdir == null) - synchronized (Log.class) { - if (logsdir == null) { - try { - logsdir = UtilActivator.bc.getProperty("equinox.logsDir"); - if (logsdir == null) - logsdir = "./logs"; - File logs = new File(logsdir); - logs.mkdirs(); - } catch (Exception exc) { - exc.printStackTrace(); - } - } - } - if (fos == null) - synchronized (this) { - if (fos == null) { - StringBuilder fname = new StringBuilder(logsdir.length() + baseName.length() + 1); - fname.append(logsdir).append(File.separatorChar).append(baseName); - try { - fos = new FileOutputStream(fname.toString(), true); - } catch (IOException ioExc) { - ioExc.printStackTrace(); - } - } - } - try { - fos.write(bytes, off, len); - fos.write(10); - } catch (IOException ioExc) { - ioExc.printStackTrace(); - } - } - - @Override - public void finalize() { - if (fos != null) - try { - fos.close(); - } catch (IOException ioExc) { - ioExc.printStackTrace(); - } - } - - /** - * Checks the auto print on console flag - * - * @return true, if autoPrintOnConsole is enabled - */ - public boolean isAutoPrintOnConsole() { - return autoPrintOnConsole; - } - - /** - * Enables/disables auto printing on console. This flag points whether - * printing on console should be done if log service is not available - * - * @param autoPrintOnConsole - * if true enables auto print on console else disables it. - */ - public void setAutoPrintOnConsole(boolean autoPrintOnConsole) { - this.autoPrintOnConsole = autoPrintOnConsole; - } - - /** - * Returns whether printing on console should be done for errors - * (exceptions) and warnings - * - * @return Returns the error log level flag - if true the error and warnings - * will be print on console - */ - public boolean isLogErrorLevel() { - return logErrorLevel; - } - - private static final byte OPEN_TYPE = 0; - private static final byte GET_SERVICE_TYPE = 1; - private static final byte GET_SYS_SERVICES_TYPE = 2; - - /** - * @see org.eclipse.equinox.internal.util.security.PrivilegedRunner.PrivilegedDispatcher#dispatchPrivileged(int, - * java.lang.Object, java.lang.Object, java.lang.Object, - * java.lang.Object) - */ - @Override - public Object dispatchPrivileged(int type, Object arg1, Object arg2, Object arg3, Object arg4) throws Exception { - switch (type) { - case OPEN_TYPE : - initListener0(); - break; - case GET_SERVICE_TYPE : - return getService0(); - case GET_SYS_SERVICES_TYPE : - break; - } - return null; - } - -}// Log class - -class Saver implements Runnable { - - @Override - public void run() { - byte[] bytes = null; - Log log = null; - while (true) { - synchronized (Log.queue) { - log = (Log) Log.queue.get(); - if (log == null) { - Log.running = false; - bytes = null; - return; - } - bytes = (byte[]) Log.queue.get(); - } - log.trace(bytes, 0, bytes.length); - } - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/ref/LogInterface.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/ref/LogInterface.java deleted file mode 100644 index a475402f51..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/ref/LogInterface.java +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.ref; - -/** - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public interface LogInterface { - - public boolean printOnConsole = true; - - public boolean debug = false; - - /** - * Logs error messages. If printOnConsole is true, or if the - * LogService is unavailable, log info is printed on console. - * - * @param str - * Message description of the error. - * @param ex - * Throwable object, containing the stack trace; may be null. - */ - public void error(String str, Throwable ex); - - /** - * Logs warning messages. If printOnConsole is true, or if - * the LogService is unavailable, log info is printed on - * console. - * - * @param str - * Message description of the error. - * @param ex - * Throwable object, containing the stack trace; may be null. - */ - public void warning(String str, Throwable ex); - - /** - * Logs info messages. If printOnConsole is true, or if the - * LogService is unavailable, message is printed on console. - * - * @param str - * Message to be logged. - */ - public void info(String str); - - /** - * Logs debug information if debug flag is true. If - * LogService is unaccessible or printOnConsole flag is true, log info is - * printed on console. - * - * @param str - * Message description. - * @param e - * Throwable object, containing the stack trace; may be null. - */ - public void debug(String str, Throwable e); - - /** - * Releases the Log's resources: ungets LogService, removes the - * ServiceListener from the framework and nulls references. After invocation - * of this method, this Log object can be used no longer. - */ - public void close(); - - /** - * enable/diasable print on console - * - * @param value - * boolean if true enables print on console else disables it - */ - public void setPrintOnConsole(boolean value); - - /** - * enable/diasable loging of debug info - * - * @param value - * boolean if true enables loging of debug info else disables it - */ - public void setDebug(boolean value); - - /** - * Gets the flag, which enables logging debug messages. - * - * @return true if debugging is enabled - */ - public boolean getDebug(); - - /** - * Gets the flag, which enables printing log messages on the console. - * - * @return true if printingon console is enabled - */ - public boolean getPrintOnConsole(); - -}// Log class diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/ref/TimerRef.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/ref/TimerRef.java deleted file mode 100644 index 6020d99501..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/ref/TimerRef.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.ref; - -import org.eclipse.equinox.internal.util.timer.Timer; -import org.eclipse.equinox.internal.util.timer.TimerListener; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class TimerRef { - - public static Timer timer = null; - - public static void notifyAfter(TimerListener listener, long millis, int event) { - - if (timer == null) { - listener.timer(event); - return; - } - timer.addNotifyListener(listener, Thread.NORM_PRIORITY, Timer.ONE_SHOT_TIMER, millis, event); - } - - public static void removeListener(TimerListener listener, int event) { - if (timer == null) - return; - timer.removeListener(listener, event); - } -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/ref/package.html b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/ref/package.html deleted file mode 100644 index 63af46c85f..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/ref/package.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - package - - -The Log Reference class, included in this package, is provided to -isolate the bundle writers from the common and often used operations accompanying -logging in the LogService. The Log class deals on behalf of the bundle, -which instanciates it, while getting reference to and listening for events -from the LogService. -

    A bundle, wishing to use the Log reference, must only pass its bundle -context to the Log's constructor, from there on it can log INFO, ERROR, -and DEBUG messages in the LogService, without caring for the availability -even of the Log Bundle. -

    If there are changes in the state of the LogService (e.g. it is REGISTERED, -or UNREGISTERING), the Log class cares to get or unget reference to it. -While the LogService is unavailable, no matter what is the reason for this, -the log information is printed on the server's console. -

    When the Log object should be released, (e.g. in case the bundle owner -will be stopped) the resources, hold by the Log object should also be released: -thus including ungetting LogService reference and removal of the ServiceListener -from the framework. close() method does all the necessary -clean up of ungetting LogService, removal of ServiceListener and -internal variable clean up. -

    When multiple LogServices are available in the service registry, the -Log class gets reference to only one of them. If a bundle wishes to publish -the log information to all of the available LogServices, it can take advantage -of the org.eclipse.equinox.util.tracker.ServiceTracker utility. -

    The Log Reference class implements the LogInterface class. -
      - - diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/security/PrivilegedRunner.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/security/PrivilegedRunner.java deleted file mode 100644 index a6a64287fb..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/security/PrivilegedRunner.java +++ /dev/null @@ -1,172 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.security; - -import java.security.*; -import org.eclipse.equinox.internal.util.pool.ObjectCreator; -import org.eclipse.equinox.internal.util.pool.ObjectPool; - -/** - * A simple wrapper for executing privileged actions. - * - * @author Valentin Valchev - * @author Pavlin Dobrev - * @version 1.0 - */ - -public final class PrivilegedRunner implements ObjectCreator { - - private static ObjectPool POOL; - - static { - try { - POOL = new ObjectPool(new PrivilegedRunner(), 5, 10); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /* prevent instantiations */ - private PrivilegedRunner() { - } - - /** - * Same as the longer doPrivileged method, but fills in the first parameter - * only. All other parameters are set to null. - * - * @param context - * the access context - * @param dispatcher - * the dispatcher which should be called - * @param type - * the type of the action - used in the dispatcher - * @param arg1 - * a parameter received by the dispatcher - * @see #doPrivileged(Object, PrivilegedDispatcher, int, Object) - * @return the object returned from the execution - * @throws Exception - * if the dispatcher fails - */ - public static final Object doPrivileged(Object context, PrivilegedDispatcher dispatcher, int type, Object arg1) throws Exception { - return doPrivileged(context, dispatcher, type, arg1, null, null, null); - } - - /** - * Performs a privileged action. The method calls the dispatcher inside the - * privileged call passing it the same parameters that were passed to this - * method. - * - * @param context - * the access context - * @param dispatcher - * the dispatcher which should be called - * @param type - * the type of the action - used in the dispatcher - * @param arg1 - * a parameter received by the dispatcher - * @param arg2 - * a parameter received by the dispatcher - * @param arg3 - * a parameter received by the dispatcher - * @param arg4 - * a parameter received by the dispatcher - * @return the object returned from the execution - * @throws Exception - * if the dispatcher fails - */ - public static final Object doPrivileged(Object context, PrivilegedDispatcher dispatcher, int type, Object arg1, Object arg2, Object arg3, Object arg4) throws Exception { - /* init runner */ - PA runner = (PA) POOL.getObject(); - runner.dispatcher = dispatcher; - runner.type = type; - runner.arg1 = arg1; - runner.arg2 = arg2; - runner.arg3 = arg3; - runner.arg4 = arg4; - - try { - if (System.getSecurityManager() != null) { - /* - * if security manager is set - then privileged execution is - * started - */ - if (context != null) { - return AccessController.doPrivileged(runner, (AccessControlContext) context); - } - return AccessController.doPrivileged(runner); - } - /* if no security manager is set - simply run the action */ - return runner.run(); - } catch (PrivilegedActionException e) { - throw e.getException(); - } finally { - runner.recycle(); - POOL.releaseObject(runner); - } - } - - @Override - public Object getInstance() throws Exception { - return new PA(); - } - - /** - * This dispatcher is the handler that is called within the privileged call. - * It should dispatch and perform the requested actions depending on the - * action type and using the given job parameters. - * - * @author Valentin Valchev - * @version $Revision: 1.1 $ - */ - public static interface PrivilegedDispatcher { - - /** - * @param type - * the type of the action - * @param arg1 - * parameter 1 - depends on the action type - * @param arg2 - * parameter 2 - depends on the action type - * @param arg3 - * parameter 3 - depends on the action type - * @param arg4 - * parameter 4 - depends on the action type - * @return an object which should be returned from the - * PrivilegedAction.run() method - * @throws Exception - * on error - */ - Object dispatchPrivileged(int type, Object arg1, Object arg2, Object arg3, Object arg4) throws Exception; - } - - static class PA implements PrivilegedExceptionAction { - - int type; - Object arg1, arg2, arg3, arg4; - PrivilegedDispatcher dispatcher; - - void recycle() { - dispatcher = null; - type = -1; - arg1 = arg2 = arg3 = arg4 = null; - } - - @Override - public Object run() throws Exception { - return dispatcher.dispatchPrivileged(type, arg1, arg2, arg3, arg4); - } - } - -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/security/SecurityUtil.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/security/SecurityUtil.java deleted file mode 100644 index 84936360b1..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/security/SecurityUtil.java +++ /dev/null @@ -1,756 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2018 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.security; - -import java.io.*; -import java.util.Dictionary; -import org.eclipse.equinox.internal.util.UtilActivator; -import org.osgi.framework.*; - -/** - * Utility class to execute common privileged code. - * - * @author Valentin Valchev - * @author Pavlin Dobrev - * @version 1.0 - */ - -public final class SecurityUtil implements PrivilegedRunner.PrivilegedDispatcher { - - private Object controlContext; - - private static final int SYSTEM_GET_PROPERTY = 41; - private static final int CREATE_THREAD = 42; - private static final int CLASS_FOR_NAME = 43; - private static final int SYSTEM_SET_PROPERTY = 44; - - private static final int FILE_BASE = 50; - private static final int FILE_GET_INPUT_STREAM = FILE_BASE + 0; - private static final int FILE_GET_OUTPUT_STREAM = FILE_BASE + 1; - private static final int FILE_LENGTH = FILE_BASE + 2; - private static final int FILE_EXISTS = FILE_BASE + 3; - private static final int FILE_ISDIR = FILE_BASE + 4; - private static final int FILE_LAST_MODIFIED = FILE_BASE + 5; - private static final int FILE_LIST = FILE_BASE + 6; - private static final int FILE_DELETE = FILE_BASE + 7; - private static final int FILE_RENAME = FILE_BASE + 8; - private static final int FILE_GET_RANDOM_ACCESS_FILE = FILE_BASE + 9; - - private static final int SERVICE_BASE = 60; - private static final int SERVICE_GET_REFERENCE = SERVICE_BASE + 0; - private static final int SERVICE_GET_SERVICE = SERVICE_BASE + 1; - private static final int SERVICE_REG_CLASS = SERVICE_BASE + 2; - private static final int SERVICE_REG_CLASSES = SERVICE_BASE + 3; - - private static final int BUNDLE_BASE = 70; - private static final int BUNDLE_GET_LOCATION = BUNDLE_BASE + 0; - private static final int BUNDLE_GET_HEADERS = BUNDLE_BASE + 1; - private static final int BUNDLE_START = BUNDLE_BASE + 2; - private static final int BUNDLE_STOP = BUNDLE_BASE + 3; - private static final int BUNDLE_UNINSTALL = BUNDLE_BASE + 4; - private static final int BUNDLE_UPDATE = BUNDLE_BASE + 5; - private static final int BUNDLE_UPDATE_IS = BUNDLE_BASE + 6; - - /** - * Constructs a new SecureAction object. The constructed SecureAction object - * uses the caller's AccessControlContext to perform security checks - */ - public SecurityUtil() { - // save the control context to be used. - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - controlContext = sm.getSecurityContext(); - } - } - - /** - * Creates a new Thread from a Runnable. Same as calling new - * Thread(target,name). - * - * @param target - * the Runnable to create the Thread from. - * @param name - * The name of the Thread. - * @return The new Thread - */ - public Thread createThread(final Runnable target, final String name) { - try { - return (Thread) PrivilegedRunner.doPrivileged(controlContext, this, CREATE_THREAD, target, name, null, null); - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Returns a Class. Same as calling Class.forName(name) - * - * @param name - * the name of the class. - * @return a Class - * @throws ClassNotFoundException - */ - public Class forName(final String name) throws ClassNotFoundException { - try { - return (Class) PrivilegedRunner.doPrivileged(controlContext, this, CLASS_FOR_NAME, name, null, null, null); - } catch (ClassNotFoundException t) { - throw t; - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Returns a system property. Same as calling System.getProperty(String). - * - * @param property - * the property key. - * @return the value of the property or null if it does not exist. - */ - public String getProperty(final String property) { - if (property == null) { - throw new NullPointerException("property is null"); - } - String ret; - try { - ret = (String) PrivilegedRunner.doPrivileged(controlContext, this, SYSTEM_GET_PROPERTY, property, null, null, null); - } catch (Exception t) { - ret = null; - } - return ret; - } - - /** - * Returns a system property. Same as calling - * System.getProperty(String,String). - * - * @param property - * the property key. - * @param def - * the default value if the property key does not exist. - * @return the value of the property or the default value if the property - * does not exist. - */ - public String getProperty(final String property, final String def) { - String ret = getProperty(property); - return ret != null ? ret : def; - } - - /** - * Returns a boolean system property. Same as calling - * Boolean.getBoolean(String). - * - * @param property - * the property key. - * @return the value of the property or false, if not set - */ - public boolean getBooleanProperty(final String property) { - String ret = getProperty(property); - return ret != null ? Boolean.valueOf(ret).booleanValue() : false; - } - - /** - * Sets a system property. Same as System.setProperty() - * - * @param key - * the name of the property - * @param value - * the value of the system property - * @return the old value of the property, or null - */ - public String setProperty(final String key, final String value) { - if (key == null) { - throw new NullPointerException("key is null"); - } - if (value == null) { - throw new NullPointerException("key is null"); - } - try { - return (String) PrivilegedRunner.doPrivileged(controlContext, this, SYSTEM_SET_PROPERTY, key, value, null, null); - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Creates a FileInputStream from a File. Same as calling new - * FileInputStream(File). - * - * @param file - * the File to create a FileInputStream from. - * @return The FileInputStream. - * @throws FileNotFoundException - * if the File does not exist. - */ - public FileInputStream getFileInputStream(final File file) throws FileNotFoundException { - try { - return (FileInputStream) PrivilegedRunner.doPrivileged(controlContext, this, FILE_GET_INPUT_STREAM, file, null, null, null); - } catch (FileNotFoundException t) { - throw t; - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Creates a random access file - * - * @param file - * the file object - * @param mode - * the open mode - * @return the random seekable file object - * @throws FileNotFoundException - * if the File does not exist - */ - public RandomAccessFile getRandomAccessFile(final File file, final String mode) throws FileNotFoundException { - try { - return (RandomAccessFile) PrivilegedRunner.doPrivileged(controlContext, this, FILE_GET_RANDOM_ACCESS_FILE, file, mode, null, null); - } catch (FileNotFoundException t) { - throw t; - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Creates a FileInputStream from a File. Same as calling new - * FileOutputStream(File,boolean). - * - * @param file - * the File to create a FileOutputStream from. - * @param append - * indicates if the OutputStream should append content. - * @return The FileOutputStream. - * @throws FileNotFoundException - * if the File does not exist. - */ - public FileOutputStream getFileOutputStream(final File file, final boolean append) throws FileNotFoundException { - try { - return (FileOutputStream) PrivilegedRunner.doPrivileged(// - controlContext, this, FILE_GET_OUTPUT_STREAM, file, // - append ? Boolean.TRUE : Boolean.FALSE, null, null); - } catch (FileNotFoundException t) { - throw t; - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Returns true if a file exists, otherwise false is returned. Same as - * calling file.exists(). - * - * @param file - * a file object - * @return true if a file exists, otherwise false - */ - public boolean exists(final File file) { - try { - return ((Boolean) PrivilegedRunner.doPrivileged(controlContext, this, FILE_EXISTS, file, null, null, null)).booleanValue(); - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Returns true if a file is a directory, otherwise false is returned. Same - * as calling file.isDirectory(). - * - * @param file - * a file object - * @return true if a file is a directory, otherwise false - */ - public boolean isDirectory(final File file) { - try { - return ((Boolean) PrivilegedRunner.doPrivileged(controlContext, this, FILE_ISDIR, file, null, null, null)).booleanValue(); - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Returns the length of a file. Same as calling file.length(). - * - * @param file - * a file object - * @return the length of a file or -1 if file doesn't exists - */ - public long length(final File file) { - try { - return ((Long) PrivilegedRunner.doPrivileged(controlContext, this, FILE_LENGTH, file, null, null, null)).longValue(); - } catch (Throwable t) { - return -1L; - } - } - - /** - * Returns a file's last modified stamp. Same as calling - * file.lastModified(). - * - * @param file - * a file object - * @return a file's last modified stamp or -1 if file doesn't exists - */ - public long lastModified(final File file) { - try { - return ((Long) PrivilegedRunner.doPrivileged(controlContext, this, FILE_LAST_MODIFIED, file, null, null, null)).longValue(); - } catch (Exception t) { - return -1L; - } - } - - /** - * Returns a file's list. Same as calling file.list(). - * - * @param file - * a file object - * @return a file's list. - */ - public String[] list(final File file) { - try { - return (String[]) PrivilegedRunner.doPrivileged(controlContext, this, FILE_LIST, file, null, null, null); - } catch (Exception t) { - return null; - } - } - - /** - * Deletes the specified file. Same as File.delete() - * - * @param file - * the file object - * @return if delete succeeded - */ - public boolean delete(final File file) { - try { - return ((Boolean) PrivilegedRunner.doPrivileged(controlContext, this, FILE_DELETE, file, null, null, null)).booleanValue(); - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Renames the source file to the target name. Same as File.renameTo(File) - * - * @param source - * the file object, that will be renamed - * @param target - * the target file name - * @return if rename succeeded - */ - public boolean renameTo(final File source, final File target) { - try { - return ((Boolean) PrivilegedRunner.doPrivileged(controlContext, this, FILE_RENAME, source, target, null, null)).booleanValue(); - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Gets a service object. Same as calling context.getService(reference) - * - * @param reference - * the ServiceReference - * @param context - * the BundleContext - * @return a service object - */ - public Object getService(final ServiceReference reference, final BundleContext context) { - if (context == null) { - throw new NullPointerException("Context is null"); - } - if (reference == null) { - throw new NullPointerException("Reference is null"); - } - try { - return PrivilegedRunner.doPrivileged(controlContext, this, SERVICE_GET_SERVICE, context, reference, null, null); - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Gets a reference for the specified service(s). Same as calling - * context.getServiceReferences(class, filter) - * - * @param clazz - * the name of the requested service class - * @param filter - * an LDAP filter - * @param context - * the BundleContext - * @return a list of reference or null - * @throws InvalidSyntaxException - * if filter is not correct - */ - public ServiceReference[] getServiceReferences(String clazz, String filter, BundleContext context) throws InvalidSyntaxException { - if (context == null) { - throw new NullPointerException("Context is null"); - } - if (clazz == null && filter == null) { - throw new NullPointerException("Either filter or clazz parameter should not be null"); - } - try { - return (ServiceReference[]) PrivilegedRunner.doPrivileged(controlContext, this, SERVICE_GET_REFERENCE, context, clazz, filter, null); - } catch (InvalidSyntaxException e) { - throw e; - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Registers a service. Same as BundleContext.register(clazz, service, - * properties); - * - * @param clazz - * the class name of the service - * @param service - * the service instance - * @param properties - * the properties. - * @param context - * the bundle context - * @return a service registration - */ - public ServiceRegistration registerService(String clazz, Object service, Dictionary properties, BundleContext context) { - if (context == null) { - throw new NullPointerException("Context is null"); - } - if (service == null) { - throw new NullPointerException("Service is null"); - } - if (clazz == null) { - throw new NullPointerException("Class name is null"); - } - try { - return (ServiceRegistration) PrivilegedRunner.doPrivileged(controlContext, this, SERVICE_REG_CLASS, context, clazz, service, properties); - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Registers a instance that implements many services. Same as - * BundleContext.register(clases, service, properties); - * - * @param classes - * the class names of the service - * @param service - * the service instance - * @param properties - * the properties. - * @param context - * the bundle context - * @return a service registration - */ - public ServiceRegistration registerService(String[] classes, Object service, Dictionary properties, BundleContext context) { - if (context == null) { - throw new NullPointerException("Context is null"); - } - if (service == null) { - throw new NullPointerException("Service is null"); - } - if (classes == null) { - throw new NullPointerException("Class names are null"); - } - try { - return (ServiceRegistration) PrivilegedRunner.doPrivileged(controlContext, this, SERVICE_REG_CLASSES, context, classes, service, properties); - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Gets the location of the bundle. Same as Bundle.getLocation(). - * - * @param bundle - * the bundle - * @return the bundle location - */ - public String getLocation(Bundle bundle) { - try { - return (String) PrivilegedRunner.doPrivileged(controlContext, this, BUNDLE_GET_LOCATION, bundle, null, null, null); - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Gets the bundle headers. Same as Bundle.getHeaders(). - * - * @param bundle - * the bundle - * @return the bundle location - */ - public Dictionary getHeaders(Bundle bundle) { - try { - return (Dictionary) PrivilegedRunner.doPrivileged(controlContext, this, BUNDLE_GET_HEADERS, bundle, null, null, null); - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Starts the bundle. Same as Bundle.start() - * - * @param bundle - * the bundle - * @throws BundleException - */ - public void start(Bundle bundle) throws BundleException { - try { - PrivilegedRunner.doPrivileged(controlContext, this, BUNDLE_START, bundle, null, null, null); - } catch (BundleException t) { - throw t; - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Stops the bundle. Same as Bundle.stop() - * - * @param bundle - * the bundle - * @throws BundleException - */ - public void stop(Bundle bundle) throws BundleException { - try { - PrivilegedRunner.doPrivileged(controlContext, this, BUNDLE_STOP, bundle, null, null, null); - } catch (BundleException t) { - throw t; - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Un-installs the bundle. Same as Bundle.uninstall() - * - * @param bundle - * the bundle - * @throws BundleException - */ - public void uninstall(Bundle bundle) throws BundleException { - try { - PrivilegedRunner.doPrivileged(controlContext, this, BUNDLE_UNINSTALL, bundle, null, null, null); - } catch (BundleException t) { - throw t; - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Updates the bundle. Same as Bundle.update() - * - * @param bundle - * the bundle - * @throws BundleException - */ - public void update(Bundle bundle) throws BundleException { - try { - PrivilegedRunner.doPrivileged(controlContext, this, BUNDLE_UPDATE, bundle, null, null, null); - } catch (BundleException t) { - throw t; - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Updates the bundle from stream. Same as Bundle.update(stream) - * - * @param bundle - * the bundle - * @param is - * the stream - * @throws BundleException - */ - public void update(Bundle bundle, InputStream is) throws BundleException { - try { - PrivilegedRunner.doPrivileged(controlContext, this, BUNDLE_UPDATE_IS, bundle, is, null, null); - } catch (BundleException t) { - throw t; - } catch (Exception t) { - throw new RuntimeException(t.getMessage()); - } - } - - /** - * Performs a privileged action using the current security context. - * The method calls the dispatcher inside the privileged call passing it the - * same parameters that were passed to this method. - * - * @param dispatcher - * the dispatcher which should be called - * @param type - * the type of the action - used in the dispatcher - * @param arg1 - * a parameter received by the dispatcher - * @param arg2 - * a parameter received by the dispatcher - * @param arg3 - * a parameter received by the dispatcher - * @param arg4 - * a parameter received by the dispatcher - * @return the object returned from the execution - * @throws Exception - * if the dispatcher fails - * @see PrivilegedRunner#doPrivileged(Object, - * org.eclipse.equinox.internal.util.security.PrivilegedRunner.PrivilegedDispatcher, - * int, Object, Object, Object, Object) - */ - public Object doPrivileged(PrivilegedRunner.PrivilegedDispatcher dispatcher, int type, Object arg1, Object arg2, Object arg3, Object arg4) throws Exception { - return PrivilegedRunner.doPrivileged(controlContext, dispatcher, type, arg1, arg2, arg3, arg4); - } - - /** - * Performs a privileged action using the current security context. - * The method calls the dispatcher inside the privileged call passing it the - * same parameters that were passed to this method. - * - * @param dispatcher - * the dispatcher which should be called - * @param type - * the type of the action - used in the dispatcher - * @param arg1 - * a parameter received by the dispatcher - * @param arg2 - * a parameter received by the dispatcher - * @param arg3 - * a parameter received by the dispatcher - * @return the object returned from the execution - * @throws Exception - * if the dispatcher fails - * @see PrivilegedRunner#doPrivileged(Object, - * org.eclipse.equinox.internal.util.security.PrivilegedRunner.PrivilegedDispatcher, - * int, Object, Object, Object, Object) - */ - public Object doPrivileged(PrivilegedRunner.PrivilegedDispatcher dispatcher, int type, Object arg1, Object arg2, Object arg3) throws Exception { - return PrivilegedRunner.doPrivileged(controlContext, dispatcher, type, arg1, arg2, arg3, null); - } - - /** - * Performs a privileged action using the current security context. - * The method calls the dispatcher inside the privileged call passing it the - * same parameters that were passed to this method. - * - * @param dispatcher - * the dispatcher which should be called - * @param type - * the type of the action - used in the dispatcher - * @param arg1 - * a parameter received by the dispatcher - * @param arg2 - * a parameter received by the dispatcher - * @return the object returned from the execution - * @throws Exception - * if the dispatcher fails - * @see PrivilegedRunner#doPrivileged(Object, - * org.eclipse.equinox.internal.util.security.PrivilegedRunner.PrivilegedDispatcher, - * int, Object, Object, Object, Object) - */ - public Object doPrivileged(PrivilegedRunner.PrivilegedDispatcher dispatcher, int type, Object arg1, Object arg2) throws Exception { - return PrivilegedRunner.doPrivileged(controlContext, dispatcher, type, arg1, arg2, null, null); - } - - /** - * Performs a privileged action using the current security context. - * The method calls the dispatcher inside the privileged call passing it the - * same parameters that were passed to this method. - * - * @param dispatcher - * the dispatcher which should be called - * @param type - * the type of the action - used in the dispatcher - * @param arg1 - * a parameter received by the dispatcher - * @return the object returned from the execution - * @throws Exception - * if the dispatcher fails - * @see PrivilegedRunner#doPrivileged(Object, - * org.eclipse.equinox.internal.util.security.PrivilegedRunner.PrivilegedDispatcher, - * int, Object, Object, Object, Object) - */ - public Object doPrivileged(PrivilegedRunner.PrivilegedDispatcher dispatcher, int type, Object arg1) throws Exception { - return PrivilegedRunner.doPrivileged(controlContext, dispatcher, type, arg1, null, null, null); - } - - @SuppressWarnings("unchecked") - @Override - public Object dispatchPrivileged(int type, Object arg1, Object arg2, Object arg3, Object arg4) throws Exception { - switch (type) { - case SYSTEM_GET_PROPERTY : - return UtilActivator.bc.getProperty((String) arg1); - case CREATE_THREAD : - return new Thread((Runnable) arg1, (String) arg2); - case CLASS_FOR_NAME : - return Class.forName((String) arg1); - case SYSTEM_SET_PROPERTY : - return System.getProperties().put(arg1, arg2); - case FILE_GET_INPUT_STREAM : - return new FileInputStream((File) arg1); - case FILE_GET_OUTPUT_STREAM : - return new FileOutputStream(((File) arg1).getAbsolutePath(), ((Boolean) arg2).booleanValue()); - case FILE_LENGTH : - return Long.valueOf(((File) arg1).length()); - case FILE_EXISTS : - return ((File) arg1).exists() ? Boolean.TRUE : Boolean.FALSE; - case FILE_ISDIR : - return ((File) arg1).isDirectory() ? Boolean.TRUE : Boolean.FALSE; - case FILE_LAST_MODIFIED : - return Long.valueOf(((File) arg1).lastModified()); - case FILE_LIST : - return ((File) arg1).list(); - case FILE_DELETE : - return ((File) arg1).delete() ? Boolean.TRUE : Boolean.FALSE; - case FILE_RENAME : - return ((File) arg1).renameTo(((File) arg2)) ? Boolean.TRUE : Boolean.FALSE; - case FILE_GET_RANDOM_ACCESS_FILE : - return new RandomAccessFile((File) arg1, (String) arg2); - case SERVICE_GET_REFERENCE : - return ((BundleContext) arg1).getServiceReferences((String) arg2, (String) arg3); - case SERVICE_GET_SERVICE : - return ((BundleContext) arg1).getService((ServiceReference) arg2); - case SERVICE_REG_CLASS : - return ((BundleContext) arg1).registerService((String) arg2, arg3, (Dictionary) arg4); - case SERVICE_REG_CLASSES : - return ((BundleContext) arg1).registerService((String[]) arg2, arg3, (Dictionary) arg4); - case BUNDLE_GET_LOCATION : - return ((Bundle) arg1).getLocation(); - case BUNDLE_GET_HEADERS : - return ((Bundle) arg1).getHeaders(); - case BUNDLE_START : - ((Bundle) arg1).start(); - break; - case BUNDLE_STOP : - ((Bundle) arg1).stop(); - break; - case BUNDLE_UNINSTALL : - ((Bundle) arg1).uninstall(); - break; - case BUNDLE_UPDATE : - ((Bundle) arg1).update(); - break; - case BUNDLE_UPDATE_IS : - ((Bundle) arg1).update((InputStream) arg2); - break; - } - return null; - } - -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/security/package.html b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/security/package.html deleted file mode 100644 index 0a41244ec8..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/security/package.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - -org.eclipse.equinox.util.jar - - -

    The package provides additional functionality to java.util.jar packages.

    - - diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/threadpool/ThreadContext.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/threadpool/ThreadContext.java deleted file mode 100644 index 3307538360..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/threadpool/ThreadContext.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.threadpool; - -/** - * Gives access to the user-provided Runnable object of the thread. All threads - * created by the ThreadPoolManager service implement that interface, so that in - * a method called by such a thread you can get the Runnable object provided in - * - * ThreadPoolManager.execute(Runnable job, String threadName) - * with the following line: - *

    - *

      Runnable runnable = ((ThreadContext) Thread.currentThread()).getRunnable();
    - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public interface ThreadContext { - /** - * Returns the Runnable object provided in the - * ThreadPoolManager.execute(Runnable job, String threadName) - * method. - */ - public Runnable getRunnable(); -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/threadpool/ThreadPoolFactory.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/threadpool/ThreadPoolFactory.java deleted file mode 100644 index 06740f8d8b..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/threadpool/ThreadPoolFactory.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.threadpool; - - -/** - * This interface is registered as a service in the framework. It allows bundles - * to specify the amount of threads they will need for their normal work. A - * bundle may be executing no more than a specified number of threads at the - * same time. This interface is provided in order to prevent a scenario where - * one bundle allocates all threads, thus freezing all other thread requestors. - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public interface ThreadPoolFactory { - - /** - * Gets reference to the thread pool, by specifying how many threads will be - * simultaneously engaged by the requesting bundle. All execution requests - * above this number are put in a waiting queue until a threads is free. - * - * @param poolSize - * count of threads that can be simultaneously used by the - * requestor - * @param sizeIsInPercents - * indicates if the poolSize is percent of the maximum number of - * threads in the pool (true) or is a fixed count (false) - * @return reference to the thread pool manager - */ - public ThreadPoolManager getThreadPool(int poolSize, boolean sizeIsInPercents); -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/threadpool/ThreadPoolManager.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/threadpool/ThreadPoolManager.java deleted file mode 100644 index 8c0d2197df..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/threadpool/ThreadPoolManager.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.threadpool; - -/** - * The ThreadPoolManager is responsible for the management of a thread pool, - * whose purpose is to provide created and started threads to clients, using - * multiple but short-lived threads. - * - * The ThreadPoolManager's main task is to accept Runnable objects, to pass them - * to threads from the pool, and after the job is finished - to return back the - * threads in pool. - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public interface ThreadPoolManager { - - /** - * Executes the job, by passing it to an idle thread process. If no idle - * threads are available, the job is moved to the pool of waiting jobs, and - * will be executed later. - * - * @param job - * job to be executed - * @param threadName - * name of job; the name will be assigned to the thread, in which - * the job will be processed - * @exception IllegalArgumentException - * If any of the arguments is null - */ - public void execute(Runnable job, String threadName) throws IllegalArgumentException; - - /** - * Executes the job, by passing it to an idle thread process. If no idle - * threads are available, the job is moved to the pool of waiting jobs, and - * will be executed later. - * - * @param job - * Runnable job to be executed - * @param priority - * the priority of the job - * @param threadName - * name of job; the name will be assigned to the thread, in which - * the job will be processed - * @exception IllegalArgumentException - * If any of the arguments is null - */ - public void execute(Runnable job, int priority, String threadName) throws IllegalArgumentException; - - /** - * All idle threads exit. New threads will be created when it is necessary. - */ - public void reset(); -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/threadpool/package.html b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/threadpool/package.html deleted file mode 100644 index d3b4098221..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/threadpool/package.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - ThreadPool - - - - - - -

    This package contains the ThreadPoolManager -interface, which is the face of the ThreadPoolManager Service. The -task of the ThreadPoolManager is to provide created and started -threads to its clients. The idea is to be saved time for the creation -and starting of threads, when multiple, short-lived threads are used. -

    -

    At startup the ThreadPoolManager creates and starts a given number -of threads put in waiting state. While working new threads can be -created but the number of all threads created by the -ThreadPoolManager can not exceed a fixed limit. -

    -

    When a client passes a job for execution to the ThreadPoolManager, -it immediately tries to run the job. If there is an idle thread in -the pool - the job is run, otherwise the job is put in waiting state -until a thread finishes its current job and is ready to accept -another one. -

    -

    If the Runnable objects, passed to the ThreadPoolManager do not -face the requirements of short-living, there is a possibility to slow -down the work of thread processing as many jobs can be put in waiting -state. Another problem appears when processing bad-written Runnable -objects (never exiting their run method), then the number of free -threads decreases, the number of already running threads will reach -the limit, and it may occur that no more threads can be processed. -

    -

    Here is a simple example of a job -(RunnableSample) that is passed to the ThreadPoolManager for -execution. The job is simple and common: it waits for an event to -occur to process an operation; if the event does not occur for a -given time period (1 second in our example) another operation is -processed. In the example below the event is the "check" -flag to be turned on, and the operations are "System.out.println". -
      -

    - - - - -
    -
    public - class RunnableSample implements Runnable {
      - private Object synch;
      - private String name;
      - private boolean check;
      -
      - //Constructs a RunnableSample.
      - public RunnableSample(String name) {
        - this.name = name;
        - check = false;
        - synch = new Object();
      - }
      -
      //This - method is executed by the ThreadPoolManager.
      - public void run() {
        - synchronized (synch) {
          - System.out.println("Job  "  + name + " - starts running!");
          - if (!check) {
            - try {
              - synch.wait(1000);
            - } catch (InterruptedException e) {
            - }
          - }
          - if (check) {
            - System.out.println("OK: CHECKED");
          - } else {
            - System.out.println("NOT OK: NOT CHECKED"); -
          - }
        - }
      - } -
    -
      - //Turns the check flag on. 
      - public void checkIt() {
        - synchronized (synch) {
          - check = true;
          - synch.notify();
        - }
      - } -
    -
      - //Wakes up this Runnable object, causing exiting its run method. -
      public - void stopIt() {
        - synchronized (synch) {
          - synch.notify();
        - }
      - }
    } -
     
    -
    -

    The sample code , which follows, gets -reference to the ThreadPoolManager, and passes a RunnableSample job -for execution.
      -

    - - - - -
    -

    import - org.eclipse.equinox.util.threadpool.ThreadPoolManager; -
    import - org.osgi.framework.BundleContext;
    import - org.osgi.framework.ServiceReference;
      - ...
      - BundleContext bc;
      - ServiceReference thManRef;
      - ThreadPoolManager thMan;
      - ... -

    -

      thManRef - = - bc.getServiceReference("org.eclipse.equinox.util.threadpool.ThreadPoolManager");  -
      thMan = - (ThreadPoolManager) bc.getService(thManRef);
      - String  jobName = "RunnableSample"; -
      - //ThreadPoolManager will execute the job, as soon as a free thread - is available
      - thMan.execute(new RunnableSample(jobName), jobName); -
      ... -
     

    -
    -

    The ThreadPoolManager has two system properties, which define the -limits of the thread pool: -

    -
      -
    • equinox.util.threadpool.minThreads - : default value: 4; this property defines the minimum number of idle - threads. The property cannot be 1 - if it is set to 1, automatically - it is turned to 2. -

      -
    • equinox.util.threadpool.maxThreads : default value: 48; - this property specifies the upper limit for the number of threads - in the thread pool. The real limit is calculated using the formula: - (((int)(max/min)) * min).

      -
    • equinox.util.threadpool.autoMaximum : default value: - false; if this property is set to true the then if there are more - then 10 waitng jobs the maximum can be exceeded.

      -
    • equinox.util.threadpool.ignoreMaximum : default value: - false; if this property is set to true, the Thread Pool Manager will - not regard the maxThread property and will always create new threads - when there are no available.

      -
    • equinox.util.threadpool.useNames : default value: false; - if this property is set to true, allows assigning names to threads, - executing runnable jobs.

      -
    • equinox.util.threadpool.percent : default value: 30; this - property specifies what default percent of the maximum number of - threads a bundle can occupy from the thread pool.

      - -
    - - \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/timer/Timer.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/timer/Timer.java deleted file mode 100644 index 366ab1752d..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/timer/Timer.java +++ /dev/null @@ -1,197 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.timer; - -/** - * Timer service provides means for sending notifications at given time periods - * to each listener registered with Timer. To receive notifications, a module - * should first register a TimerListener, associated with an (int) event and a - * time period. When the time period passes, TimerListener's timer method is - * invoked, and the listener is removed from the queue with the waiting event - * notifications. - * - * @see TimerListener - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public interface Timer { - - /** - * Constant indicates that timer listener will be notified only once and - * afterwards discarded. - */ - public int ONE_SHOT_TIMER = 0; - - /** - * Constant indicates that timer listener will be notified periodically at a - * given time interval. - */ - public int PERIODICAL_TIMER = 1; - - /** - * Constant indicates that timer listener will be notified only once. Timer - * implementation would do its best to execute the notification with minimum - * possible delay. - */ - public int ONE_SHOT_TIMER_NO_DELAY = 2; - - /** - * Constant indicates that timer listener will be notified periodically at a - * given time interval. Timer implementation would do its best to execute - * the notification with minimum possible delay. - */ - public int PERIODICAL_TIMER_NO_DELAY = 3; - - /** - * Adds new TimerListener to the timer event quueue. The listener will be - * notified after the given timePeriod with specified - * event. If the event queue already contains a listener and - * event pair equal to those being passed, then the old notification object - * is removed from queue and the new data takes its place. - * - * @param listener - * the listener which will be notified after the given time - * period - * @param timePeriod - * time period in milliseconds after which the listener will be - * notified - * @param event - * which will be supplied to the listener when it is notified - * - * @exception IllegalArgumentException - * if time period is not positive - * @deprecated - */ - @Deprecated - public void notifyAfterMillis(TimerListener listener, long timePeriod, int event) throws IllegalArgumentException; - - /** - * Adds new TimerListener to the timer event quueue. The listener will be - * notified after the given timePeriod with specified - * event. If the event queue already contains a listener and - * event pair equal to those being passed, then the old notification object - * is removed from queue and the new data takes its place. - * - * @param listener - * the listener which will be notified after the given time - * period - * @param priority - * priority of executing thread - * @param timePeriod - * time period in milliseconds after which the listener will be - * notified - * @param event - * which will be supplied to the listener when it is notified - * - * @exception IllegalArgumentException - * if time period is not positive priority is not between - * Thread.MIN_PRIORITY and Thread.MAX_PRIORITY - * @deprecated - */ - @Deprecated - public void notifyAfterMillis(TimerListener listener, int priority, long timePeriod, int event) throws IllegalArgumentException; - - /** - * Adds new TimerListener to the timer event quueue. The listener will be - * notified after the given timePeriod with specified - * event. If the event queue already contains a listener and - * event pair equal to those being passed, then the old notification object - * is removed from queue and the new data takes its place. - * - * @param listener - * the listener which will be notified after the given time - * period - * @param timePeriod - * time period in seconds after which the listener will be - * notified - * @param event - * which will be supplied to the listener when it is notified - * - * @exception IllegalArgumentException - * if time period is not positive - * @deprecated - */ - @Deprecated - public void notifyAfter(TimerListener listener, int timePeriod, int event) throws IllegalArgumentException; - - /** - * Adds new TimerListener to the timer event quueue. The listener will be - * notified after the given timePeriod with specified - * event. If the event queue already contains a listener and - * event pair equal to those being passed, then the old notification object - * is removed from queue and the new data takes its place. - * - * @param listener - * the listener which will be notified after the given time - * period - * @param priority - * priority of executing thread - * @param timePeriod - * time period in seconds after which the listener will be - * notified - * @param event - * which will be supplied to the listener when it is notified - * - * @exception IllegalArgumentException - * if time period is not positive or priority is not between - * Thread.MIN_PRIORITY and Thread.MAX_PRIORITY - * @deprecated - */ - @Deprecated - public void notifyAfter(TimerListener listener, int priority, int timePeriod, int event) throws IllegalArgumentException; - - /** - * Adds new TimerListener to the timer event quueue. The listener will be - * notified after the given timePeriod with specified - * event. If the event queue already contains a listener and - * event pair equal to those being passed, then the old notification object - * is removed from queue and the new data takes its place. - * - * @param listener - * the listener which will be notified after the given time - * period - * @param priority - * priority of executing thread - * @param timerType - * the type of the timer "Periodical", "One shot", "Periodical No - * Delay", or "One shot no delay" - * @param timePeriod - * time period in seconds after which the listener will be - * notified - * @param event - * which will be supplied to the listener when it is notified - * - * @exception IllegalArgumentException - * if time period is not positive or priority is not between - * Thread.MIN_PRIORITY and Thread.MAX_PRIORITY or the - * timerType is not a correct timer type or the listener is - * null - */ - public void addNotifyListener(TimerListener listener, int priority, int timerType, long periodMilis, int event); - - /** - * Removes the TimerListener-event pair from the queue, so that the listener - * should not be notified after the time period passes. - * - * @param listener - * to be removed. - * @param event - * for which the timer listener should have been notified. - * - */ - public void removeListener(TimerListener listener, int event); -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/timer/TimerListener.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/timer/TimerListener.java deleted file mode 100644 index 4128f200b9..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/timer/TimerListener.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.util.timer; - -/** - * This interface must be implemented by all classes which wish to be registered - * to the Timer service and to be notified after given time periods. - * - * @see Timer - * - * @author Pavlin Dobrev - * @version 1.0 - */ - -public interface TimerListener { - - /** - * This method will be invoked by Timer to notify the listener for the - * expiration of its time period. - * - * @param event - * the event code which is supplied when this listener had been - * registered - */ - public void timer(int event); - -} diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/timer/package.html b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/timer/package.html deleted file mode 100644 index 1f965479b7..0000000000 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/timer/package.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - -org.eclipse.equinox.util.timer - - - - -

    This package adds the Timer Service by -adding two additional interfaces. The idea is the Timer Service -to provide universal timers which can be used by other bundles if -they need them. When the Util Bundle is started, the Timer -Service is registered and started, too. To use the Timer Service, -you have to get it from the Bundle Context.

    - -

    To create a timer, you must invoke Timer's method notifyAfter(listener, -timePeriod, event) and pass correct parameters to it.

    - -
    -

    listener is object of a class implementing the - TimerListener interface whose time(event) method - will be invoked after the given timePeriod (in seconds) - with event specified in the notifyAfter method. The - Timer Service makes an event queue from all started timer - listeners and when some timePeriod of them passes, it - invokes its timer method with specified event and - removes it from queue. If the notifyAfter method is - invoked with listener and event that already exist in queue, - the previous listener is removed and the new one replaces it.

    -
    - -
    -

    event is an int parameter. When more than one timer - is started with the same listener, event shows which - of them is to be notified.

    -
    - -

    With the removeLisener(listener, event) method it is -possible to remove a listener with the specified event from the -queue before its timePeriod has passed. If the listener -with the specified event is not found, nothing happens.

    - -
    -

    Here is an example which starts 3 timers with diferent - timerPeriod. The timer with lisener lsn1 and event 1 will be - started again with diferent timePeriod, the Timer Service - will remove the previous timer and only new one will stay in - the queue. The timer with lisener lsn2 and event 2 will be - removed from the queue befor its timePeriod has passed. Only - timer with lisener lsn1, timePeriod 5 sec and event 1 will be - notified by the Timer Service when its timePeriod has passed.

    -
    - - - - - -
    -

     
    - public class - TestTimer {
    -   private BundleContext bc;
    -   private ServiceReference timerReference;
    -   private Timer timer;

    -

     public - TestTimer(BundleContext bc) {
    -     try {
    -       this.bc = bc;
    -       timerReference = bc.getServiceReference("org.eclipse.equinox.util.timer.Timer"); -
    -       if (timerReference != - null) {
    -         timer = (Timer)bc.getService(timerReference); -
    -         - setTimerIntervals();         -
    -       }
    -     } catch (Exception e) {
    -       System.out.println("An - error in start method.\n " + e);
    -     }
    -   } 
    -   
    -   private void setTimerIntervals() {
    -     int t;  //timePeriod
    -     int e;  //event
    -     
    -     //create lsn1 lisener implementing - TimerLisener interface
    -     TestTimerListener lsn1 = new - TestTimerListener();
    -     t = 10;
    -     e = 1;
    -     //start timer interval
    -     timer.notifyAfter(lsn1, t, e);
    -     System.out.println("Timer - with lisener lsn1 was started - timePeriod " + t - + " sec, event " + e);
    -     
    -     //create lsn2 lisener implementing - TimerLisener interface
    -     TestTimerListener lsn2 = new - TestTimerListener();
    -     t = 12;
    -     e = 2;
    -     //start timer interval
    -     timer.notifyAfter(lsn2, t, e);
    -     System.out.println("Timer - with lisener lsn2 was started - timePeriod " + t - + " sec, event " + e);

    -

        - t = 5;
    -     e = 1;
    -     //start timer interval
    -     timer.notifyAfter(lsn1, t, e);
    -     System.out.println("Timer - with lisener lsn1 was started - timePeriod " + t - + " sec, event " + e);
    -     System.out.println("\n"); -
    -     
    -     //remove lsn2 lisener with event 1 -
    -     e = 2;
    -     timer.removeListener(lsn2, e);   -
    -   } 
    -   
    - }  
    -  

    -
    -
    - -
    -

    The TestTimerListener class implements the TimerListener - interface and its method timer(event) will be invoked every - time a timerPeriod passes.

    -
    - - - - - -
    -

     
    - public class TestTimerListener implements - TimerListener {
    -   
    -   public TestTimerListener() {
    -   }
    -   
    -   public void timer(int event){
    -     System.out.println("Timer - with event " + event + " has ended");
    -   }  
    - }

    -
    -
    - -







    - - diff --git a/bundles/org.eclipse.equinox.wireadmin/.classpath b/bundles/org.eclipse.equinox.wireadmin/.classpath deleted file mode 100644 index 755d49bc03..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/bundles/org.eclipse.equinox.wireadmin/.project b/bundles/org.eclipse.equinox.wireadmin/.project deleted file mode 100644 index 30bf5cbd5d..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.equinox.wireadmin - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/bundles/org.eclipse.equinox.wireadmin/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.equinox.wireadmin/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/bundles/org.eclipse.equinox.wireadmin/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.wireadmin/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b1c8691de0..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,474 +0,0 @@ -eclipse.preferences.version=1 -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=warning -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.unsafeTypeOperation=warning -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_assignment_statements_on_columns=false -org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false -org.eclipse.jdt.core.formatter.align_with_spaces=false -org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=49 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=0 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=49 -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_assertion_message=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_bitwise_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 -org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 -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_record_components=16 -org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 -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_shift_operator=0 -org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=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_record_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_type_annotations=0 -org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 -org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 -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_last_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=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_statement_group_in_switch=0 -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_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_record_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.align_tags_descriptions_grouped=true -org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false -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.count_line_length_from_starting_position=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=true -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=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=false -org.eclipse.jdt.core.formatter.comment.indent_tag_description=false -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not 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.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=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_record_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=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert -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_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_after_type_annotation=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_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=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_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not 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_record_components=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=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_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not 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_record_declaration=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_relational_operator=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_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert -org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=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_bitwise_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_record_declaration=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_record_components=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_switch_case_expressions=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_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=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_record_constructor=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_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_record_declaration=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_relational_operator=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_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=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_annotation_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never -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_enum_constant_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false -org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never -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_after_code_block=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.text_block_indentation=0 -org.eclipse.jdt.core.formatter.use_on_off_tags=true -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true -org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator=true -org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true -org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true -org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true -org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true -org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true -org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error -org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/bundles/org.eclipse.equinox.wireadmin/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.wireadmin/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 894ba5a9dd..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile -formatter_settings_version=21 -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/bundles/org.eclipse.equinox.wireadmin/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.equinox.wireadmin/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index 5e91ab0f27..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Thu Mar 29 10:31:31 EEST 2007 -eclipse.preferences.version=1 -pluginProject.extensions=false diff --git a/bundles/org.eclipse.equinox.wireadmin/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.wireadmin/META-INF/MANIFEST.MF deleted file mode 100644 index 464fe9637c..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %bundleName -Bundle-SymbolicName: org.eclipse.equinox.wireadmin -Bundle-Version: 1.0.900.qualifier -Bundle-Vendor: %bundleVendor -Bundle-Description: This bundle provides utility classes for Producer and Consumer services. -Bundle-Activator: org.eclipse.equinox.internal.wireadmin.Activator -Import-Package: org.eclipse.equinox.internal.util.hash;version="1.0.0", - org.eclipse.equinox.internal.util.ref;version="1.0.0", - org.osgi.framework, - org.osgi.service.cm;version="1.2", - org.osgi.service.event;version="1.1", - org.osgi.service.wireadmin;version="[1.0,1.1)", - org.osgi.util.tracker;version="1.3" -Export-Package: org.eclipse.equinox.internal.wireadmin; x-internal:=true -Bundle-RequiredExecutionEnvironment: OSGi/Minimum-1.0 -Bundle-Localization: plugin -Automatic-Module-Name: org.eclipse.equinox.wireadmin diff --git a/bundles/org.eclipse.equinox.wireadmin/OSGI-INF/permissions.perm b/bundles/org.eclipse.equinox.wireadmin/OSGI-INF/permissions.perm deleted file mode 100644 index acbf7723ae..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/OSGI-INF/permissions.perm +++ /dev/null @@ -1 +0,0 @@ -(java.security.AllPermission "*" "*") diff --git a/bundles/org.eclipse.equinox.wireadmin/about.html b/bundles/org.eclipse.equinox.wireadmin/about.html deleted file mode 100644 index 164f781a8f..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/about.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - -About - - -

    About This Content

    - -

    November 30, 2017

    -

    License

    - -

    - 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 2.0 ("EPL"). A copy of the EPL is - available at http://www.eclipse.org/legal/epl-2.0. - For purposes of the EPL, "Program" will mean the Content. -

    - -

    - 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 http://www.eclipse.org. -

    - - - \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.wireadmin/build.properties b/bundles/org.eclipse.equinox.wireadmin/build.properties deleted file mode 100644 index 41490f2f19..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/build.properties +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################### -# Copyright (c) 1997-2009 by ProSyst Software GmbH -# http://www.prosyst.com -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# ProSyst Software GmbH - initial API and implementation -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - OSGI-INF/ -src.includes = about.html diff --git a/bundles/org.eclipse.equinox.wireadmin/forceQualifierUpdate.txt b/bundles/org.eclipse.equinox.wireadmin/forceQualifierUpdate.txt deleted file mode 100644 index 56f1032a8a..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/forceQualifierUpdate.txt +++ /dev/null @@ -1,2 +0,0 @@ -# To force a version qualifier update add the bug here -Bug 403352 - Update all parent versions to match our build stream diff --git a/bundles/org.eclipse.equinox.wireadmin/plugin.properties b/bundles/org.eclipse.equinox.wireadmin/plugin.properties deleted file mode 100644 index 746494dbcb..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/plugin.properties +++ /dev/null @@ -1,17 +0,0 @@ -############################################################################### -# Copyright (c) 1997-2009 by ProSyst Software GmbH -# http://www.prosyst.com -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# ProSyst Software GmbH - initial API and implementation -############################################################################### -#Properties file for org.eclipse.equinox.wireadmin -bundleVendor = Eclipse.org - Equinox -bundleName = Wire Admin Service \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.wireadmin/pom.xml b/bundles/org.eclipse.equinox.wireadmin/pom.xml deleted file mode 100644 index f59f4e0670..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - 4.0.0 - - rt.equinox.bundles - org.eclipse.equinox.bundles - 4.24.0-SNAPSHOT - ../../ - - org.eclipse.equinox - org.eclipse.equinox.wireadmin - 1.0.900-SNAPSHOT - eclipse-plugin - diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/Activator.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/Activator.java deleted file mode 100644 index 6d4fc1703e..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/Activator.java +++ /dev/null @@ -1,150 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.wireadmin; - -import org.eclipse.equinox.internal.util.ref.Log; -import org.osgi.framework.*; -import org.osgi.service.cm.ConfigurationAdmin; -import org.osgi.service.wireadmin.*; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class Activator implements BundleActivator, ServiceListener, ServiceFactory { - - static final String PREFIX = "[WireAdmin]: "; - - public static boolean LOG_DEBUG; - static Log log; - - private WireAdminImpl wireAdmin; - private ServiceReference cmRef; - - public static BundleContext bc; - - WireReDispatcher wireReDispatcher; - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bc) throws Exception { - Activator.bc = bc; - log = new Log(bc, false); - log.setPrintOnConsole(getBoolean("equinox.services.wireadmin.console")); - - LOG_DEBUG = getBoolean("equinox.services.wireadmin.debug"); - log.setDebug(LOG_DEBUG); - - cmRef = bc.getServiceReference(ConfigurationAdmin.class.getName()); - - ConfigurationAdmin cm = null; - if (cmRef != null) { - cm = (ConfigurationAdmin) bc.getService(cmRef); - } - - try { - bc.addServiceListener(this, '(' + Constants.OBJECTCLASS + '=' + ConfigurationAdmin.class.getName() + ')'); - } catch (InvalidSyntaxException ise) { - /* syntax is valid */ - } - - wireAdmin = new WireAdminImpl(bc, cm); - - try { - bc.addServiceListener(wireAdmin, "(|(" + Constants.OBJECTCLASS + '=' + WireAdminListener.class.getName() + ')' + '(' + Constants.OBJECTCLASS + '=' + Consumer.class.getName() + ')' + '(' + Constants.OBJECTCLASS + '=' + Producer.class.getName() + "))"); - } catch (InvalidSyntaxException ise) { - /* syntax is valid */ - // ise.printStackTrace(); - } - wireReDispatcher = new WireReDispatcher(); - wireReDispatcher.start(bc); - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bc) throws Exception { - if (wireReDispatcher != null) { - wireReDispatcher.stop(); - wireReDispatcher = null; - } - - wireAdmin.unregister(); - - bc.removeServiceListener(wireAdmin); - bc.removeServiceListener(this); - - if (cmRef != null) { - bc.ungetService(cmRef); - cmRef = null; - } - - log.close(); - log = null; - - wireAdmin = null; - - bc = null; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.ServiceListener#serviceChanged(org.osgi.framework.ServiceEvent) - */ - public void serviceChanged(ServiceEvent e) { - switch (e.getType()) { - case ServiceEvent.MODIFIED : - case ServiceEvent.REGISTERED : - this.cmRef = e.getServiceReference(); - wireAdmin.cm = (ConfigurationAdmin) bc.getService(cmRef); - break; - case ServiceEvent.UNREGISTERING : - this.cmRef = null; - wireAdmin.cm = null; - break; - } - } - - public Object getService(Bundle bundle, ServiceRegistration registration) { - return null; - } - - public void ungetService(Bundle bundle, ServiceRegistration registration, Object service) { - } - - public static boolean getBoolean(String property) { - String prop = (bc != null) ? bc.getProperty(property) : System.getProperty(property); - return ((prop != null) && prop.equalsIgnoreCase("true")); - } - - public static int getInteger(String property, int defaultValue) { - String prop = (bc != null) ? bc.getProperty(property) : System.getProperty(property); - if (prop != null) { - try { - return Integer.decode(prop).intValue(); - } catch (NumberFormatException e) { - //do nothing - } - } - return defaultValue; - } -} diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/EventDispatcher.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/EventDispatcher.java deleted file mode 100644 index b425e9cb14..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/EventDispatcher.java +++ /dev/null @@ -1,268 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - * Eurotech - *******************************************************************************/ -package org.eclipse.equinox.internal.wireadmin; - -import java.util.*; -import org.osgi.framework.*; -import org.osgi.service.wireadmin.*; - -/** - * This class is responsible for dispatching notifications to WireAdminListeners - * and Consumers and Producers. - * - * @author Stoyan Boshev - * @author Pavlin Dobrev - * - * @version 1.0 - */ -public class EventDispatcher implements Runnable { - - private BundleContext bc; - - private WireAdminImpl wa; - - private Hashtable refToList; - - private Vector events; - - private Object synch = new Object(); - private Object listenersLock = new Object(); - - private boolean running = true; - - private Thread dispatcher; - - public EventDispatcher(BundleContext bc, WireAdminImpl wa) { - this.bc = bc; - this.wa = wa; - this.refToList = new Hashtable(5); - this.events = new Vector(5, 5); - - ServiceReference[] sRefs = null; - - try { - sRefs = bc.getServiceReferences(WireAdminListener.class.getName(), null); - } catch (InvalidSyntaxException ise) { - /* filter is null */ - } - - if (sRefs != null) { - WireAdminListener listener; - - for (int i = 0; i < sRefs.length; i++) { - listener = (WireAdminListener) bc.getService(sRefs[i]); - - if (listener != null) { - refToList.put(sRefs[i], listener); - } - } - } - dispatcher = new Thread(this, "[WireAdmin] - Event Dispatcher"); - dispatcher.start(); - } - - void addEvent(WireAdminEvent evt) { - if (refToList.isEmpty()) { - return; - } - - if (dispatcher == null) { - // synchronous - notifyListeners(new EventData(evt, refToList)); - } else { - // synchronized (listenersLock) { //because it does not change the - // Hashtable; - events.addElement(new EventData(evt, refToList)); - // } - synchronized (synch) { - synch.notify(); - } - } - } - - void addNotificationEvent(NotificationEvent ne) { - if (dispatcher == null) { - // synchronous - notifyConsumerProducer(ne); - } else { - events.addElement(ne); - synchronized (synch) { - synch.notify(); - } - } - } - - private String printWires(Wire[] wires) { - if (wires != null) { - StringBuffer buff = new StringBuffer(100); - buff.append("\n"); - for (int i = 0; i < wires.length; i++) { - buff.append(wires[i]).append("\n"); - } - return buff.toString(); - } - return "null"; - } - - private void notifyConsumerProducer(NotificationEvent ne) { - if (Activator.LOG_DEBUG) { - Activator.log.debug("Notification event " + ((ne.producer != null) ? "; Producer " + ne.producer : "; Consumer " + ne.consumer) + "; source: " + ne.source + "; wires " + printWires(ne.wires), null); - - Activator.log.debug(0, 10001, ((dispatcher != null) ? "asynchronous" : "synchronous"), null, false); - } - if (ne.producer != null) { - try { - ne.producer.consumersConnected(ne.wires); - } catch (Throwable t) { - wa.notifyListeners(ne.source, WireAdminEvent.PRODUCER_EXCEPTION, t); - } - } else if (ne.consumer != null) { - try { - ne.consumer.producersConnected(ne.wires); - } catch (Throwable t) { - wa.notifyListeners(ne.source, WireAdminEvent.CONSUMER_EXCEPTION, t); - } - } - } - - private void notifyListeners(EventData event) { - WireAdminEvent evt = (WireAdminEvent) event.event; - Hashtable refToList = event.listeners; - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10002, getEvent(evt.getType()) + evt.getWire(), evt.getThrowable(), false); - Activator.log.debug(0, 10001, ((dispatcher != null) ? "asynchronous" : "synchronous"), null, false); - } - - for (Enumeration en = refToList.keys(); running && en.hasMoreElements();) { - ServiceReference current = (ServiceReference) en.nextElement(); - Integer accepts = (Integer) current.getProperty(WireConstants.WIREADMIN_EVENTS); - if ((accepts != null) && ((accepts.intValue() & evt.getType()) == evt.getType())) { - try { - ((WireAdminListener) refToList.get(current)).wireAdminEvent(evt); - } catch (Throwable t) { - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10003, ((WireAdminListener) refToList.get(current)).toString(), t, false); - } - } - } - } - } - - /** - * @param ref - */ - public void removeListener(ServiceReference ref) { - if (refToList.containsKey(ref)) { - synchronized (listenersLock) { - refToList = (Hashtable) refToList.clone(); - if (refToList.remove(ref) != null) { - bc.ungetService(ref); - } - } - } - } - - /** - * @param ref - * @param object - */ - public void addListener(ServiceReference ref, Object object) { - synchronized (listenersLock) { - refToList = (Hashtable) refToList.clone(); - refToList.put(ref, object); - } - } - - public void run() { - while (running) { - synchronized (synch) { - while (running && events.size() == 0) { - try { - synch.wait(); - } catch (InterruptedException ie) { - } - } - } - - EventData evt = null; - NotificationEvent ne = null; - while (running && events.size() > 0) { - Object event = events.elementAt(0); - events.removeElementAt(0); - if (event instanceof EventData) { - evt = (EventData) event; - notifyListeners(evt); - } else { - ne = (NotificationEvent) event; - notifyConsumerProducer(ne); - } - } - } - } - - void terminate() { - running = false; - - if (dispatcher != null) { - synchronized (synch) { - synch.notify(); - } - } - - synchronized (listenersLock) { - for (Enumeration en = refToList.keys(); en.hasMoreElements();) { - bc.ungetService((ServiceReference) en.nextElement()); - } - refToList.clear(); - refToList = null; - } - events.removeAllElements(); - events = null; - } - - private String getEvent(int type) { - switch (type) { - case WireAdminEvent.WIRE_CREATED : - return "WIRE_CREATED"; - case WireAdminEvent.WIRE_CONNECTED : - return "WIRE_CONNECTED"; - case WireAdminEvent.WIRE_UPDATED : - return "WIRE_UPDATED"; - case WireAdminEvent.WIRE_TRACE : - return "WIRE_TRACE"; - case WireAdminEvent.WIRE_DISCONNECTED : - return "WIRE_DISCONNECTED"; - case WireAdminEvent.WIRE_DELETED : - return "WIRE_DELETED"; - case WireAdminEvent.PRODUCER_EXCEPTION : - return "PRODUCER_EXCEPTION"; - case WireAdminEvent.CONSUMER_EXCEPTION : - return "CONSUMER_EXCEPTION"; - default : - return null; - } - } - - class EventData { - Object event; - Hashtable listeners; - - public EventData(Object event, Hashtable listenersData) { - this.event = event; - listeners = listenersData; - } - } -} diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/NotificationEvent.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/NotificationEvent.java deleted file mode 100644 index 95aaac9f98..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/NotificationEvent.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.wireadmin; - -import org.osgi.service.wireadmin.*; - -/** - * This class holds the producer and consumer which have to be notified for - * changes in their wires - * - * @author Stoyan Boshev - * @author Pavlin Dobrev - * @version 1.0 - */ -public class NotificationEvent { - - Producer producer; - Consumer consumer; - Wire source; - Wire[] wires; - - public NotificationEvent(Producer pr, Consumer cm, Wire source, Wire[] wires) { - producer = pr; - consumer = cm; - this.source = source; - this.wires = wires; - } - -} diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/TracerMap.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/TracerMap.java deleted file mode 100644 index aae2515f87..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/TracerMap.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.wireadmin; - -import org.eclipse.equinox.internal.util.hash.HashIntObjNS; - -/** - * @author Lubomir Mitev - * @author Pavlin Dobrev - * @version 1.0 - */ -public class TracerMap { - - public static HashIntObjNS getMap() { - HashIntObjNS map = new HashIntObjNS(18); - - map.put(0, "WireAdmin"); - map.put(10001, "Event model is "); - map.put(10002, "Event type / source : "); - map.put(10003, "Exception while notifying WireAdminListener: "); - map.put(10004, "Will create wire producerPID/consumerPID/props : "); - map.put(10005, "I/O error creating a configuration!"); - map.put(10006, "Found case variants while updating wire properties"); - map.put(10007, "deleting wire with pid "); - map.put(10008, "deleting complete"); - map.put(10009, "Updating properties for wire with pid="); - map.put(10011, "Will set new properties for wire "); - map.put(10012, "Filter doesn't match value : "); - map.put(10013, "Wire started : "); - map.put(10014, "Disconnecting "); - map.put(10015, "Service is not connected to any producer/consumer : "); - map.put(10016, "The producer and consumer could not interoperate using wire "); - map.put(10017, "No ServiceReference for Wire events! event: "); - map.put(10018, "WireAdminEvent redispatched: "); - - return map; - } - - public static HashIntObjNS getStarts() { - return null; - } -} diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/WireAdminImpl.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/WireAdminImpl.java deleted file mode 100644 index 73594f6465..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/WireAdminImpl.java +++ /dev/null @@ -1,605 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2009 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.wireadmin; - -import java.io.IOException; -import java.util.*; -import org.osgi.framework.*; -import org.osgi.service.cm.*; -import org.osgi.service.wireadmin.*; - -/** - * Wire Admin service implementation - * - * @author Pavlin Dobrev - * @author Stoyan Boshev - * @version 1.0 - */ -class WireAdminImpl implements WireAdmin, ManagedServiceFactory, ServiceListener { - - private EventDispatcher evtDisp; - - private static final String PID_PREFIX = "WA_GENERATED_PID_"; - private static final String FACTORY_PID = "equinox.wireadmin.fpid"; - - private BundleContext bc; - - ConfigurationAdmin cm; - - private Hashtable wires; // maps wire pid to the WireImpl object - private ServiceRegistration regWireAdmin; - private ServiceRegistration regManagedFactory; - - private Vector waitForUpdate = new Vector(); - - long counter = System.currentTimeMillis(); - - /** - * Constructs an WireAdminImpl object, which provides - * Framework with methods for manipulating a Wire objects. - * Initialazed are hashtables for storing created wires, wires per - * Producer, and wires per Consumer. - * - * @param bc - * is the BundleContext object used for interaction with - * Framework. - */ - - WireAdminImpl(BundleContext bc, ConfigurationAdmin cm) { - this.bc = bc; - this.cm = cm; - wires = new Hashtable(); - evtDisp = new EventDispatcher(bc, this); - - Hashtable props = new Hashtable(2, 1.0f); - props.put(Constants.SERVICE_PID, FACTORY_PID); - props.put("service.factoryPid", FACTORY_PID); - - if (cm != null) { - try { - Configuration[] all = cm.listConfigurations("(service.factoryPid=" + FACTORY_PID + ")"); - if (all != null) { - WireImpl wire; - - for (int i = 0; i < all.length; i++) { - Dictionary properties = all[i].getProperties(); - String pid = (String) properties.get(WireConstants.WIREADMIN_PID); - - if (pid == null) { - pid = all[i].getPid(); - properties.put(WireConstants.WIREADMIN_PID, pid); - } - - wire = new WireImpl(bc, this, properties); - wires.put(pid, wire); - wire.start(); - } - } - } catch (IOException ioe) { - /* blocking won't be made */ - } catch (InvalidSyntaxException ise) { - /* syntax is valid */ - } - } - - // register as ManagedServiceFactory after loading the current config - // values and creating the wires !!!!!!!! - // This will not lead to bugs because of updating wire props while wire - // is not preloaded - regManagedFactory = bc.registerService(ManagedServiceFactory.class.getName(), this, props); - regWireAdmin = bc.registerService(WireAdmin.class.getName(), this, props); - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.WireAdmin#createWire(java.lang.String, - * java.lang.String, java.util.Dictionary) - */ - public Wire createWire(String producerPID, String consumerPID, Dictionary props) { - return createWire(producerPID, consumerPID, props, null); - } - - private Wire createWire(String producerPID, String consumerPID, Dictionary props, String pid) { - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10004, producerPID + " / " + consumerPID + " / =" + props, null, false); - } - - if ((pid == null) && (producerPID == null || consumerPID == null)) { - throw new IllegalArgumentException("PIDs can not be null"); - } - - if (props == null) { - props = new Hashtable(7, 1.0f); - } else if (caseVariants(props)) { - throw new IllegalArgumentException("Illegal wire properties. Two or more keys with the same value, or incorrect key type!"); - } - - if (pid == null) { - // put the keys - props.put(WireConstants.WIREADMIN_PRODUCER_PID, producerPID); - props.put(WireConstants.WIREADMIN_CONSUMER_PID, consumerPID); - } - WireImpl wire = null; - - if (pid != null) { - wire = new WireImpl(bc, this, props); - wires.put(pid, wire); - wire.start(); - } else if (cm != null) { - try { - Configuration config = cm.createFactoryConfiguration(FACTORY_PID); - props.put(WireConstants.WIREADMIN_PID, config.getPid()); - wire = new WireImpl(bc, this, props); - /* Object oldWire = */wires.put(config.getPid(), wire); - // if (oldWire != null) { - // System.out.println("\n\n@@@@@@@@@@@@@@@@@@ Old wire lost!!!! - // Wire is "+oldWire); - // System.out.println("@@@@@@@@@@@@@@@@@@ New Wire is "+wire); - // } - wire.start(); - waitForUpdate.addElement(wire); - config.update(props); - } catch (IOException ioe) { - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10005, null, ioe, false); - } - } - } else { - String wirePID = getNextPID(); - props.put(WireConstants.WIREADMIN_PID, wirePID); - props.put("service.factoryPid", "equinox.wireadmin.fpid"); - wire = new WireImpl(bc, this, props); - wires.put(wirePID, wire); - wire.start(); - - Activator.log.info(Activator.PREFIX + "CM not available! The created wire from Producer=" + producerPID + " and Consumer=" + consumerPID + " won't be presistently stored!"); - - } - - notifyListeners(wire, WireAdminEvent.WIRE_CREATED, null); - return wire; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.WireAdmin#updateWire(org.osgi.service.wireadmin.Wire, - * java.util.Dictionary) - */ - public void updateWire(Wire wire, Dictionary properties) { - WireImpl wireImpl = (WireImpl) wire; - - if (wireImpl == null || !wireImpl.isValid) {// fix #1064 - return; - } - - if (properties == null) { - properties = new Hashtable(7, 1.0f); - } - - for (Enumeration en = properties.keys(); en.hasMoreElements();) { - if (!(en.nextElement() instanceof String)) { - throw new IllegalArgumentException("Illegal keys, must be String type"); - } - } - - if (caseVariants(properties)) { - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10006, null, null, false); - } - throw new IllegalArgumentException("Found case variants in properties' keys"); - } - - String wirePID = (String) wire.getProperties().get(WireConstants.WIREADMIN_PID); - - if ((cm != null) && (wirePID.charAt(0) != 'W')) { - // CM is available and this wire was not created - // when the CM was not available - - wireImpl.setProperties(properties); - wires.put(wirePID, wire); - waitForUpdate.addElement(wire); - - try { - Configuration conf = cm.getConfiguration(wirePID); - conf.update(properties); - } catch (IOException ioe) { - Activator.log.error(Activator.PREFIX + "I/O error updating configuration!", ioe); - } - - } else { - // either CM is not available, or - // this wire was created when CM was not available - wires.remove(wirePID); - wireImpl.setProperties(properties); - wires.put(wirePID, wire); - } - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.WireAdmin#deleteWire(org.osgi.service.wireadmin.Wire) - */ - public void deleteWire(Wire wire) { - WireImpl wireImpl = (WireImpl) wire; - try { - if (cm != null) { - Configuration current = cm.getConfiguration(wireImpl.getWirePID()); - if (current != null) { - current.delete(); - } - } else { - disconnectWire(wireImpl); - } - } catch (IOException ioe) { - Activator.log.error(Activator.PREFIX + "I/O error getting a configuration!", ioe); - } - } - - private Wire[] getWires(String pid, boolean isProducer) throws InvalidSyntaxException { - if (isProducer) { - return getWires('(' + WireConstants.WIREADMIN_PRODUCER_PID + '=' + WireImpl.escapeSpecialCharacters(pid) + ')'); - } - - return getWires('(' + WireConstants.WIREADMIN_CONSUMER_PID + '=' + WireImpl.escapeSpecialCharacters(pid) + ')'); - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.WireAdmin#getWires(java.lang.String) - */ - public Wire[] getWires(String filterString) throws InvalidSyntaxException { - if (filterString == null) { - return getAllWires(); - } - - Filter filter = bc.createFilter(filterString); - - if (filter == null) { - return getAllWires(); - } - - Vector tmp = new Vector(); - - synchronized (wires) { - for (Enumeration en = wires.elements(); en.hasMoreElements();) { - Wire wire = (Wire) en.nextElement(); - Dictionary wireProps = wire.getProperties(); - - if (wire.isValid() && filter.match(wireProps)) { - tmp.addElement(wire); - } - } - } - - if (tmp.size() == 0) { - return null; - } - - Wire[] allWires = new Wire[tmp.size()]; - tmp.copyInto(allWires); - return allWires; - } - - private Wire[] getAllWires() { - if (wires.isEmpty()) { - return null; - } - - Vector tmp = new Vector(); - - synchronized (wires) { - for (Enumeration en = wires.elements(); en.hasMoreElements();) { - Wire wire = (Wire) en.nextElement(); - if (wire.isValid()) { - tmp.addElement(wire); - } - } - } - - if (tmp.size() == 0) { - return null; - } - - Wire[] allWires = new Wire[tmp.size()]; - tmp.copyInto(allWires); - return allWires; - } - - private void disconnectWire(WireImpl wire) { - if (wires == null) { - return; - } - Object result = wires.remove(wire.getWirePID());// Property(WireConstants.WIREADMIN_PID)); - if (result != null) { // the wire existed - boolean wasConnected = wire.isConnected(); - wire.stop(); - if (wasConnected) { - notifyListeners(wire, WireAdminEvent.WIRE_DISCONNECTED, null); - } - notifyListeners(wire, WireAdminEvent.WIRE_DELETED, null); - } - } - - Wire[] getConnected(String key, String value) { - if (key == null || value == null || wires.isEmpty()) { - return null; - } - - Vector connected = new Vector(); - - synchronized (wires) { - for (Enumeration en = wires.elements(); en.hasMoreElements();) { - WireImpl w = (WireImpl) en.nextElement(); - if (w.isValid() && w.isConnected() && value.equals(w.getProperties().get(key))) { - connected.addElement(w); - } - } - } - - if (connected.isEmpty()) { - return null; - } - - Wire[] cw = new Wire[connected.size()]; - connected.copyInto(cw); - return cw; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.cm.ManagedServiceFactory#deleted(java.lang.String) - */ - public void deleted(String pid) { - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10007, pid, null, false); - } - - if (wires == null) { - return; - } - WireImpl wire = (WireImpl) wires.get(pid); - disconnectWire(wire); - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10008, null, null, false); - } - } - - public String getName() { - return "WireAdmin Configuration Factory"; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.cm.ManagedServiceFactory#updated(java.lang.String, - * java.util.Dictionary) - */ - public void updated(String pid, Dictionary properties) throws ConfigurationException { - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10009, pid, null, false); - Activator.log.debug(Activator.PREFIX + " " + properties, null); - } - - String consumerPID = (String) properties.get(WireConstants.WIREADMIN_CONSUMER_PID); - - if (consumerPID == null) { - throw new ConfigurationException(WireConstants.WIREADMIN_CONSUMER_PID, "is not provided"); - } - - String producerPID = (String) properties.get(WireConstants.WIREADMIN_PRODUCER_PID); - - if (producerPID == null) { - throw new ConfigurationException(WireConstants.WIREADMIN_PRODUCER_PID, "is not provided"); - } - - properties.put(WireConstants.WIREADMIN_PID, pid); - - if (wires == null) { - return; - } - - WireImpl wire = (WireImpl) wires.get(pid); - - if (wire != null) { - if (waitForUpdate.contains(wire)) { - // skip the first update after the wire was created - // or after the wire properties were updated - waitForUpdate.removeElement(wire); - } else { - // updating properties - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10011, wire.toString(), null, false); - } - wire.setProperties(properties); - } - } else { - createWire(producerPID, consumerPID, properties, pid); - } - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.ServiceListener#serviceChanged(org.osgi.framework.ServiceEvent) - */ - public void serviceChanged(ServiceEvent event) { - int type = event.getType(); - ServiceReference ref = event.getServiceReference(); - - if (type == ServiceEvent.UNREGISTERING) { - // presume that the unregistered service is a WireAdminListener - // service - evtDisp.removeListener(ref); - return; - } - - Object service = bc.getService(ref); - - if (type == ServiceEvent.REGISTERED) { - if (service instanceof WireAdminListener) { - evtDisp.addListener(ref, bc.getService(ref)); - } - - if (service instanceof Producer) { - Wire[] wires = null; - try { - wires = getWires((String) ref.getProperty(Constants.SERVICE_PID), true); - } catch (InvalidSyntaxException ise) { - /* syntax is valid */ - } - boolean doNotify = true; - if (wires != null) { - // there are wires, which may become connected - for (int i = 0; i < wires.length; i++) { - if (((WireImpl) wires[i]).consumerRef != null) { - // there is wire which will become (or is) connected - doNotify = false; - } - } - } - if (doNotify) { - notifyConsumerProducer(new NotificationEvent((Producer) service, null, null, null)); - } - } - - if (service instanceof Consumer) { - Wire[] wires = null; - try { - wires = getWires((String) ref.getProperty(Constants.SERVICE_PID), false); - } catch (InvalidSyntaxException ise) { - /* syntax is valid */ - } - - boolean doNotify = true; - if (wires != null) { - // there are wires, which may become connected - for (int i = 0; i < wires.length; i++) { - if (((WireImpl) wires[i]).producerRef != null) { - // there is wire which will become (or is) connected - doNotify = false; - } - } - } - if (doNotify) { - notifyConsumerProducer(new NotificationEvent(null, (Consumer) service, null, null)); - } - } - } - } - - // Utility methods - /** - * Sends a WireAdminEvent to all services registered as - * WireAdminListener - * - * @param type - * is the type of the WireAdminEvent that must be - * sent. - */ - void notifyListeners(Wire src, int type, Throwable t) { - if (regWireAdmin == null) { - return; - } - evtDisp.addEvent(new WireAdminEvent(regWireAdmin.getReference(), type, src, t)); - } - - void notifyConsumerProducer(NotificationEvent ne) { - evtDisp.addNotificationEvent(ne); - } - - void unregister() { - - if (regWireAdmin != null) { - regWireAdmin.unregister(); - regWireAdmin = null; - } - if (regManagedFactory != null) { - regManagedFactory.unregister(); - regManagedFactory = null; - } - - // disconnect all running wires - synchronized (wires) { - for (Enumeration en = wires.elements(); en.hasMoreElements();) { - disconnectWire((WireImpl) en.nextElement()); - } - } - - // stop event dispatcher - evtDisp.terminate(); - - cm = null; - wires.clear(); - wires = null; - bc = null; - } - - private static boolean caseVariants(Dictionary props) { - int k = 0; - int size = props.size(); - String[] keys = new String[size]; - - try { - for (Enumeration en = props.keys(); en.hasMoreElements();) { - keys[k] = (String) en.nextElement(); - k++; - } - } catch (ClassCastException cce) { - return true; - } - int j; - - for (int i = 0; i < size; i++) { - for (j = i + 1; j < size; j++) { - if (keys[i].equalsIgnoreCase(keys[j])) { - return true; - } - } - } - return false; - } - - private final String getNextPID() { - String nextPID = PID_PREFIX + counter++; - while (wires.get(nextPID) != null) { - nextPID = PID_PREFIX + counter++; - } - return nextPID; - } - - boolean hasAConnectedWire(boolean isProducer, String pid) { - String cPid; - synchronized (wires) { - for (Enumeration en = wires.elements(); en.hasMoreElements();) { - WireImpl wire = (WireImpl) en.nextElement(); - - if (wire.isValid() && wire.isConnected()) { - cPid = (String) wire.getProperties().get(isProducer ? WireConstants.WIREADMIN_PRODUCER_PID : WireConstants.WIREADMIN_CONSUMER_PID); - if (cPid.equals(pid)) { - return true; - } - } - } - } - // none of the wires in wich this service takes part - // will become connected after it's registering - return false; - } -} diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/WireImpl.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/WireImpl.java deleted file mode 100644 index 2ce3eb42d1..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/WireImpl.java +++ /dev/null @@ -1,858 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2011 by ProSyst Software GmbH and others. - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - * IBM Corporation - bug fix 347974 - *******************************************************************************/ -package org.eclipse.equinox.internal.wireadmin; - -import java.util.*; -import org.osgi.framework.*; -import org.osgi.service.wireadmin.*; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -class WireImpl implements Wire, ServiceListener { - - private BundleContext bc; - - /** Holds all the properties associated with this Wire object */ - private WireProperties properties; - - /** Holds a service reference to the associated Producer */ - ServiceReference producerRef; - - /** Holds a service reference to the associated Consumer */ - ServiceReference consumerRef; - - private Producer producer; - private Consumer consumer; - - private Class[] flavors; - - /** Holds the last value passed to this Wire by the Producer. */ - private Object lastValue; - /** Holds the previous value passed through this Wire to the Consumer. */ - private Object previousValue; - - private Vector envelopes; - - /** - * WireAdmin object whit which this Wire was - * created. - */ - private WireAdminImpl parent; - - private Filter filter = null; - - /** Holds the time of previous Consumer update in milliseconds */ - private long previousUpdateTime = -1; - - /** Holds the available wire values (filter attributes) */ - private Hashtable wireValues; - - /* holds a list of scopes */ - private String[] scope; - - /** Indicates that this Wire object has been deleted */ - boolean isValid = true; - - private boolean interoperate = true; - - private boolean allAccepted = true; - - /** - * Creates a Wire object, representing a connection between a - * Producer and Consumer. - * - * @param bc - * is the Wiring BundleContext. - * @param parent - * is the WireAdmin which is the creator of this - * Wire. - * @param wirePID - * is a String holding a unique presistent - * identifier of this Wire, generated by the - * parent WireAdmin. - * @param properties - * is a collection of the initial wire properties. - */ - WireImpl(BundleContext bc, WireAdminImpl parent, Dictionary properties) { - this.bc = bc; - this.parent = parent; - this.properties = new WireProperties(); - - for (Enumeration en = properties.keys(); en.hasMoreElements();) { - Object key = en.nextElement(); - this.properties.put0(key, properties.get(key)); - } - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.Wire#isValid() - */ - public boolean isValid() { - return isValid; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.Wire#getFlavors() - */ - public Class[] getFlavors() { - return isConnected() ? flavors : null; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.Wire#getProperties() - */ - public Dictionary getProperties() { - return properties; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.Wire#getLastValue() - */ - public synchronized Object getLastValue() { - return lastValue; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.Wire#update(java.lang.Object) - */ - public synchronized void update(Object value) { - if (!isConnected() || !interoperate || !isAcceptable(value)) { - return; - } - - if (value instanceof Envelope) { - Envelope e = (Envelope) value; - if (!hasScope(e.getScope())) { - if (Activator.LOG_DEBUG) { - Activator.log.debug(Activator.PREFIX + "Try to pass a value in an Envelop without permission, silent return.", null); - } - return; - } - } - - try { - if (filter != null) { - wireValues.put(WireConstants.WIREVALUE_CURRENT, value); - - // #3329 - if (previousValue != null) { - wireValues.put(WireConstants.WIREVALUE_PREVIOUS, previousValue); - wireValues.put(WireConstants.WIREVALUE_ELAPSED, new Long(System.currentTimeMillis() - previousUpdateTime)); - } else { - previousValue = value; // this is to "prime the pump" - } - - if (Number.class.isInstance(value) && Number.class.isInstance(previousValue)) { - double val = ((Number) value).doubleValue(); - double prevVal = ((Number) previousValue).doubleValue(); - - wireValues.put(WireConstants.WIREVALUE_DELTA_ABSOLUTE, new Double(Math.abs(val - prevVal))); - // #3328 - wireValues.put(WireConstants.WIREVALUE_DELTA_RELATIVE, new Double(Math.abs(1 - prevVal / val))); - } else { - wireValues.remove(WireConstants.WIREVALUE_DELTA_ABSOLUTE); - wireValues.remove(WireConstants.WIREVALUE_DELTA_RELATIVE); - } - - if (!filter.match(wireValues)) { - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10012, filter + " / " + value, null, false); - } - return; - } - } - - if (consumer != null) { - try { - consumer.updated(this, value); - } catch (Throwable t) { - parent.notifyListeners(this, WireAdminEvent.CONSUMER_EXCEPTION, t); - } finally { - previousValue = value; - previousUpdateTime = System.currentTimeMillis(); - parent.notifyListeners(this, WireAdminEvent.WIRE_TRACE, null); - } - } - } finally { - lastValue = value; - } - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.Wire#poll() - */ - public synchronized Object poll() { - Object value = null; - if (isConnected() && interoperate) { - try { - value = producer.polled(this); - } catch (Throwable t) { - // no exception in the Producer must prevent correct Wire - // functioning - parent.notifyListeners(this, WireAdminEvent.PRODUCER_EXCEPTION, t); - return null; - } - parent.notifyListeners(this, WireAdminEvent.WIRE_TRACE, null); - if (!isAcceptable(value) && (!(value instanceof Envelope[]))) { - value = null; - } - } - - if (value != null) { - lastValue = value; - if (value instanceof Envelope[]) { - - if (allAccepted) { - return value; - } - Envelope[] envs = (Envelope[]) value; - if (scope == null) { - return value; - } - - if (envelopes == null) { - envelopes = new Vector(envs.length); - } - boolean changed = false; - for (int i = 0; i < envs.length; i++) { - if (hasScope(envs[i].getScope())) { - envelopes.addElement(envs[i]); - } else { - changed = true; - } - } - - if (changed) { - value = new Envelope[envelopes.size()]; - envelopes.copyInto((Envelope[]) value); - envelopes.removeAllElements(); - } - } - } - return value; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.Wire#isConnected() - */ - public boolean isConnected() { - return isValid && (consumerRef != null) && (producerRef != null); - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.Wire#getScope() - */ - public synchronized String[] getScope() { - return scope; - } - - private void setScope() { - if ((producerRef == null) || (consumerRef == null)) { - return; - } - - Vector prodScope = checkPermission((String[]) producerRef.getProperty(WireConstants.WIREADMIN_PRODUCER_SCOPE), WirePermission.PRODUCE, producerRef.getBundle()); - - Vector consScope = checkPermission((String[]) consumerRef.getProperty(WireConstants.WIREADMIN_CONSUMER_SCOPE), WirePermission.CONSUME, consumerRef.getBundle()); - - if ((prodScope == null) || (consScope == null)) { - return; - } - - if ((consScope.size() == 1) && consScope.elementAt(0).equals("*")) { - scope = new String[prodScope.size()]; - prodScope.copyInto(scope); - return; - } - - if ((prodScope.size() != ((String[]) producerRef.getProperty(WireConstants.WIREADMIN_PRODUCER_SCOPE)).length) || (consScope.size() != ((String[]) consumerRef.getProperty(WireConstants.WIREADMIN_CONSUMER_SCOPE)).length)) { - this.allAccepted = false; - } - - Vector cloning = (Vector) prodScope.clone(); - - for (Enumeration en = cloning.elements(); en.hasMoreElements();) { - Object next = en.nextElement(); - if (!consScope.contains(next)) { - prodScope.removeElement(next); - this.allAccepted = false; - } - } - - scope = new String[prodScope.size()]; - prodScope.copyInto(scope); - } - - private static Vector checkPermission(String[] scope, String action, Bundle b) { - if (scope == null) { - return null; - } - - Vector v = new Vector(); - for (int i = 0; i < scope.length; i++) { - WirePermission wp = new WirePermission(scope[i], action); - if (b.hasPermission(wp)) { - v.addElement(scope[i]); - } - } - return v; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.Wire#hasScope(java.lang.String) - */ - public boolean hasScope(String name) { - if ((scope == null) || ((scope.length == 1) && scope[0].equals("*"))) { - return true; - } - - for (int i = 0; i < scope.length; i++) { - if (name.equals(scope[i]) || scope[i].equals(WireConstants.WIREADMIN_SCOPE_ALL[0])) { - return true; - } - } - return false; - } - - // Utility methods - /** - * Creates a string representation for this Wire - * - * @return a string representation of this object. - */ - public String toString() { - StringBuffer sb = new StringBuffer(100); - sb.append("Wire[PID="); - sb.append(properties.get(WireConstants.WIREADMIN_PID)); - sb.append(";prodPID="); - sb.append(properties.get(WireConstants.WIREADMIN_PRODUCER_PID)); - sb.append(";consPID="); - sb.append(properties.get(WireConstants.WIREADMIN_CONSUMER_PID)); - sb.append(";connected="); - sb.append(isConnected()); - // sb.append(";valid="); - // sb.append(isValid()); - // sb.append(";Scope={"); - // if (scope == null) { - // sb.append("null"); - // } else { - // for (int i = 0; i < scope.length; i++) { - // sb.append(scope[i]); - // if (i != scope.length - 2) { - // sb.append(", "); - // } - // } - // } - sb.append("}]"); - - return sb.toString(); - } - - /** - * This method starts tracking of - * Producer Consumerservices associated with - * this Wire object. First we check if there are already such - * services started on the framework, after that two - * ServiceTracker objects are created to handle - * Producer and Consumer service tracking. - */ - synchronized void start() { - String producerPID = (String) properties.get(WireConstants.WIREADMIN_PRODUCER_PID); - String consumerPID = (String) properties.get(WireConstants.WIREADMIN_CONSUMER_PID); - updateListenerFilter(); - // check if there are such services already started - ServiceReference ref = getSingleRef(Producer.class.getName(), producerPID); - - if (ref != null) { - serviceRegistered(ref); - } - - ref = getSingleRef(Consumer.class.getName(), consumerPID); - - if (ref != null) { - serviceRegistered(ref); - } - - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10013, properties.get(WireConstants.WIREADMIN_PID).toString(), null, false); - } - } - - void updateListenerFilter() { - String producerPID = escapeSpecialCharacters((String) properties.get(WireConstants.WIREADMIN_PRODUCER_PID)); - String consumerPID = escapeSpecialCharacters((String) properties.get(WireConstants.WIREADMIN_CONSUMER_PID)); - - try { - // Create filter for tracking services regstered as Consumer's with - // the current - // WIRE_CONSUMER_PID and as Producer's with current - // WIRE_PRODUCER_PID - // escaping *, ) and ( in the pid. - StringBuffer sb = new StringBuffer();// "("); - sb.append('('); - sb.append('|'); - - sb.append('(').append('&'); - sb.append('(').append(Constants.SERVICE_PID).append('=').append(consumerPID).append(')'); - sb.append('(').append(Constants.OBJECTCLASS).append('=').append(Consumer.class.getName()).append(')'); - sb.append(')'); - - sb.append('(').append('&'); - sb.append('(').append(Constants.SERVICE_PID).append('=').append(producerPID).append(')'); - sb.append('(').append(Constants.OBJECTCLASS).append('=').append(Producer.class.getName()).append(')'); - sb.append(')'); - - if (consumerRef != null) {// in case service.pid changes - Long id = (Long) consumerRef.getProperty(Constants.SERVICE_ID); - sb.append('(').append(Constants.SERVICE_ID).append('=').append(id).append(')'); - } - - if (producerRef != null) {// in case service.pid changes - Long id = (Long) producerRef.getProperty(Constants.SERVICE_ID); - sb.append('(').append(Constants.SERVICE_ID).append('=').append(id).append(')'); - } - - sb.append(')'); - - // System.out.println("Filter is: " + sb.toString()); - - bc.addServiceListener(this, sb.toString()); - } catch (InvalidSyntaxException ise) { - /* Syntax is valid */ - } - - } - - private ServiceReference getSingleRef(String clazz, String pid) { - ServiceReference[] ref = null; - - try { - ref = bc.getServiceReferences(clazz, "(" + Constants.SERVICE_PID + "=" + escapeSpecialCharacters(pid) + ")"); - } catch (InvalidSyntaxException e) { - } - - if (ref != null) { - if (ref.length > 1) { - if (Activator.LOG_DEBUG) { - Activator.log.debug(Activator.PREFIX + "Found more than one " + clazz + " services registered with the same pid: " + pid + "Wire was not created, please unregister all services which duplicate the pid.", null); - } - - parent.deleteWire(this); - } else if (ref.length == 1) { - return ref[0]; - } - } - return null; - } - - /** - * Stops service tracking, removes this Wire from the wire - * lists of the associated Consumer and Producer services and informs them - * for disconnecting. - */ - synchronized void stop() { - if (!isValid) - return; // already stopped - - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10014, this.toString(), null, false); - } - bc.removeServiceListener(this); - if ((producerRef != null) && (consumerRef != null)) { - // if this wire was connected - isValid = false; - informServices(); - } - isValid = false; - - if (producerRef != null) { - bc.ungetService(producerRef); - } - if (consumerRef != null) { - bc.ungetService(consumerRef); - } - - // let gc do his work - producerRef = null; - consumerRef = null; - - producer = null; - consumer = null; - - lastValue = null; - previousValue = null; - parent = null; - filter = null; - wireValues = null; - scope = null; - bc = null; - } - - /** - * This method is invoked when the Wiring tracker detects a service - * registration or when the Wire is created The service type is determined - * (Producer or Consumer) and added to this Wire. Both - * Consumer and Producer (if available) are informed for connecting. - * - * @param sRef - * the service reference of the wire's producer or consumer - * @param notifyService - * specifies whether notification of the Producer/Consumer is - * necessary if it is the only one available part. - */ - private void serviceRegistered(ServiceReference sRef) { - String pid = (String) sRef.getProperty(Constants.SERVICE_PID); - - if (pid.equals(properties.get(WireConstants.WIREADMIN_PRODUCER_PID))) { - if (producerRef == null) { - this.producerRef = sRef; - this.producer = (Producer) bc.getService(producerRef); - if (Activator.LOG_DEBUG) { - Activator.log.debug(Activator.PREFIX + "Wire " + properties.get(WireConstants.WIREADMIN_PID) + " detected producer " + pid, null); - } - } else - return; - } else { - if (consumerRef == null) { - if (Activator.LOG_DEBUG) { - Activator.log.debug(Activator.PREFIX + "Wire " + properties.get(WireConstants.WIREADMIN_PID) + " detected consumer " + pid, null); - } - this.consumerRef = sRef; - this.consumer = (Consumer) bc.getService(consumerRef); - try { - this.flavors = (Class[]) consumerRef.getProperty(WireConstants.WIREADMIN_CONSUMER_FLAVORS); - } catch (ClassCastException cce) { - /* won't be initialized */ - } - } else - return; - } - - if (isConnected()) { - // inform the Producer/Consumer for connecting - setScope(); - informServices(); - parent.notifyListeners(this, WireAdminEvent.WIRE_CONNECTED, null); - checkInteroperability(); - } else if (!parent.hasAConnectedWire(pid.equals(properties.get(WireConstants.WIREADMIN_PRODUCER_PID)), pid)) { - // this service has no connected wire objects attached to it - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10015, pid, null, false); - } - // if (notifyService) { // The service is notified if it is only - // just registered - // informServices(); - // } - } - - updateListenerFilter(); - checkWireFilter(); - } - - private void checkWireFilter() { - boolean performFiltering = ((producerRef != null) && producerRef.getProperty(WireConstants.WIREADMIN_PRODUCER_FILTERS) == null) && (properties.get(WireConstants.WIREADMIN_FILTER) != null); - - if (performFiltering) { - if ((wireValues == null)) { - wireValues = new Hashtable(6, 1.0f); - } - - try { - filter = bc.createFilter((String) properties.get(WireConstants.WIREADMIN_FILTER)); - } catch (InvalidSyntaxException ise) { - if (Activator.LOG_DEBUG) { - Activator.log.debug(Activator.PREFIX + "Filter syntax is invalid, filtering won't be made", null); - } - } - } else { - filter = null; - } - } - - private void serviceModified(ServiceReference sRef) { // fix #1073 - String pid = (String) sRef.getProperty(Constants.SERVICE_PID); - - if (sRef.equals(producerRef)) { - String currentPID = (String) properties.get(WireConstants.WIREADMIN_PRODUCER_PID); - - if (!currentPID.equals(pid)) { - // System.out.println("The pid of the PRODUCER is changed"); - serviceUnregistered(sRef); - return; - } - } - - if (sRef.equals(consumerRef)) { - String currentPID = (String) properties.get(WireConstants.WIREADMIN_CONSUMER_PID); - - if (!currentPID.equals(pid)) { - serviceUnregistered(sRef); - // System.out.println("The pid of the CONSUMER is changed"); - return; - } - try { - this.flavors = (Class[]) consumerRef.getProperty(WireConstants.WIREADMIN_CONSUMER_FLAVORS); - } catch (ClassCastException cce) { - /* won't be initialized */ - } - } - - if (producerRef == null || consumerRef == null) { - // System.out.println("Check if PID is BACK"); - serviceRegistered(sRef); - return; - } - - if (!isConnected()) { - return; - } - - setScope(); - checkInteroperability(); - checkWireFilter(); - } - - private void checkInteroperability() { - String[] p = (String[]) producerRef.getProperty(WireConstants.WIREADMIN_PRODUCER_COMPOSITE); - String[] c = (String[]) consumerRef.getProperty(WireConstants.WIREADMIN_CONSUMER_COMPOSITE); - - if ((p != null) && (c != null)) { - for (int i = 0; i < p.length; i++) { - for (int j = 0; j < c.length; j++) { - if (p[i].equals(c[j])) { - // found at least one match - interoperate = true; - return; - } - } - } - if (Activator.LOG_DEBUG) { - Activator.log.debug(0, 10016, this.toString(), null, false); - } - interoperate = false; - } else { - interoperate = true; - } - } - - private void serviceUnregistered(ServiceReference sRef) { - boolean lastStatus = isConnected(); - - if (sRef.equals(producerRef)) { - this.producerRef = null; - this.producer = null; - } else if (sRef.equals(consumerRef)) { - this.consumerRef = null; - this.consumer = null; - this.flavors = null; - } else { - if (Activator.LOG_DEBUG) { - Activator.log.debug(Activator.PREFIX + "Unregistering another consumer with the same pid, ignoring it ...", null); - } - return; - } - - updateListenerFilter(); - - if (lastStatus) { - // last wire state was connected - now it is disconnected - informServices(); - parent.notifyListeners(this, WireAdminEvent.WIRE_DISCONNECTED, null); - } - if (bc != null) { - bc.ungetService(sRef); - } - - } - - /** - * This method checks if the given String contains one of the characters *, (, - * and ) which have a special meaning for the LDAP search filters. If there - * are such characters they are escaped with the backslash character ('\'). - */ - static String escapeSpecialCharacters(String s) { - char[] content = s.toCharArray(); - StringBuffer result = new StringBuffer(s); - int offset = 0; - - for (int i = 0; i < content.length; i++) { - if ((content[i] == 40) || (content[i] == 41) || (content[i] == 42)) { - result.insert(i + offset, "\\"); // fix #1078 - offset++; - } - } - return result.toString(); - } - - /** - * Change the properties of this wire. If the changes concern one of the - * properties WIRE_PRODUCER_PID and WIRE_CONSUMER_PID this wire must be - * stopped and started again to begin tracking of the new Services. - */ - void setProperties(Dictionary newProps) { - if (newProps != null) { - String newConsPID = (String) newProps.get(WireConstants.WIREADMIN_CONSUMER_PID); - String newProdPID = (String) newProps.get(WireConstants.WIREADMIN_PRODUCER_PID); - - String oldConsPID = (String) properties.get(WireConstants.WIREADMIN_CONSUMER_PID); - String oldProdPID = (String) properties.get(WireConstants.WIREADMIN_PRODUCER_PID); - - boolean restart = false; - - if (newConsPID == null) { - newProps.put(WireConstants.WIREADMIN_CONSUMER_PID, oldConsPID); - } else if (!newConsPID.equals(oldConsPID)) { - restart = true; - } - - if (newProdPID == null) { - newProps.put(WireConstants.WIREADMIN_PRODUCER_PID, oldProdPID); - } else if (!newProdPID.equals(oldProdPID)) { - restart = true; - } - // fix #1074 - if (newProps.get(WireConstants.WIREADMIN_PID) == null) { - newProps.put(WireConstants.WIREADMIN_PID, properties.get(WireConstants.WIREADMIN_PID)); - } - - // WireProperties wprops = new WireProperties(); - properties.clear(); - - for (Enumeration en = newProps.keys(); en.hasMoreElements();) { - Object key = en.nextElement(); - properties.put0(key, newProps.get(key)); - } - - checkWireFilter(); - - if (restart) { - // One of the Consumer or Producer has been changed so restart - // the wire - stop(); - start(); - return; - } - } - - if (isConnected()) { - informServices(); - } - - parent.notifyListeners(this, WireAdminEvent.WIRE_UPDATED, null); - } - - private boolean isAcceptable(Object value) { - Class[] flavors = getFlavors(); - - if (flavors == null) { - return true; - } - - for (int i = 0; i < flavors.length; i++) { - if (flavors[i].isInstance(value)) { - return true; - } - } - return false; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.ServiceListener#serviceChanged(org.osgi.framework.ServiceEvent) - */ - public void serviceChanged(ServiceEvent evt) { - if (bc == null) { - return; - } - switch (evt.getType()) { - case ServiceEvent.REGISTERED : - // System.out.println("E V E N T : registered"); - serviceRegistered(evt.getServiceReference()); - break; - - case ServiceEvent.UNREGISTERING : - // System.out.println("E V E N T : unregistering"); - serviceUnregistered(evt.getServiceReference()); - break; - - case ServiceEvent.MODIFIED : - // System.out.println("E V E N T : modified"); - serviceModified(evt.getServiceReference()); - } - } - - String getWirePID() { - return (String) properties.get(WireConstants.WIREADMIN_PID); - } - - /** - * This method simply informs both Producer and Consumer with the methods - * consumersConnected, producersConnected if a wire bacames connected and - * the remaining service if the wire becames disconnected. - */ - private void informServices() { - if (producerRef != null) { - String producerPID = (String) properties.get(WireConstants.WIREADMIN_PRODUCER_PID); - NotificationEvent ne = new NotificationEvent(producer, null, this, parent.getConnected(WireConstants.WIREADMIN_PRODUCER_PID, producerPID)); - parent.notifyConsumerProducer(ne); - - // try { - // producer.consumersConnected(parent.getConnected(WireConstants.WIREADMIN_PRODUCER_PID, - // producerPID)); - // } catch (Exception ex) { - // parent.notifyListeners(this, WireAdminEvent.PRODUCER_EXCEPTION , - // ex); - // } - } - - if (consumerRef != null) { - String consumerPID = (String) properties.get(WireConstants.WIREADMIN_CONSUMER_PID); - NotificationEvent ne = new NotificationEvent(null, consumer, this, parent.getConnected(WireConstants.WIREADMIN_CONSUMER_PID, consumerPID)); - parent.notifyConsumerProducer(ne); - - // try { - // consumer.producersConnected(parent.getConnected(WireConstants.WIREADMIN_CONSUMER_PID, - // consumerPID)); - // } catch (Exception ex) { - // parent.notifyListeners(this, WireAdminEvent.CONSUMER_EXCEPTION , - // ex); - // } - } - } - -} diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/WireProperties.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/WireProperties.java deleted file mode 100644 index e02bae635e..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/WireProperties.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.wireadmin; - -import java.util.Hashtable; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -class WireProperties extends Hashtable { - - static final long serialVersionUID = -8836718065933570367L; - - public synchronized Object put(Object key, Object value) { - throw new RuntimeException("Unsupported operation"); - } - - public synchronized Object remove(Object key) { - throw new RuntimeException("Unsupported operation"); - } - - Object put0(Object key, Object value) { - return super.put(key, value); - } - - Object remove0(Object key) { - return super.remove(key); - } -} diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/WireReDispatcher.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/WireReDispatcher.java deleted file mode 100644 index 5f45ae6629..0000000000 --- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/internal/wireadmin/WireReDispatcher.java +++ /dev/null @@ -1,392 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997-2009 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - * Eurotech - *******************************************************************************/ -package org.eclipse.equinox.internal.wireadmin; - -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Dictionary; -import java.util.Hashtable; -import org.eclipse.equinox.internal.util.ref.Log; -import org.osgi.framework.*; -import org.osgi.service.event.*; -import org.osgi.service.wireadmin.*; -import org.osgi.util.tracker.ServiceTracker; -import org.osgi.util.tracker.ServiceTrackerCustomizer; - -/** - * This is an implementation of log events redispatching. - * - * /** - * - * @author Pavlin Dobrev - * @version 1.0 - */ -public class WireReDispatcher implements WireAdminListener { - - static final String BUNDLE = "bundle"; - static final String BUNDLE_ID = "bundle.id"; - static final String BUNDLE_SYMBOLICNAME = "bundle.symbolicName"; - static final String EVENT = "event"; - static final String EXCEPTION = "exception"; - static final String EXCEPTION_CLASS = "exception.class"; - static final String EXCEPTION_MESSAGE = "exception.message"; - static final String SERVICE = "service"; - static final String SERVICE_ID = "service.id"; - static final String SERVICE_OBJECTCLASS = "service.objectClass"; - static final String SERVICE_PID = "service.pid"; - static final char TOPIC_SEPARATOR = '/'; - /* ///////WIRE ADMIN EVENTS////////// */ - static final String WIRE_HEADER = "org/osgi/service/wireadmin/WireAdminEvent"; - static final String WIRE_CREATED = "WIRE_CREATED"; - static final String WIRE_CONNECTED = "WIRE_CONNECTED"; - static final String WIRE_UPDATED = "WIRE_UPDATED"; - static final String WIRE_TRACE = "WIRE_TRACE"; - static final String WIRE_DISCONNECTED = "WIRE_DISCONNECTED"; - static final String WIRE_DELETED = "WIRE_DELETED"; - static final String PRODUCER_EXCEPTION = "PRODUCER_EXCEPTION"; - static final String CONSUMER_EXCEPTION = "CONSUMER_EXCEPTION"; - - static final String[] EVENT_TOPICS; - - static final String WIRE_ENTRY = "wire.entry"; - static final String WA_WIRE = "wire"; - static final String WA_WIRE_FLAVORS = "wire.flavors"; - static final String WA_WIRE_SCOPE = "wire.scope"; - static final String WA_WIRE_CONNECTED = "wire.connected"; - static final String WA_WIRE_VALID = "wire.valid"; - - static { - EVENT_TOPICS = new String[8]; - EVENT_TOPICS[0] = WIRE_HEADER + TOPIC_SEPARATOR + WIRE_CREATED; - EVENT_TOPICS[1] = WIRE_HEADER + TOPIC_SEPARATOR + WIRE_CONNECTED; - EVENT_TOPICS[2] = WIRE_HEADER + TOPIC_SEPARATOR + WIRE_UPDATED; - EVENT_TOPICS[3] = WIRE_HEADER + TOPIC_SEPARATOR + WIRE_TRACE; - EVENT_TOPICS[4] = WIRE_HEADER + TOPIC_SEPARATOR + WIRE_DISCONNECTED; - EVENT_TOPICS[5] = WIRE_HEADER + TOPIC_SEPARATOR + WIRE_DELETED; - EVENT_TOPICS[6] = WIRE_HEADER + TOPIC_SEPARATOR + PRODUCER_EXCEPTION; - EVENT_TOPICS[7] = WIRE_HEADER + TOPIC_SEPARATOR + CONSUMER_EXCEPTION; - } - - BundleContext bc; - ServiceRegistration waReg; - Log log; - ServiceTracker eventAdminTracker; - ServiceTracker eventHandlerTracker; - EventHandlerIndex eventHandlerIndex; - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bc) throws Exception { - this.bc = bc; - log = new Log(bc, false); - eventHandlerIndex = new EventHandlerIndex(); - log.setDebug(Activator.getBoolean("equinox.wireadmin.redispatcher.debug")); - log.setPrintOnConsole(Activator.getBoolean("equinox.wireadmin.redispatcher.console")); - - eventHandlerTracker = new ServiceTracker(bc, EventHandler.class.getName(), eventHandlerIndex); - eventHandlerTracker.open(); - - eventAdminTracker = new ServiceTracker(bc, EventAdmin.class.getName(), null); - eventAdminTracker.open(); - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop() throws Exception { - if (eventAdminTracker != null) { - eventAdminTracker.close(); - eventAdminTracker = null; - } - if (eventHandlerTracker != null) { - eventHandlerTracker.close(); - eventHandlerTracker = null; - } - log.close(); - this.bc = null; - } - - /* ////////UTILITY METHODS//////// */ - - /* - * Add exception properties needed in event by EventAdmin specification. - */ - void addExceptionProps(Hashtable props, Throwable t) { - props.put(EXCEPTION, t); - props.put(EXCEPTION_CLASS, t.getClass().getName()); - String message = t.getMessage(); - if (message != null) { - props.put(EXCEPTION_MESSAGE, t.getMessage()); - } - } - - /* - * Add service properties needed in event by EventAdmin specification. - */ - void addServiceProps(Hashtable props, ServiceReference ref) { - props.put(SERVICE, ref); - props.put(SERVICE_ID, ref.getProperty(Constants.SERVICE_ID)); - Object tmp = ref.getProperty(Constants.SERVICE_PID); - if (tmp != null && tmp instanceof String) { - props.put(SERVICE_PID, tmp); - } - tmp = ref.getProperty(Constants.OBJECTCLASS); - if (tmp != null && tmp instanceof String[]) { - props.put(SERVICE_OBJECTCLASS, tmp); - } - } - - /* ////////LISTENER METHODS//////// */ - - /* - * (non-Javadoc) - * - * @see org.osgi.service.wireadmin.WireAdminListener#wireAdminEvent(org.osgi.service.wireadmin.WireAdminEvent) - */ - public void wireAdminEvent(WireAdminEvent event) { - ServiceTracker st = eventAdminTracker; - final EventAdmin eventAdmin = st == null ? null : ((EventAdmin) st.getService()); - if (eventAdmin != null) { - ServiceReference ref = event.getServiceReference(); - if (ref == null) { - throw new RuntimeException("Wire Admin ServiceReference is null"); - } - final int topicIndex; - switch (event.getType()) { - case WireAdminEvent.WIRE_CREATED : - topicIndex = 0; - break; - case WireAdminEvent.WIRE_CONNECTED : - topicIndex = 1; - break; - case WireAdminEvent.WIRE_UPDATED : - topicIndex = 2; - break; - case WireAdminEvent.WIRE_TRACE : - topicIndex = 3; - break; - case WireAdminEvent.WIRE_DISCONNECTED : - topicIndex = 4; - break; - case WireAdminEvent.WIRE_DELETED : - topicIndex = 5; - break; - case WireAdminEvent.PRODUCER_EXCEPTION : - topicIndex = 6; - break; - case WireAdminEvent.CONSUMER_EXCEPTION : - topicIndex = 7; - break; - default : /* ignore: unknown/new events */ - return; - } - if (!eventHandlerIndex.hasEventHandlers(topicIndex)) { - if (Activator.LOG_DEBUG) - log.debug(0, 10017, event.toString(), null, false); - return; /* - * no service references for this topic do not bother - * EventAdmin - */ - } - Hashtable props = new Hashtable(); - addServiceProps(props, ref); - Wire wire = event.getWire(); - if (wire != null) { - props.put(WA_WIRE, wire); - props.put(WA_WIRE_CONNECTED, wire.isConnected() ? Boolean.TRUE : Boolean.FALSE); - if (wire.getFlavors() != null) { - props.put(WA_WIRE_FLAVORS, wire.getFlavors()); - } - if (wire.getScope() != null) { - props.put(WA_WIRE_SCOPE, wire.getScope()); - } - props.put(WA_WIRE_VALID, wire.isValid() ? Boolean.TRUE : Boolean.FALSE); - } - Throwable throwable = event.getThrowable(); - if (throwable != null) { - addExceptionProps(props, throwable); - } - props.put(EVENT, event); - final Event eaEvent = new Event(EVENT_TOPICS[topicIndex], (Dictionary) props); - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - eventAdmin.postEvent(eaEvent); - return null; - } - }); - if (Activator.LOG_DEBUG) - log.debug(0, 10018, event.toString(), null, false); - } - } - - /** - * Checks if a topic filter string matches the target topic string. - * - * @param pattern - * A topic filter like "company/product/*" - * @param topic - * Target topic to be checked against like - * "company/product/topicA" - * @return true if topicProperty matches topic, false if otherwise. - */ - protected static boolean matchTopic(String pattern, String topic) { - // //two fast checks - if (pattern.length() > topic.length()) - return false; - if ("*".equals(pattern) || pattern.equals(topic)) - return true; - - // //assume pattern is not NULL ... or check! - int index = pattern.indexOf(TOPIC_SEPARATOR); - if (index == -1 || index == 0 || index == pattern.length() - 1) { - // //syntax problem - // //we have no '/' or starts with '/' or ends with '/' - return false; - } - - for (index = 0; index < pattern.length(); index++) { - if (pattern.charAt(index) == '*') { - // //wildcard!!! - if (pattern.charAt(index - 1) != TOPIC_SEPARATOR) - return false; // we have not '/' before '*' - if (index != pattern.length() - 1) - return false; // we have something after the '*' - return true; - } - if (pattern.charAt(index) != topic.charAt(index)) - return false; - } - - if (index != topic.length()) - return false; - if (pattern.charAt(index - 1) == TOPIC_SEPARATOR) - return false; - return true; - } - - synchronized void register() { - unregister(); - - Hashtable props = new Hashtable(3); - props.put(WireConstants.WIREADMIN_EVENTS, new Integer(Integer.MAX_VALUE)); - waReg = bc.registerService(WireAdminListener.class.getName(), this, props); - } - - synchronized void unregister() { - if (waReg != null) { - waReg.unregister(); - waReg = null; - } - } - - static class EventHandlerTopics { - int topics; - - public EventHandlerTopics(final int topics) { - this.topics = topics; - } - } - - class EventHandlerIndex implements ServiceTrackerCustomizer { - - final int[] eventHandlerCount = new int[EVENT_TOPICS.length]; - int totalEventHandlerCount = 0; - - public synchronized Object addingService(final ServiceReference reference) { - - final int topics = process(reference); - - if (topics != 0 && totalEventHandlerCount++ == 0) { - register(); - } - - return new EventHandlerTopics(topics); - } - - public void modifiedService(ServiceReference reference, Object service) { - - removedService(reference, service); - - final EventHandlerTopics newTopics = (EventHandlerTopics) addingService(reference); - - ((EventHandlerTopics) service).topics = newTopics.topics; - } - - public synchronized void removedService(ServiceReference reference, Object service) { - - final int topics = ((EventHandlerTopics) service).topics; - - if (topics == 0) { - return; - } - - remove(topics); - - if (--totalEventHandlerCount == 0) { - unregister(); - } - } - - int process(final ServiceReference ref) { - - final Object topic = ref.getProperty(EventConstants.EVENT_TOPIC); - - if (!(topic instanceof String[])) { - return 0; - } - - final String[] topics = (String[]) topic; - - int matchingTopics = 0; - - for (int i = 0; i < topics.length; i++) { - matchingTopics |= processTopicPattern(topics[i]); - } - - return matchingTopics; - } - - int processTopicPattern(final String pattern) { - int matchingTopics = 0; - for (int i = 0; i < EVENT_TOPICS.length; i++) { - if (matchTopic(pattern, EVENT_TOPICS[i])) { - eventHandlerCount[i]++; - matchingTopics |= 1 << i; - } - } - return matchingTopics; - } - - void remove(final int topics) { - for (int i = 0; i < EVENT_TOPICS.length; i++) { - if ((topics & (1 << i)) != 0) { - eventHandlerCount[i]--; - } - } - } - - boolean hasEventHandlers(final int topicIndex) { - return eventHandlerCount[topicIndex] != 0; - } - - } - -}