Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2011-11-16 08:59:51 +0000
committerUwe Stieber2011-11-16 08:59:51 +0000
commit8706fb04b6c1417ed8d5ece83bc9fca64ddfc3ce (patch)
tree35ff2855e92a05029eb1a01455c6018c573c7175 /target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent
parent67449886c09c8ec4da4f39082373ab62ccc3d978 (diff)
downloadorg.eclipse.tcf-8706fb04b6c1417ed8d5ece83bc9fca64ddfc3ce.tar.gz
org.eclipse.tcf-8706fb04b6c1417ed8d5ece83bc9fca64ddfc3ce.tar.xz
org.eclipse.tcf-8706fb04b6c1417ed8d5ece83bc9fca64ddfc3ce.zip
Target Explorer: Refactor name space from org.eclipse.tm.te.* to org.eclipse.tcf.te.*
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.classpath7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.options1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.project28
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.settings/org.eclipse.jdt.core.prefs362
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/META-INF/MANIFEST.MF20
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/build.properties6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/plugin.properties15
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/plugin.xml24
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/pom.xml17
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/schema/executorServices.exsd200
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/schema/executorUtilDelegates.exsd200
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/Executors.java141
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/activator/CoreBundleActivator.java71
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/event/ExecutorThreadNotificationListener.java35
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java212
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/executors/SingleThreadedExecutorService.java188
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/factories/SingleThreadThreadFactory.java72
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/IExecutor.java21
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/IExecutorUtilDelegate.java38
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/INestableExecutor.java37
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/ISingleThreadedExecutor.java38
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/nls/Messages.java33
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/nls/Messages.properties6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/util/ExecutorsUtil.java404
25 files changed, 2180 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.classpath b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.classpath
new file mode 100644
index 000000000..8a8f1668c
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.options b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.options
new file mode 100644
index 000000000..7f70160a4
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.options
@@ -0,0 +1 @@
+org.eclipse.tcf.te.runtime.concurrent/debugmode = 0
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.project b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.project
new file mode 100644
index 000000000..b244be733
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.tcf.te.runtime.concurrent</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.settings/org.eclipse.jdt.core.prefs b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..adf6f4442
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,362 @@
+#Fri Oct 07 16:13:32 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+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.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+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=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+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.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+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=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=0
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=0
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=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_superclass_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=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_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+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=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=100
+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=4
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+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_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.lineSplit=100
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.settings/org.eclipse.jdt.ui.prefs b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..07c6724a9
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,4 @@
+#Fri Oct 07 16:13:32 CEST 2011
+eclipse.preferences.version=1
+formatter_profile=_Target Explorer Java STD
+formatter_settings_version=12
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..051f94fa2
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tcf.te.runtime.concurrent;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.tcf.te.runtime.concurrent.activator.CoreBundleActivator
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.tcf.te.runtime;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.eclipse.tcf.te.runtime.concurrent,
+ org.eclipse.tcf.te.runtime.concurrent.activator;x-internal:=true,
+ org.eclipse.tcf.te.runtime.concurrent.event,
+ org.eclipse.tcf.te.runtime.concurrent.executors,
+ org.eclipse.tcf.te.runtime.concurrent.factories,
+ org.eclipse.tcf.te.runtime.concurrent.interfaces,
+ org.eclipse.tcf.te.runtime.concurrent.nls;x-internal:=true,
+ org.eclipse.tcf.te.runtime.concurrent.util
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/build.properties b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/build.properties
new file mode 100644
index 000000000..73a5119ed
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ plugin.xml
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/plugin.properties
new file mode 100644
index 000000000..1cec4c8ab
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/plugin.properties
@@ -0,0 +1,15 @@
+##################################################################################
+# Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Target Explorer, Concurrent Runtime plug-in
+providerName = Eclipse.org
+
+ExtensionPoint.executorServices.name=Executor Services
+ExtensionPoint.executorUtilDelegates.name=Executor Utility Wait and Dispatch Delegates
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/plugin.xml
new file mode 100644
index 000000000..8a2021cf2
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/plugin.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+<!-- Extension point contributions -->
+ <extension-point id="executorServices" name="%ExtensionPoint.executorServices.name" schema="schema/executorServices.exsd"/>
+ <extension-point id="executorUtilDelegates" name="%ExtensionPoint.executorUtilDelegates.name" schema="schema/executorUtilDelegates.exsd"/>
+
+<!-- Executor service contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.concurrent.executorServices">
+ <executorService
+ id="org.eclipse.tcf.te.runtime.concurrent.executors.singleThreaded"
+ label="Single Threaded Executor">
+ <class
+ class="org.eclipse.tcf.te.runtime.concurrent.executors.SingleThreadedExecutorService">
+ <parameter
+ name="threadPoolNamePrefix"
+ value="Target Explorer Single Thread Executor">
+ </parameter>
+ </class>
+ </executorService>
+ </extension>
+
+</plugin>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/pom.xml b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/pom.xml
new file mode 100644
index 000000000..f1e135524
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/pom.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.tcf</groupId>
+ <artifactId>tcf-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../../pom.xml</relativePath>
+ </parent>
+
+ <version>1.0.0.qualifier</version>
+ <artifactId>org.eclipse.tcf.te.runtime.concurrent</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/schema/executorServices.exsd b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/schema/executorServices.exsd
new file mode 100644
index 000000000..f5df3cf14
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/schema/executorServices.exsd
@@ -0,0 +1,200 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.tcf.te.runtime.concurrent" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.tcf.te.runtime.concurrent" id="executorServices" name="Executor Services"/>
+ </appinfo>
+ <documentation>
+ This extension point is used to contribute executor services.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="executorService" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="executorService">
+ <annotation>
+ <documentation>
+ Declares a Wind River executor service contribution.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="class" minOccurs="0" maxOccurs="1"/>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ The unique id of the executor service contribution.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string" use="required">
+ <annotation>
+ <documentation>
+ The label representing the executor service within the UI.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+ The class that implements &lt;code&gt;org.eclipse.tcf.te.runtime.concurrent.interfaces.IExecutor&lt;/code&gt; or extends &lt;code&gt;org.eclipse.tcf.te.runtime.concurrent.executors.AbstractDelegatingExecutorService&lt;/code&gt;.
+&lt;p&gt;
+The executor service implementation class must be specified either by the class attribute or the class child element!
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.tcf.te.runtime.concurrent.executors.AbstractDelegatingExecutorService:org.eclipse.tcf.te.runtime.concurrent.interfaces.IExecutor"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="description" type="string">
+ <annotation>
+ <documentation>
+ A short description of the executor service to be presented in the UI.
+ </documentation>
+ </annotation>
+ </element>
+
+ <element name="class">
+ <annotation>
+ <documentation>
+ &lt;p&gt;Used when creating an &lt;code&gt;IExecutableExtension&lt;/code&gt; with a named parameter, or more than one.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="parameter" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+ The class that implements &lt;code&gt;org.eclipse.tcf.te.runtime.concurrent.interfaces.IExecutor&lt;/code&gt; or extends &lt;code&gt;org.eclipse.tcf.te.runtime.concurrent.executors.AbstractDelegatingExecutorService&lt;/code&gt;.
+&lt;p&gt;
+The executor service implementation class must be specified either by the class attribute or the class child element!
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.tcf.te.runtime.concurrent.executors.AbstractDelegatingExecutorService:org.eclipse.tcf.te.runtime.concurrent.interfaces.IExecutor"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="parameter">
+ <annotation>
+ <documentation>
+ &lt;p&gt;A parameter for an &lt;code&gt;IExecutableExtension&lt;/code&gt;.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ &lt;p&gt;The parameter name.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="value" type="string" use="required">
+ <annotation>
+ <documentation>
+ &lt;p&gt;The parameter value.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ Target Explorer 1.0.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ This is an example of the extension point usage:
+&lt;p&gt;
+&lt;pre&gt;&lt;code&gt;
+ &lt;extension point=&quot;org.eclipse.tcf.te.runtime.concurrent.executorServices&quot;&gt;
+ &lt;executorService
+ id=&quot;org.eclipse.tcf.te.runtime.concurrent.executors.singleThreaded&quot;
+ class=&quot;org.eclipse.tcf.te.runtime.concurrent.executors.SingleThreadedExecutorService&quot;
+ label=&quot;Single Threaded Executor Service&quot;&gt;
+ &lt;/exectorService&gt;
+ &lt;/extension&gt;
+&lt;/code&gt;&lt;/pre&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ The provider of a executor service must implement &lt;samp&gt;org.eclipse.tcf.te.runtime.concurrent.interfaces.IExecutor&lt;/samp&gt;.
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2011 Wind River Systems, Inc. and others.
+
+All rights reserved.
+
+This program and the accompanying materials are made available under the terms
+of the Eclipse Public License v1.0 which accompanies this distribution, and is
+available at http://www.eclipse.org/legal/epl-v10.html.
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/schema/executorUtilDelegates.exsd b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/schema/executorUtilDelegates.exsd
new file mode 100644
index 000000000..3fc2655b4
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/schema/executorUtilDelegates.exsd
@@ -0,0 +1,200 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.tcf.te.runtime.concurrent" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.tcf.te.runtime.concurrent" id="executorUtilDelegates" name="Executor Utility Delegates"/>
+ </appinfo>
+ <documentation>
+ This extension point is used to contribute executor utility delegates.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="executorUtilDelegate" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="executorUtilDelegate">
+ <annotation>
+ <documentation>
+ Declares a Wind River executor utility delegate contribution.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="class" minOccurs="0" maxOccurs="1"/>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ The unique id of the executor utility delegate contribution.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string" use="required">
+ <annotation>
+ <documentation>
+ The label representing the executor utility delegate within the UI.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+ The class that implements &lt;code&gt;org.eclipse.tcf.te.runtime.concurrent.interfaces.IExecutorUtilDelegate&lt;/code&gt;.
+&lt;p&gt;
+The executor utility delegate implementation class must be specified either by the class attribute or the class child element!
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.tcf.te.runtime.concurrent.interfaces.IExecutorUtilDelegate"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="description" type="string">
+ <annotation>
+ <documentation>
+ A short description of the executor utility delegate to be presented in the UI.
+ </documentation>
+ </annotation>
+ </element>
+
+ <element name="class">
+ <annotation>
+ <documentation>
+ &lt;p&gt;Used when creating an &lt;code&gt;IExecutableExtension&lt;/code&gt; with a named parameter, or more than one.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="parameter" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+ The class that implements &lt;code&gt;org.eclipse.tcf.te.runtime.concurrent.interfaces.IExecutorUtilDelegate&lt;/code&gt;.
+&lt;p&gt;
+The executor utility delegate implementation class must be specified either by the class attribute or the class child element!
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.tcf.te.runtime.concurrent.interfaces.IExecutorUtilDelegate"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="parameter">
+ <annotation>
+ <documentation>
+ &lt;p&gt;A parameter for an &lt;code&gt;IExecutableExtension&lt;/code&gt;.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ &lt;p&gt;The parameter name.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="value" type="string" use="required">
+ <annotation>
+ <documentation>
+ &lt;p&gt;The parameter value.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ Target Explorer 1.0.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ This is an example of the extension point usage:
+&lt;p&gt;
+&lt;pre&gt;&lt;code&gt;
+ &lt;extension point=&quot;org.eclipse.tcf.te.runtime.concurrent.executorUtilDelegates&quot;&gt;
+ &lt;executorUtilDelegate
+ id=&quot;org.eclipse.tcf.te.runtime.concurrent.executor.delegates.swt&quot;
+ class=&quot;org.eclipse.tcf.te.ui.swt.executor.delegates.SWTExecutorUtilDelegate&quot;
+ label=&quot;SWT Executor Utility Delegate&quot;&gt;
+ &lt;/exectorUtilDelegate&gt;
+ &lt;/extension&gt;
+&lt;/code&gt;&lt;/pre&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ The provider of a executor utility delegates must implement &lt;samp&gt;org.eclipse.tcf.te.runtime.concurrent.interfaces.IExecutorUtilDelegate&lt;/samp&gt;.
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2011 Wind River Systems, Inc. and others.
+
+All rights reserved.
+
+This program and the accompanying materials are made available under the terms
+of the Eclipse Public License v1.0 which accompanies this distribution, and is
+available at http://www.eclipse.org/legal/epl-v10.html.
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/Executors.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/Executors.java
new file mode 100644
index 000000000..2344035b1
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/Executors.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.concurrent;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tcf.te.runtime.concurrent.interfaces.IExecutor;
+import org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager;
+import org.eclipse.tcf.te.runtime.extensions.ExecutableExtensionProxy;
+
+
+/**
+ * Class is providing the entry points to create or query the executor service
+ * instances.
+ */
+public final class Executors {
+
+ /**
+ * Execution service extension point manager.
+ */
+ protected static class ExecutorServiceExtensionPointManager extends AbstractExtensionPointManager<IExecutor> {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getExtensionPointId()
+ */
+ @Override
+ protected String getExtensionPointId() {
+ return "org.eclipse.tcf.te.runtime.concurrent.executorServices"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getConfigurationElementName()
+ */
+ @Override
+ protected String getConfigurationElementName() {
+ return "executorService"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the list of all contributed executors.
+ *
+ * @return The list of contributed executors, or an empty array.
+ */
+ public IExecutor[] getExecutors() {
+ List<IExecutor> contributions = new ArrayList<IExecutor>();
+ Collection<ExecutableExtensionProxy<IExecutor>> proxies = getExtensions().values();
+ for (ExecutableExtensionProxy<IExecutor> proxy : proxies)
+ if (proxy.getInstance() != null
+ && !contributions.contains(proxy.getInstance()))
+ contributions.add(proxy.getInstance());
+
+ return contributions.toArray(new IExecutor[contributions.size()]);
+ }
+
+ /**
+ * Returns the executor identified by its unique id. If no executor with
+ * the specified id is registered, <code>null</code> is returned.
+ *
+ * @param id
+ * The unique id of the executor. Must not be
+ * <code>null</code>
+ * @param newInstance
+ * Specify <code>true</code> to get a new executor service
+ * instance, <code>false</code> otherwise.
+ *
+ * @return The executor instance or <code>null</code>.
+ */
+ public IExecutor getExecutor(String id, boolean newInstance) {
+ Assert.isNotNull(id);
+
+ IExecutor executorService = null;
+ if (getExtensions().containsKey(id)) {
+ ExecutableExtensionProxy<IExecutor> proxy = getExtensions().get(id);
+ // Get the extension instance
+ executorService = newInstance ? proxy.newInstance() : proxy.getInstance();
+ }
+
+ return executorService;
+ }
+ }
+
+ // Reference to the executor service extension point manager
+ private final static ExecutorServiceExtensionPointManager EXTENSION_POINT_MANAGER = new ExecutorServiceExtensionPointManager();
+
+ /**
+ * Constructor.
+ * <p>
+ * <b>Note:</b> The class cannot be instantiated.
+ */
+ private Executors() {
+ }
+
+ /**
+ * Creates an instance of the executor registered with the specified id. If
+ * no executor is registered under the given id, the method will return
+ * <code>null</code>.
+ *
+ * @param id
+ * The id of the executor. Must not be <code>null</code>.
+ * @return The new executor instance or <code>null</code>.
+ */
+ public static IExecutor newExecutor(String id) {
+ Assert.isNotNull(id);
+ return EXTENSION_POINT_MANAGER.getExecutor(id, true);
+ }
+
+ /**
+ * Returns the shared instance of the executor registered with the specified
+ * id. If the shared instance hasn't been created yet, the instance will be
+ * created and saved. Subsequent calls to this method with the same id will
+ * return always the same executor instance. If no executor is registered
+ * under the given id, the method will return <code>null</code>.
+ *
+ * @param id
+ * The id of the executor. Must not be <code>null</code>.
+ * @return The new executor instance or <code>null</code>.
+ */
+ public static IExecutor getSharedExecutor(String id) {
+ Assert.isNotNull(id);
+ return EXTENSION_POINT_MANAGER.getExecutor(id, false);
+ }
+
+ /**
+ * Returns the shared instances of all registered executors.
+ *
+ * @return All executor instances or an empty array.
+ */
+ public static IExecutor[] getAllSharedExecutors() {
+ return EXTENSION_POINT_MANAGER.getExecutors();
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/activator/CoreBundleActivator.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/activator/CoreBundleActivator.java
new file mode 100644
index 000000000..fe896a055
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/activator/CoreBundleActivator.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.concurrent.activator;
+
+import org.eclipse.tcf.te.runtime.tracing.TraceHandler;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class CoreBundleActivator implements BundleActivator {
+ // The bundle context
+ private static BundleContext context;
+ // The trace handler instance
+ private static TraceHandler traceHandler;
+
+ /**
+ * Returns the bundle context
+ *
+ * @return the bundle context
+ */
+ public static BundleContext getContext() {
+ return context;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plugin.
+ */
+ public static String getUniqueIdentifier() {
+ if (getContext() != null && getContext().getBundle() != null) {
+ return getContext().getBundle().getSymbolicName();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the bundles trace handler.
+ *
+ * @return The bundles trace handler.
+ */
+ public static TraceHandler getTraceHandler() {
+ if (traceHandler == null) {
+ traceHandler = new TraceHandler(getUniqueIdentifier());
+ }
+ return traceHandler;
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext bundleContext) throws Exception {
+ CoreBundleActivator.context = bundleContext;
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext bundleContext) throws Exception {
+ CoreBundleActivator.context = null;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/event/ExecutorThreadNotificationListener.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/event/ExecutorThreadNotificationListener.java
new file mode 100644
index 000000000..74229359f
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/event/ExecutorThreadNotificationListener.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.concurrent.event;
+
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
+import org.eclipse.tcf.te.runtime.interfaces.events.IEventFireDelegate;
+import org.eclipse.tcf.te.runtime.interfaces.events.IEventListener;
+
+/**
+ * Abstract notification listener implementation executing the
+ * notifications within the shared executor thread.
+ */
+public abstract class ExecutorThreadNotificationListener extends PlatformObject implements IEventListener, IEventFireDelegate {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.interfaces.events.IEventFireDelegate#fire(java.lang.Runnable)
+ */
+ @Override
+ public final void fire(Runnable runnable) {
+ // Force notification into the executor thread.
+ //
+ // Note: The executor thread is not identical with the display thread!
+ // Use ExecutorsUtil.executeInUI(runnable) to execute the runnable
+ // within the display thread.
+ ExecutorsUtil.execute(runnable);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java
new file mode 100644
index 000000000..e5df0a65f
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.concurrent.executors;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.tcf.te.runtime.concurrent.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.runtime.concurrent.interfaces.IExecutor;
+import org.eclipse.tcf.te.runtime.concurrent.nls.Messages;
+import org.eclipse.tcf.te.runtime.extensions.ExecutableExtension;
+
+/**
+ * Abstract delegating execution service implementation.
+ */
+public abstract class AbstractDelegatingExecutorService extends ExecutableExtension implements IExecutor, ExecutorService {
+ // The executor service to delegate the API calls to
+ private ExecutorService delegate;
+
+ // The thread pool name prefix
+ private String threadPoolNamePrefix;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.ExecutableExtension#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ super.doSetInitializationData(config, propertyName, data);
+
+ if (config != null && data instanceof Map<?, ?>) {
+ Map<?, ?> params = (Map<?, ?>) data;
+ // Initialize the thread pool name prefix field by reading the
+ // "threadPoolNamePrefix" extension attribute if present.
+ threadPoolNamePrefix = (String) params.get("threadPoolNamePrefix"); //$NON-NLS-1$
+ if (threadPoolNamePrefix == null || threadPoolNamePrefix.trim().length() == 0) {
+ threadPoolNamePrefix = ""; //$NON-NLS-1$
+ }
+ }
+
+ // Create the executor service delegate
+ this.delegate = createExecutorServiceDelegate();
+ Assert.isNotNull(delegate);
+ }
+
+ /**
+ * Returns the thread pool name prefix if specified by the extension.
+ *
+ * @return The thread pool name prefix or an empty string.
+ */
+ public String getThreadPoolNamePrefix() {
+ return threadPoolNamePrefix != null ? threadPoolNamePrefix : ""; //$NON-NLS-1$
+ }
+
+ /**
+ * Invoked by the constructor exactly once to create the executor service
+ * delegate instance.
+ *
+ * @return The executor service instance and never <code>null</code>.
+ */
+ protected abstract ExecutorService createExecutorServiceDelegate();
+
+ /**
+ * Returns the executor service delegate instance.
+ *
+ * @return The executor service delegate instance.
+ */
+ protected final ExecutorService getExecutorServiceDelegate() {
+ return delegate;
+ }
+
+ /**
+ * Log the given exception as error to the error log.
+ *
+ * @param e
+ * The exception or <code>null</code>.
+ */
+ protected void logException(Throwable e) {
+ if (e != null) {
+ IStatus status = new Status(
+ IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ NLS.bind(Messages.AbstractDelegatingExecutorService_unhandledException,
+ e.getLocalizedMessage()), e);
+ Platform.getLog(CoreBundleActivator.getContext().getBundle()).log(status);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.Executor#execute(java.lang.Runnable)
+ */
+ @Override
+ public void execute(Runnable command) {
+ delegate.execute(command);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.ExecutorService#shutdown()
+ */
+ @Override
+ public void shutdown() {
+ delegate.shutdown();
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.ExecutorService#shutdownNow()
+ */
+ @Override
+ public List<Runnable> shutdownNow() {
+ return delegate.shutdownNow();
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.ExecutorService#isShutdown()
+ */
+ @Override
+ public boolean isShutdown() {
+ return delegate.isShutdown();
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.ExecutorService#isTerminated()
+ */
+ @Override
+ public boolean isTerminated() {
+ return delegate.isTerminated();
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.ExecutorService#awaitTermination(long, java.util.concurrent.TimeUnit)
+ */
+ @Override
+ public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
+ return delegate.awaitTermination(timeout, unit);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.ExecutorService#submit(java.util.concurrent.Callable)
+ */
+ @Override
+ public <T> Future<T> submit(Callable<T> task) {
+ return delegate.submit(task);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.ExecutorService#submit(java.lang.Runnable, java.lang.Object)
+ */
+ @Override
+ public <T> Future<T> submit(Runnable task, T result) {
+ return delegate.submit(task, result);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.ExecutorService#submit(java.lang.Runnable)
+ */
+ @Override
+ public Future<?> submit(Runnable task) {
+ return delegate.submit(task);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.ExecutorService#invokeAll(java.util.Collection)
+ */
+ @Override
+ public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException {
+ return delegate.invokeAll(tasks);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.ExecutorService#invokeAll(java.util.Collection, long, java.util.concurrent.TimeUnit)
+ */
+ @Override
+ public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException {
+ return delegate.invokeAll(tasks, timeout, unit);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.ExecutorService#invokeAny(java.util.Collection)
+ */
+ @Override
+ public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException {
+ return delegate.invokeAny(tasks);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.ExecutorService#invokeAny(java.util.Collection, long, java.util.concurrent.TimeUnit)
+ */
+ @Override
+ public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
+ return delegate.invokeAny(tasks, timeout, unit);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/executors/SingleThreadedExecutorService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/executors/SingleThreadedExecutorService.java
new file mode 100644
index 000000000..a2f21c3b5
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/executors/SingleThreadedExecutorService.java
@@ -0,0 +1,188 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.concurrent.executors;
+
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.eclipse.tcf.te.runtime.concurrent.factories.SingleThreadThreadFactory;
+import org.eclipse.tcf.te.runtime.concurrent.interfaces.INestableExecutor;
+import org.eclipse.tcf.te.runtime.concurrent.interfaces.ISingleThreadedExecutor;
+
+/**
+ * A single threaded executor service implementation.
+ */
+public class SingleThreadedExecutorService extends AbstractDelegatingExecutorService implements ISingleThreadedExecutor, INestableExecutor {
+
+ /**
+ * A single threaded executor implementation.
+ */
+ protected class SingleThreadedExecutor extends ThreadPoolExecutor implements INestableExecutor {
+ // The current nesting depth
+ private final AtomicInteger currentNestingDepth = new AtomicInteger(0);
+
+ /**
+ * Constructor.
+ *
+ * @param threadFactory
+ * The thread factory instance. Must not be <code>null</code>.
+ *
+ * @throws NullPointerException
+ * if threadFactory is <code>null</code>.
+ */
+ public SingleThreadedExecutor(ThreadFactory threadFactory) {
+ this(threadFactory, new LinkedBlockingQueue<Runnable>());
+ }
+
+ /**
+ * Constructor.
+ * <p>
+ * Private constructor to catch the work queue instance passed into the
+ * {@link ThreadPoolExecutor} constructor.
+ *
+ * @param threadFactory
+ * The thread factory instance. Must not be <code>null</code>.
+ * @param workQueue
+ * The work queue instance. Must not be <code>null</code>.
+ */
+ private SingleThreadedExecutor(ThreadFactory threadFactory, BlockingQueue<Runnable> workQueue) {
+ super(1, 1, 0L, TimeUnit.NANOSECONDS, workQueue, threadFactory);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.concurrent.interfaces.INestableExecutor#getMaxDepth()
+ */
+ @Override
+ public int getMaxDepth() {
+ return 1;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.concurrent.interfaces.INestableExecutor#readAndExecute()
+ */
+ @Override
+ public boolean readAndExecute() {
+ // Method is callable from the executor thread only
+ if (!isExecutorThread()) {
+ throw new IllegalStateException("Must be called from within the executor thread!"); //$NON-NLS-1$
+ }
+
+ BlockingQueue<Runnable> queue = getQueue();
+
+ // If the work queue is empty, there is nothing to do
+ if (!queue.isEmpty()) {
+ // Work queue not empty, check if we reached the maximum nesting
+ // depth
+ if (currentNestingDepth.get() >= getMaxDepth()) {
+ throw new IllegalStateException("Maximum nesting depth exceeded!"); //$NON-NLS-1$
+ }
+
+ // Get the next work item to do
+ Runnable runnable = null;
+ try {
+ // Double check that the queue is not empty, we desire to
+ // avoid
+ // blocking here!
+ if (!queue.isEmpty()) {
+ runnable = queue.take();
+ }
+ } catch (InterruptedException e) { /* ignored on purpose */ }
+
+ if (runnable != null) {
+ // Increase the nesting depth
+ currentNestingDepth.incrementAndGet();
+ try {
+ // Execute the runnable
+ runnable.run();
+ } finally {
+ // Decrease nesting depth
+ currentNestingDepth.decrementAndGet();
+ }
+ }
+ }
+
+ return !queue.isEmpty();
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.ThreadPoolExecutor#afterExecute(java.lang.Runnable, java.lang.Throwable)
+ */
+ @Override
+ protected void afterExecute(Runnable r, Throwable t) {
+ super.afterExecute(r, t);
+ if (t != null)
+ logException(t);
+ }
+ }
+
+ // Internal reference to the one shot thread factory instance
+ private SingleThreadThreadFactory threadFactory;
+
+ /**
+ * Constructor.
+ */
+ public SingleThreadedExecutorService() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.concurrent.executors.AbstractDelegatingExecutorService#createExecutorServiceDelegate()
+ */
+ @Override
+ protected ExecutorService createExecutorServiceDelegate() {
+ threadFactory = new SingleThreadThreadFactory(getThreadPoolNamePrefix());
+ return new SingleThreadedExecutor(threadFactory);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.concurrent.interfaces.ISingleThreadedExecutor#isExecutorThread()
+ */
+ @Override
+ public final boolean isExecutorThread() {
+ return isExecutorThread(Thread.currentThread());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.concurrent.interfaces.ISingleThreadedExecutor#isExecutorThread(java.lang.Thread)
+ */
+ @Override
+ public final boolean isExecutorThread(Thread thread) {
+ if (thread != null && threadFactory != null) {
+ return thread.equals(threadFactory.getThread());
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.concurrent.interfaces.INestableExecutor#getMaxDepth()
+ */
+ @Override
+ public int getMaxDepth() {
+ if (!(getExecutorServiceDelegate() instanceof INestableExecutor)) {
+ throw new UnsupportedOperationException("Executor service delegate must implement INestableExecutor"); //$NON-NLS-1$
+ }
+ return ((INestableExecutor) getExecutorServiceDelegate()).getMaxDepth();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.concurrent.interfaces.INestableExecutor#readAndExecute()
+ */
+ @Override
+ public boolean readAndExecute() {
+ if (!(getExecutorServiceDelegate() instanceof INestableExecutor)) {
+ throw new UnsupportedOperationException("Executor service delegate must implement INestableExecutor"); //$NON-NLS-1$
+ }
+ return ((INestableExecutor) getExecutorServiceDelegate()).readAndExecute();
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/factories/SingleThreadThreadFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/factories/SingleThreadThreadFactory.java
new file mode 100644
index 000000000..3cf533f25
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/factories/SingleThreadThreadFactory.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.concurrent.factories;
+
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.eclipse.core.runtime.Assert;
+
+/**
+ * A thread factory implementation creating a single thread only.
+ */
+public class SingleThreadThreadFactory implements ThreadFactory {
+ private final ThreadGroup threadGroup;
+ private final String threadName;
+ private Thread thread;
+
+ private final AtomicInteger threadNumber = new AtomicInteger(1);
+
+ /**
+ * Constructor.
+ *
+ * @param namePrefix
+ * The name prefix to name the created threads. Must not be
+ * <code>null</code>.
+ */
+ public SingleThreadThreadFactory(String namePrefix) {
+ Assert.isNotNull(namePrefix);
+
+ // Determine the thread group. Use the security manager if available.
+ this.threadGroup = (System.getSecurityManager() != null) ? System.getSecurityManager().getThreadGroup() : Thread.currentThread().getThreadGroup();
+ // Set the thread name prefix
+ this.threadName = ("".equals(namePrefix.trim()) ? "Executor" : namePrefix) + " - " + threadNumber.getAndIncrement(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.concurrent.ThreadFactory#newThread(java.lang.Runnable)
+ */
+ @Override
+ public Thread newThread(Runnable r) {
+ // The thread can be created on once. If called a second time,
+ // this factory cannot create any additional threads.
+ if (thread != null) return null;
+
+ // Create the thread with the desired name and the current thread number
+ thread = new Thread(threadGroup, r, threadName);
+ thread.setDaemon(false);
+ thread.setPriority(Thread.NORM_PRIORITY);
+
+ // Return the thread
+ return thread;
+ }
+
+ /**
+ * Returns the single created thread instance or <code>null</code> if
+ * {@link #newThread(Runnable)} have not been called yet.
+ *
+ * @return The single created thread instance or <code>null</code>.
+ */
+ public Thread getThread() {
+ return thread;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/IExecutor.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/IExecutor.java
new file mode 100644
index 000000000..9311c5537
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/IExecutor.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.concurrent.interfaces;
+
+import java.util.concurrent.Executor;
+
+import org.eclipse.tcf.te.runtime.interfaces.extensions.IExecutableExtension;
+
+/**
+ * Execution interface declaration.
+ */
+public interface IExecutor extends Executor, IExecutableExtension {
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/IExecutorUtilDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/IExecutorUtilDelegate.java
new file mode 100644
index 000000000..7292f40da
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/IExecutorUtilDelegate.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.concurrent.interfaces;
+
+import org.eclipse.tcf.te.runtime.interfaces.extensions.IExecutableExtension;
+
+/**
+ * Executor utility delegate interface declaration.
+ */
+public interface IExecutorUtilDelegate extends IExecutableExtension {
+
+ /**
+ * Returns if or if not the current thread is an executor thread handled by
+ * this executor utility wait and dispatch delegate.
+ *
+ * @return <code>True</code> if the current thread is handled,
+ * <code>false</code> otherwise.
+ */
+ public boolean isHandledExecutorThread();
+
+ /**
+ * Reads an event from the handled executors event queue, dispatches it
+ * appropriately, and returns <code>true</code> if there is potentially more
+ * work to do, or <code>false</code> if the caller can sleep until another
+ * event is placed on the event queue.
+ *
+ * @return <code>True</code> if there is potentially more work to do,
+ * <code>false</code> otherwise.
+ */
+ public boolean readAndDispatch();
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/INestableExecutor.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/INestableExecutor.java
new file mode 100644
index 000000000..af7171f9e
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/INestableExecutor.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.concurrent.interfaces;
+
+import java.util.concurrent.Executor;
+
+/**
+ * Nestable execution interface declaration.
+ */
+public interface INestableExecutor extends Executor {
+
+ /**
+ * Returns the maximum allowed nesting depth. If this methods returns an
+ * integer value <= 0, nesting is disabled.
+ *
+ * @return The maximum allowed nesting depth or 0 to disable nesting.
+ */
+ public int getMaxDepth();
+
+ /**
+ * Reads the next command from the task queue and execute it if the maximum
+ * allowed nesting depth has not been exceeded. If the maximum nesting depth
+ * has been reached, the method will throw an {@link IllegalStateException}.
+ *
+ * @return <code>True</code> if there is potentially more work to do, or
+ * <code>false</code> if the caller can sleep until another event is
+ * placed on the task queue.
+ */
+ public boolean readAndExecute();
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/ISingleThreadedExecutor.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/ISingleThreadedExecutor.java
new file mode 100644
index 000000000..5ce6ab275
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/interfaces/ISingleThreadedExecutor.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.concurrent.interfaces;
+
+import java.util.concurrent.Executor;
+
+/**
+ * Single threaded execution service interface declaration.
+ */
+public interface ISingleThreadedExecutor extends Executor {
+
+ /**
+ * Returns if or if not the current thread is identical to the executor
+ * thread.
+ *
+ * @return <code>True</code> if the current thread is the executor thread,
+ * <code>false</code> otherwise.
+ */
+ public boolean isExecutorThread();
+
+ /**
+ * Returns if or if not the given thread is identical to the executor
+ * thread.
+ *
+ * @param thread
+ * The thread or <code>null</code>.
+ * @return <code>True</code> if the current thread is the executor thread,
+ * <code>false</code> otherwise.
+ */
+ public boolean isExecutorThread(Thread thread);
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/nls/Messages.java
new file mode 100644
index 000000000..652586645
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/nls/Messages.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.concurrent.nls;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Target Explorer Concurrent Runtime plugin externalized strings management.
+ */
+public class Messages extends NLS {
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tcf.te.runtime.concurrent.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ // **** Declare externalized string id's down here *****
+
+ public static String AbstractDelegatingExecutorService_unhandledException;
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/nls/Messages.properties
new file mode 100644
index 000000000..6e7b09de1
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/nls/Messages.properties
@@ -0,0 +1,6 @@
+#
+# org.eclipse.tcf.te.runtime.concurrent
+# Externalized Strings.
+#
+
+AbstractDelegatingExecutorService_unhandledException=Unhandled exception caught in executor: {0}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/util/ExecutorsUtil.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/util/ExecutorsUtil.java
new file mode 100644
index 000000000..f07026c03
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/util/ExecutorsUtil.java
@@ -0,0 +1,404 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.concurrent.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tcf.te.runtime.concurrent.Executors;
+import org.eclipse.tcf.te.runtime.concurrent.interfaces.IExecutorUtilDelegate;
+import org.eclipse.tcf.te.runtime.concurrent.interfaces.INestableExecutor;
+import org.eclipse.tcf.te.runtime.concurrent.interfaces.ISingleThreadedExecutor;
+import org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager;
+import org.eclipse.tcf.te.runtime.extensions.ExecutableExtensionProxy;
+import org.eclipse.tcf.te.runtime.interfaces.IConditionTester;
+
+
+/**
+ * Utility class to provide helper methods to execute tasks at
+ * a executor service asynchronous and synchronous.
+ */
+public final class ExecutorsUtil {
+
+ /**
+ * Execution utility wait and dispatch utility extension point manager.
+ */
+ protected static class ExecutorUtilDelegateExtensionPointManager extends AbstractExtensionPointManager<IExecutorUtilDelegate> {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getExtensionPointId()
+ */
+ @Override
+ protected String getExtensionPointId() {
+ return "org.eclipse.tcf.te.runtime.concurrent.executorUtilDelegates"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getConfigurationElementName()
+ */
+ @Override
+ protected String getConfigurationElementName() {
+ return "executorUtilDelegate"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the list of all contributed executor utility delegates.
+ *
+ * @return The list of contributed executor utility delegates, or an
+ * empty array.
+ */
+ public IExecutorUtilDelegate[] getExecutorUtilDelegates() {
+ List<IExecutorUtilDelegate> contributions = new ArrayList<IExecutorUtilDelegate>();
+ Collection<ExecutableExtensionProxy<IExecutorUtilDelegate>> proxies = getExtensions().values();
+ for (ExecutableExtensionProxy<IExecutorUtilDelegate> proxy : proxies) {
+ if (proxy.getInstance() != null&& !contributions.contains(proxy.getInstance())) {
+ contributions.add(proxy.getInstance());
+ }
+ }
+
+ return contributions.toArray(new IExecutorUtilDelegate[contributions.size()]);
+ }
+
+ /**
+ * Returns the executor utility delegate identified by its unique id. If
+ * no executor utility delegate with the specified id is registered,
+ * <code>null</code> is returned.
+ *
+ * @param id
+ * The unique id of the executor utility delegate. Must not
+ * be <code>null</code>
+ * @param newInstance
+ * Specify <code>true</code> to get a new executor utility
+ * delegate instance, <code>false</code> otherwise.
+ *
+ * @return The executor instance or <code>null</code>.
+ */
+ public IExecutorUtilDelegate getExecutorUtilDelegate(String id, boolean newInstance) {
+ Assert.isNotNull(id);
+
+ IExecutorUtilDelegate executorUtilDelegate = null;
+ if (getExtensions().containsKey(id)) {
+ ExecutableExtensionProxy<IExecutorUtilDelegate> proxy = getExtensions().get(id);
+ // Get the extension instance
+ executorUtilDelegate = newInstance ? proxy.newInstance() : proxy.getInstance();
+ }
+
+ return executorUtilDelegate;
+ }
+ }
+
+ // Reference to the executor service extension point manager
+ private final static ExecutorUtilDelegateExtensionPointManager EXTENSION_POINT_MANAGER = new ExecutorUtilDelegateExtensionPointManager();
+
+ // Reference to the used executor service.
+ private final static ISingleThreadedExecutor EXECUTOR;
+ // Reference to the used UI executor service (might be null if not available)
+ private final static ISingleThreadedExecutor UI_EXECUTOR;
+
+ /**
+ * Static constructor.
+ */
+ static {
+ EXECUTOR = (ISingleThreadedExecutor) Executors.getSharedExecutor("org.eclipse.tcf.te.runtime.concurrent.executors.singleThreaded"); //$NON-NLS-1$
+ Assert.isNotNull(EXECUTOR);
+ UI_EXECUTOR = (ISingleThreadedExecutor) Executors.getSharedExecutor("org.eclipse.tcf.te.ui.executors.SWTDisplay"); //$NON-NLS-1$
+ }
+
+ /**
+ * Shutdown the executor service used.
+ */
+ public static void shutdown() {
+ if (EXECUTOR instanceof ExecutorService) {
+ ((ExecutorService) EXECUTOR).shutdown();
+ }
+ if (UI_EXECUTOR instanceof ExecutorService) {
+ ((ExecutorService) UI_EXECUTOR).shutdown();
+ }
+ }
+
+ /**
+ * Checks if the current thread is identical with the executor thread.
+ *
+ * @return <code>True</code> if the current thread is the executor thread,
+ * <code>false</code> otherwise.
+ */
+ public static boolean isExecutorThread() {
+ return EXECUTOR != null ? EXECUTOR.isExecutorThread() : false;
+ }
+
+ /**
+ * Checks if the current thread is identical with the UI executor thread.
+ *
+ * @return <code>True</code> if the current thread is the UI executor
+ * thread, <code>false</code> otherwise.
+ */
+ public static boolean isUIExecutorThread() {
+ return UI_EXECUTOR != null ? UI_EXECUTOR.isExecutorThread() : false;
+ }
+
+ /**
+ * Schedule the given {@link Runnable} for invocation within the used
+ * executor thread.
+ *
+ * @param runnable
+ * The <code>java.lang.Runnable</code> to execute within the
+ * executor thread.
+ */
+ public static void execute(Runnable runnable) {
+ if (runnable != null) {
+ if (EXECUTOR instanceof ExecutorService) {
+ if (!((ExecutorService) EXECUTOR).isShutdown()
+ && !((ExecutorService) EXECUTOR).isTerminated()) {
+ EXECUTOR.execute(runnable);
+ }
+ } else {
+ EXECUTOR.execute(runnable);
+ }
+ }
+ }
+
+
+ /**
+ * Schedule the given {@link Runnable} for invocation within the used
+ * executor thread and blocks the caller until the runnable got executed.
+ * <p>
+ * <b>Note:</b> The method is using {@link #wait()} to block the calling
+ * thread. Therefore the method cannot be called from within
+ * the executor thread itself.
+ *
+ * @param runnable
+ * The <code>java.lang.Runnable</code> to execute within the
+ * executor thread.
+ */
+ public static void executeWait(final Runnable runnable) {
+ Assert.isTrue(!EXECUTOR.isExecutorThread());
+ if (runnable == null) return;
+
+ final AtomicBoolean invoked = new AtomicBoolean(false);
+
+ // Wrap the original runnable in another runnable
+ // to notify ourself
+ Runnable r = new Runnable() {
+ @Override
+ public void run() {
+ try {
+ runnable.run();
+ } finally {
+ invoked.set(true);
+ synchronized(runnable) {
+ runnable.notifyAll();
+ }
+ }
+ }
+ };
+
+ if (EXECUTOR instanceof ExecutorService) {
+ if (!((ExecutorService) EXECUTOR).isShutdown()
+ && !((ExecutorService) EXECUTOR).isTerminated()) {
+ EXECUTOR.execute(r);
+ }
+ } else {
+ EXECUTOR.execute(r);
+ }
+
+ synchronized(runnable) {
+ try {
+ if (!invoked.get()) runnable.wait();
+ } catch (InterruptedException e) {
+ /* ignored on purpose */
+ }
+ }
+ }
+
+ /**
+ * Schedule the given {@link Runnable} to run the current platform display
+ * thread and blocks the caller until the runnable got executed.
+ *
+ * @param runnable
+ * The <code>java.lang.Runnable</code> to execute within the
+ * UI thread.
+ */
+ public static void executeInUI(Runnable runnable) {
+ if (runnable != null) {
+ if (UI_EXECUTOR instanceof ExecutorService) {
+ if (!((ExecutorService) UI_EXECUTOR).isShutdown()
+ && !((ExecutorService) UI_EXECUTOR).isTerminated()) {
+ UI_EXECUTOR.execute(runnable);
+ }
+ } else {
+ if (UI_EXECUTOR != null) {
+ UI_EXECUTOR.execute(runnable);
+ }
+ }
+ }
+ }
+
+ /**
+ * Schedule the given {@link Runnable} to run the current platform display
+ * thread and blocks the caller until the runnable got executed.
+ *
+ * @param runnable
+ * The <code>java.lang.Runnable</code> to execute within the
+ * UI thread.
+ */
+ public static void executeInUIWait(final Runnable runnable) {
+ if (runnable == null) return;
+
+ final AtomicBoolean invoked = new AtomicBoolean(false);
+
+ // Wrap the original runnable in another runnable
+ // to set the invoked flag
+ Runnable r = new Runnable() {
+ @Override
+ public void run() {
+ try {
+ runnable.run();
+ } finally {
+ invoked.set(true);
+ }
+ }
+ };
+
+ if (UI_EXECUTOR instanceof ExecutorService) {
+ if (!((ExecutorService) UI_EXECUTOR).isShutdown()
+ && !((ExecutorService) UI_EXECUTOR).isTerminated()) {
+ UI_EXECUTOR.execute(r);
+ }
+ } else {
+ if (UI_EXECUTOR != null) {
+ UI_EXECUTOR.execute(r);
+ } else {
+ invoked.set(true);
+ }
+ }
+
+ waitAndExecute(0, new IConditionTester() {
+ @Override
+ public boolean isConditionFulfilled() {
+ return invoked.get();
+ }
+ @Override
+ public void cleanup() {
+ }
+ });
+ }
+
+ /**
+ * Waits either for the given condition tester to signal that the condition,
+ * the caller want's to wait for, has been completely fulfilled or till the
+ * timeout runs out. If the specified condition tester is <code>null</code>,
+ * the method will always wait till the timeout occurs. In case
+ * <code>timeout == 0</code> and <code>conditionTester == null</code>, the
+ * method returns immediately with the return value <code>true</code>!
+ *
+ * @param timeout
+ * The timeout to wait in milliseconds. <code>0</code> means
+ * infinite wait time!
+ * @param conditionTester
+ * The condition tester to use for checking the interrupt
+ * condition.
+ *
+ * @return <code>false</code> if the exit reason if that the waiting
+ * condition has been fulfilled, <code>true</code> if the exit
+ * reason is the timeout!
+ */
+ public static boolean waitAndExecute(final long timeout, final IConditionTester conditionTester) {
+ // both parameter are null, return immediately!
+ if (conditionTester == null && timeout == 0)
+ return true;
+
+ // we assume that the exit reason will be the timeout
+ boolean exitReason = true;
+
+ // Remember the executors utility delegate down the road. As long
+ // we don't leave the waitAndExecute method, the thread cannot change.
+ IExecutorUtilDelegate lastDelegate = null;
+
+ // Remember the start time to calculate the timeout
+ final long startTime = System.currentTimeMillis();
+ // keep going till either the condition tester or the timeout will
+ // break the loop!
+ while (true) {
+ if (conditionTester != null && conditionTester.isConditionFulfilled()) {
+ // the exit reason is the condition tester!
+ exitReason = false;
+ break;
+ }
+ if (timeout != 0 && ((System.currentTimeMillis() - startTime) >= timeout)) {
+ // timeout occurred, just break the loop
+ break;
+ }
+ // none of the break conditions are fulfilled, so wait a little bit
+ // before testing again.
+ if (isExecutorThread()) {
+ // We are in the executor thread. Keep the command dispatching running.
+ if (EXECUTOR instanceof INestableExecutor) {
+ ((INestableExecutor) EXECUTOR).readAndExecute();
+ Thread.yield();
+ } else {
+ throw new IllegalStateException("waitAndExecute called from within a non-nestable executor service!"); //$NON-NLS-1$
+ }
+ }
+ // Check if we are in the UI executor thread
+ else if (isUIExecutorThread()) {
+ // We are in the executor thread. Keep the command dispatching
+ // running.
+ if (UI_EXECUTOR instanceof INestableExecutor) {
+ ((INestableExecutor) UI_EXECUTOR).readAndExecute();
+ Thread.yield();
+ } else {
+ throw new IllegalStateException("waitAndExecute called from within a non-nestable UI executor service!"); //$NON-NLS-1$
+ }
+ }
+ // Check if we have a delegate contribution which is handling
+ // the current thread.
+ else {
+ boolean foundHandlingDelegate = false;
+
+ if (lastDelegate == null) {
+ // Get all registered delegates
+ IExecutorUtilDelegate[] delegates = EXTENSION_POINT_MANAGER.getExecutorUtilDelegates();
+ for (IExecutorUtilDelegate delegate : delegates) {
+ // Does the delegate handles the current thread?
+ if (delegate.isHandledExecutorThread()) {
+ foundHandlingDelegate = true;
+ lastDelegate = delegate;
+ // Read and dispatch one event
+ delegate.readAndDispatch();
+ break;
+ }
+ }
+ } else {
+ foundHandlingDelegate = true;
+ // Read and dispatch one event
+ lastDelegate.readAndDispatch();
+ }
+
+ if (!foundHandlingDelegate) {
+ // Not in any executor thread, put the current thread to sleep
+ try {
+ Thread.sleep(10);
+ } catch (InterruptedException e) { /* ignored on purpose */ }
+ }
+ }
+ }
+
+ // give the condition tester the chance to cleanup
+ if (conditionTester != null) {
+ conditionTester.cleanup();
+ }
+
+ return exitReason;
+ }
+}

Back to the top