diff --git a/plugins/org.eclipse.dd.doc.dsf/docs/pda/dsf_common_patterns.html b/plugins/org.eclipse.dd.doc.dsf/docs/pda/dsf_common_patterns.html new file mode 100644 index 00000000000..da0a8d99b5b --- /dev/null +++ b/plugins/org.eclipse.dd.doc.dsf/docs/pda/dsf_common_patterns.html @@ -0,0 +1,159 @@ + + + + DSF Common Patterns + + +

DSF Common Patterns
+

+

Summary

+

DSF

+ +

Asynchronous Methods

+One of the central features of DSF is that it relies very heavily on +the use of asynchronous methods.  Asynchronous methods here mean +simply methods that use a callback +object to indicate their completion. The use of asynchronous +methods can be very contageous in a system, where if a lower level API +is composed of asynchronous methods, a higher level system which uses +those methods also has to have asynchronous methods in its interface +(or risk blocking its calling thread).
+
+TODO? : diagram of a layered system with asynchronous APIs
+

Request Monitor

+There is a standard callback object used in DSF, the request +monitor.  A request monitor has the following features:
+ +Following is the snippet from a the "hello world" example of using a +request monitor:
+
 26: public class AsyncHelloWorld {

28: public static void main(String[] args) {
29: Executor executor = ImmediateExecutor.getInstance();
30: RequestMonitor rm = new RequestMonitor(executor, null);
31: asyncHelloWorld(rm);
32: }

34: static void asyncHelloWorld(RequestMonitor rm) {
35: System.out.println("Hello world");
36: rm.done();
37: }
+ +

Data Request Monitor

+The base request monitor is useful for returning status of the +asynchronous method, but they do not have an option of returning a +value to the caller.  DataRequestMonitor can be used for that +purpose. A simple example of using the data request monitor:
+
 22: public class Async2Plus2 {

24: public static void main(String[] args) {
25: Executor executor = ImmediateExecutor.getInstance();
26: DataRequestMonitor<Integer> rm =
27: new DataRequestMonitor<Integer>(executor, null) {
28: @Override
29: protected void handleCompleted() {
30: System.out.println("2 + 2 = " + getData());
31: }
32: };
33: asyncAdd(2, 2, rm);
34: }

36: static void asyncAdd(int value1, int value2, DataRequestMonitor<Integer> rm) {
37: rm.setData(value1 + value2);
38: rm.done();
39: }
40: }
+ +

Multi-Request Monitor

+A common problem when using asynchronous is that several asynchronous +methods need to be called in parallel, so the calling method needs to +somehow manage the completion of several request monitors.  +CountingRequestMonitor can be used for this purpose.  It is +configured such that it's done() method needs to be called a count number of times before the +callback method is invoked. 
+The following snipped from the AsyncQuicksort example shows a simple +example of using the CountingRequestMonitor:
+
 42:     static void asyncQuicksort(final int[] array, final int left, 
43: final int right, RequestMonitor rm)
44: {
45: if (right > left) {
46: int pivot = left;
47: int newPivot = partition(array, left, right, pivot);
48: printArray(array, left, right, newPivot);
49:
50: CountingRequestMonitor countingRm = new CountingRequestMonitor(fgExecutor, rm);
51: asyncQuicksort(array, left, newPivot - 1, countingRm);
52: asyncQuicksort(array, newPivot + 1, right, countingRm);
53: countingRm.setDoneCount(2);
54: } else {
55: rm.done();
56: }
57: }
+ +

Non-Executor Thread

+

Future

+

Query

+

Concurrency Annotations
+

+

Services

+

OSGi

+

Session

+

Tracker

+

Data Model

+

View Model

+

Adapter, Provider, Node

+

Timers

+ + diff --git a/plugins/org.eclipse.dd.doc.dsf/docs/pda/pda_tutorial_outline.html b/plugins/org.eclipse.dd.doc.dsf/docs/pda/pda_tutorial_outline.html new file mode 100644 index 00000000000..b9582503897 --- /dev/null +++ b/plugins/org.eclipse.dd.doc.dsf/docs/pda/pda_tutorial_outline.html @@ -0,0 +1,100 @@ + + + + How to write a DSF-based debugger + + +

How to write a DSF-based debugger
+

+

Summary

+

DSF

+ +

Push Down Automata (PDA)
+

+ +

PDA debugger
+

+ +

Launching
+

+ +
 51:     public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException {

52: // Need to configure the source locator before creating the launch
53: // because once the launch is created and added to launch manager,
54: // the adapters will be created for the whole session, including
55: // the source lookup adapter.
56: ISourceLocator locator = getSourceLocator(configuration);

58: return new PDALaunch(configuration, mode, locator);
59: }
+ +

Connecting
+

+ +

View Model

+ +

Run Control

+ +

Breakpoints

+ +

Stack

+ +

Source Display

+ +

Variables

+ + +