Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Changed error handling from Exception to Error

  • Loading branch information...
commit 17949202ec01c4c23d5ce84936ad18b170117c03 1 parent d4a4cda
Sebastien Diot authored

Showing 48 changed files with 430 additions and 372 deletions. Show diff stats Hide diff stats

  1. 4  src/main/java/org/agilewiki/jactor/ExceptionHandler.java
  2. 50  src/main/java/org/agilewiki/jactor/JAFuture.java
  3. 39  src/main/java/org/agilewiki/jactor/JAMailboxFactory.java
  4. 13  src/main/java/org/agilewiki/jactor/MailboxFactory.java
  5. 168  src/main/java/org/agilewiki/jactor/apc/JAPCMailbox.java
  6. 49  src/main/java/org/agilewiki/jactor/concurrent/JAThreadManager.java
  7. 7  src/main/java/org/agilewiki/jactor/concurrent/ThreadManager.java
  8. 233  src/main/java/org/agilewiki/jactor/lpc/JLPCActor.java
  9. 2  src/main/java/org/agilewiki/jactor/lpc/TransparentException.java
  10. 15  src/main/java/org/agilewiki/jactor/lpc/package-info.java
  11. 2  src/main/java/org/agilewiki/jactor/osgi/Activator.java
  12. 7  src/test/java/org/agilewiki/jactor/basics/Actor4.java
  13. 2  src/test/java/org/agilewiki/jactor/continuation/ContinuationTest.java
  14. 2  src/test/java/org/agilewiki/jactor/lpc/ASATest.java
  15. 2  src/test/java/org/agilewiki/jactor/lpc/EventTest.java
  16. 2  src/test/java/org/agilewiki/jactor/lpc/SSATest.java
  17. 2  src/test/java/org/agilewiki/jactor/lpc/ShATest.java
  18. 12  src/test/java/org/agilewiki/jactor/lpc/calculatorTest/CalculatorTest.java
  19. 88  src/test/java/org/agilewiki/jactor/lpc/calculatorTest/PrintingCalculator.java
  20. 4  src/test/java/org/agilewiki/jactor/lpc/exceptionsTest/AsyncTest.java
  21. 11  src/test/java/org/agilewiki/jactor/lpc/exceptionsTest/Driver.java
  22. 4  src/test/java/org/agilewiki/jactor/lpc/exceptionsTest/SharedMailboxTest.java
  23. 4  src/test/java/org/agilewiki/jactor/lpc/exceptionsTest/SyncTest.java
  24. 2  src/test/java/org/agilewiki/jactor/lpc/serverTest/ServerTest.java
  25. 2  src/test/java/org/agilewiki/jactor/lpc/syncTiming/Sync1Test.java
  26. 2  src/test/java/org/agilewiki/jactor/lpc/timingTest/AsyncMailboxTest.java
  27. 2  src/test/java/org/agilewiki/jactor/lpc/timingTest/MailboxTest.java
  28. 2  src/test/java/org/agilewiki/jactor/lpc/timingTest/SharedMailboxTest.java
  29. 10  src/test/java/org/agilewiki/jactor/multithreadingTest/ResponsePrinterTest.java
  30. 2  src/test/java/org/agilewiki/jactor/nbLock/NBLockTest.java
  31. 2  src/test/java/org/agilewiki/jactor/nbLock/exceptionsTest/NBLockExceptionsTest.java
  32. 24  src/test/java/org/agilewiki/jactor/nbLock/exceptionsTest/Process.java
  33. 2  src/test/java/org/agilewiki/jactor/properties/PropertiesTest.java
  34. 2  src/test/java/org/agilewiki/jactor/pubsub/actorName/ActorNameTest.java
  35. 2  src/test/java/org/agilewiki/jactor/pubsub/publish/PublishTest.java
  36. 2  src/test/java/org/agilewiki/jactor/simpleMachine/CallTest.java
  37. 2  src/test/java/org/agilewiki/jactor/simpleMachine/GotoTest.java
  38. 2  src/test/java/org/agilewiki/jactor/simpleMachine/IfFTest.java
  39. 2  src/test/java/org/agilewiki/jactor/simpleMachine/IfVTest.java
  40. 2  src/test/java/org/agilewiki/jactor/simpleMachine/IteratorTest.java
  41. 2  src/test/java/org/agilewiki/jactor/simpleMachine/ReturnFTest.java
  42. 2  src/test/java/org/agilewiki/jactor/simpleMachine/ReturnVTest.java
  43. 2  src/test/java/org/agilewiki/jactor/simpleMachine/SendFFTest.java
  44. 2  src/test/java/org/agilewiki/jactor/simpleMachine/SendFVTest.java
  45. 2  src/test/java/org/agilewiki/jactor/simpleMachine/SendVFTest.java
  46. 2  src/test/java/org/agilewiki/jactor/simpleMachine/SendVVTest.java
  47. 2  src/test/java/org/agilewiki/jactor/simpleMachine/SetFTest.java
  48. 2  src/test/java/org/agilewiki/jactor/simpleMachine/SetVTest.java
4  src/main/java/org/agilewiki/jactor/ExceptionHandler.java
@@ -47,7 +47,7 @@
47 47
  *     protected void processRequest(final Object request, final RP rp)
48 48
  *             throws Exception {
49 49
  *         setExceptionHandler(new ExceptionHandler() {
50  
- *             public void process(Exception exception) throws Exception {
  50
+ *             public void process(Throwable exception) throws Exception {
51 51
  *                 System.out.println("Exception caught by Doer");
52 52
  *                 rp.process(null);
53 53
  *             }
@@ -68,5 +68,5 @@
68 68
      * @param exception The exception to be processed.
69 69
      * @throws Exception Any uncaught exceptions raised while processing the exception.
70 70
      */
71  
-    void process(Exception exception) throws Exception;
  71
+    void process(final Throwable exception) throws Exception;
72 72
 }
50  src/main/java/org/agilewiki/jactor/JAFuture.java
@@ -23,6 +23,9 @@
23 23
  */
24 24
 package org.agilewiki.jactor;
25 25
 
  26
+import java.util.ArrayList;
  27
+import java.util.concurrent.Semaphore;
  28
+
26 29
 import org.agilewiki.jactor.apc.JAMessage;
27 30
 import org.agilewiki.jactor.apc.JARequest;
28 31
 import org.agilewiki.jactor.apc.JAResponse;
@@ -31,9 +34,6 @@
31 34
 import org.agilewiki.jactor.lpc.Request;
32 35
 import org.agilewiki.jactor.lpc.RequestSource;
33 36
 
34  
-import java.util.ArrayList;
35  
-import java.util.concurrent.Semaphore;
36  
-
37 37
 /**
38 38
  * <p>
39 39
  * Used both in the program's main method and in testing to send a request to an actor and wait for a response.
@@ -58,20 +58,19 @@
58 58
     /**
59 59
      * Receives the response as a bufferedEvent.
60 60
      */
61  
-    private BufferedEventsDestination<JAMessage> bufferedEventsDestination =
62  
-            new BufferedEventsDestination<JAMessage>() {
63  
-                @Override
64  
-                public void putBufferedEvents(ArrayList<JAMessage> bufferedEvents) {
65  
-                    JAResponse japcResponse = (JAResponse) bufferedEvents.get(0);
66  
-                    result = japcResponse.getUnwrappedResponse();
67  
-                    done.release();
68  
-                }
69  
-            };
  61
+    private final BufferedEventsDestination<JAMessage> bufferedEventsDestination = new BufferedEventsDestination<JAMessage>() {
  62
+        @Override
  63
+        public void putBufferedEvents(final ArrayList<JAMessage> bufferedEvents) {
  64
+            final JAResponse japcResponse = (JAResponse) bufferedEvents.get(0);
  65
+            result = japcResponse.getUnwrappedResponse();
  66
+            done.release();
  67
+        }
  68
+    };
70 69
 
71 70
     /**
72 71
      * Serves as the originator of a request.
73 72
      */
74  
-    private RequestSource requestSource = new RequestSource() {
  73
+    private final RequestSource requestSource = new RequestSource() {
75 74
         @Override
76 75
         final public Mailbox getMailbox() {
77 76
             return null;
@@ -83,20 +82,23 @@ public ExceptionHandler getExceptionHandler() {
83 82
         }
84 83
 
85 84
         @Override
86  
-        public void setExceptionHandler(ExceptionHandler exceptionHandler) {
  85
+        public void setExceptionHandler(final ExceptionHandler exceptionHandler) {
87 86
             throw new UnsupportedOperationException();
88 87
         }
89 88
 
90 89
         @Override
91  
-        final public void responseFrom(final BufferedEventsQueue<JAMessage> eventQueue,
92  
-                                       final JAResponse japcResponse) {
  90
+        final public void responseFrom(
  91
+                final BufferedEventsQueue<JAMessage> eventQueue,
  92
+                final JAResponse japcResponse) {
93 93
             eventQueue.send(bufferedEventsDestination, japcResponse);
94 94
         }
95 95
 
96 96
         @Override
97  
-        final public void send(final BufferedEventsDestination<JAMessage> destination,
98  
-                               final JARequest japcRequest) {
99  
-            final ArrayList<JAMessage> bufferedEvents = new ArrayList<JAMessage>(1);
  97
+        final public void send(
  98
+                final BufferedEventsDestination<JAMessage> destination,
  99
+                final JARequest japcRequest) {
  100
+            final ArrayList<JAMessage> bufferedEvents = new ArrayList<JAMessage>(
  101
+                    1);
100 102
             bufferedEvents.add(japcRequest);
101 103
             destination.putBufferedEvents(bufferedEvents);
102 104
         }
@@ -110,20 +112,22 @@ final public void send(final BufferedEventsDestination<JAMessage> destination,
110 112
      * @return The unwrapped response.
111 113
      * @throws Exception Any uncaught exceptions raised while processing the request.
112 114
      */
113  
-    public Object send(final Actor actor,
114  
-                       final Request request)
  115
+    public Object send(final Actor actor, final Request request)
115 116
             throws Exception {
116 117
         done = new Semaphore(0);
117 118
         actor.acceptRequest(requestSource, request, new RP() {
118 119
             @Override
119  
-            public void processResponse(Object response) throws Exception {
  120
+            public void processResponse(final Object response) throws Exception {
120 121
                 result = response;
121 122
                 done.release();
122 123
             }
123 124
         });
124 125
         done.acquire();
125 126
         done = null;
126  
-        if (result instanceof Exception) throw (Exception) result;
  127
+        if (result instanceof Exception)
  128
+            throw (Exception) result;
  129
+        if (result instanceof Error)
  130
+            throw (Error) result;
127 131
         return result;
128 132
     }
129 133
 }
39  src/main/java/org/agilewiki/jactor/JAMailboxFactory.java
@@ -23,16 +23,16 @@
23 23
  */
24 24
 package org.agilewiki.jactor;
25 25
 
26  
-import org.agilewiki.jactor.concurrent.JAThreadManager;
27  
-import org.agilewiki.jactor.concurrent.ThreadManager;
28  
-import org.agilewiki.jactor.lpc.JLPCMailbox;
29  
-import org.agilewiki.jactor.lpc.Request;
30  
-
31 26
 import java.util.ArrayList;
32 27
 import java.util.Iterator;
33 28
 import java.util.List;
34 29
 import java.util.Timer;
35 30
 
  31
+import org.agilewiki.jactor.concurrent.JAThreadManager;
  32
+import org.agilewiki.jactor.concurrent.ThreadManager;
  33
+import org.agilewiki.jactor.lpc.JLPCMailbox;
  34
+import org.agilewiki.jactor.lpc.Request;
  35
+
36 36
 /**
37 37
  * <p>
38 38
  * Implements MailboxFactory.
@@ -48,7 +48,7 @@
48 48
  * </pre>
49 49
  */
50 50
 public class JAMailboxFactory implements MailboxFactory {
51  
-    private List<Closable> closables = new ArrayList<Closable>();
  51
+    private final List<Closable> closables = new ArrayList<Closable>();
52 52
     private Timer timer = null;
53 53
 
54 54
     @Override
@@ -62,9 +62,9 @@ public Timer timer() throws Exception {
62 62
     /**
63 63
      * The thread manager.
64 64
      */
65  
-    private ThreadManager threadManager;
  65
+    private final ThreadManager threadManager;
66 66
 
67  
-    public JAMailboxFactory(ThreadManager threadManager) {
  67
+    public JAMailboxFactory(final ThreadManager threadManager) {
68 68
         this.threadManager = threadManager;
69 69
     }
70 70
 
@@ -74,8 +74,9 @@ public JAMailboxFactory(ThreadManager threadManager) {
74 74
      * @param threadCount The number of concurrent to be used.
75 75
      * @return A new JAMailboxFactory.
76 76
      */
77  
-    public static JAMailboxFactory newMailboxFactory(int threadCount) {
78  
-        return new JAMailboxFactory(JAThreadManager.newThreadManager(threadCount));
  77
+    public static JAMailboxFactory newMailboxFactory(final int threadCount) {
  78
+        return new JAMailboxFactory(
  79
+                JAThreadManager.newThreadManager(threadCount));
79 80
     }
80 81
 
81 82
     /**
@@ -83,19 +84,20 @@ public static JAMailboxFactory newMailboxFactory(int threadCount) {
83 84
      *
84 85
      * @return The thread manager.
85 86
      */
  87
+    @Override
86 88
     public ThreadManager getThreadManager() {
87 89
         return threadManager;
88 90
     }
89 91
 
90 92
     @Override
91  
-    public boolean addClosable(Closable closable) {
  93
+    public boolean addClosable(final Closable closable) {
92 94
         if (closable == null)
93 95
             throw new IllegalArgumentException("may not be null");
94 96
         return closables.add(closable);
95 97
     }
96 98
 
97 99
     @Override
98  
-    public boolean removeClosable(Closable closable) {
  100
+    public boolean removeClosable(final Closable closable) {
99 101
         return closables.remove(closable);
100 102
     }
101 103
 
@@ -104,8 +106,8 @@ public boolean removeClosable(Closable closable) {
104 106
      */
105 107
     @Override
106 108
     public void close() {
107  
-        List<Closable> c = new ArrayList<Closable>(closables);
108  
-        Iterator<Closable> it = c.iterator();
  109
+        final List<Closable> c = new ArrayList<Closable>(closables);
  110
+        final Iterator<Closable> it = c.iterator();
109 111
         while (it.hasNext())
110 112
             it.next().close();
111 113
         if (timer != null)
@@ -136,13 +138,14 @@ final public Mailbox createAsyncMailbox() {
136 138
     }
137 139
 
138 140
     @Override
139  
-    public void eventException(Request request, Exception exception) {
140  
-        logException(false, request.getClass().getName() +
141  
-                " event exception: ", exception);
  141
+    public void eventException(final Request request, final Throwable exception) {
  142
+        logException(false,
  143
+                request.getClass().getName() + " event exception: ", exception);
142 144
     }
143 145
 
144 146
     @Override
145  
-    public void logException(boolean fatal, String msg, Exception exception) {
  147
+    public void logException(final boolean fatal, final String msg,
  148
+            final Throwable exception) {
146 149
         threadManager.logException(fatal, msg, exception);
147 150
     }
148 151
 }
13  src/main/java/org/agilewiki/jactor/MailboxFactory.java
@@ -23,11 +23,11 @@
23 23
  */
24 24
 package org.agilewiki.jactor;
25 25
 
  26
+import java.util.Timer;
  27
+
26 28
 import org.agilewiki.jactor.concurrent.ThreadManager;
27 29
 import org.agilewiki.jactor.lpc.Request;
28 30
 
29  
-import java.util.Timer;
30  
-
31 31
 /**
32 32
  * Creates Mailboxes and provides access to the thread manager.
33 33
  */
@@ -53,18 +53,19 @@
53 53
      */
54 54
     Mailbox createAsyncMailbox();
55 55
 
56  
-    public boolean addClosable(Closable closable);
  56
+    public boolean addClosable(final Closable closable);
57 57
 
58  
-    public boolean removeClosable(Closable closable);
  58
+    public boolean removeClosable(final Closable closable);
59 59
 
60 60
     /**
61 61
      * Stop all the threads as they complete their tasks.
62 62
      */
63 63
     public void close();
64 64
 
65  
-    public void eventException(Request request, Exception exception);
  65
+    public void eventException(final Request request, final Throwable exception);
66 66
 
67  
-    public void logException(boolean fatal, String msg, Exception exception);
  67
+    public void logException(final boolean fatal, final String msg,
  68
+            final Throwable exception);
68 69
 
69 70
     public Timer timer() throws Exception;
70 71
 }
168  src/main/java/org/agilewiki/jactor/apc/JAPCMailbox.java
@@ -23,6 +23,8 @@
23 23
  */
24 24
 package org.agilewiki.jactor.apc;
25 25
 
  26
+import java.util.ArrayList;
  27
+
26 28
 import org.agilewiki.jactor.ExceptionHandler;
27 29
 import org.agilewiki.jactor.MailboxFactory;
28 30
 import org.agilewiki.jactor.bufferedEvents.BufferedEventsDestination;
@@ -32,8 +34,6 @@
32 34
 import org.agilewiki.jactor.events.EventProcessor;
33 35
 import org.agilewiki.jactor.events.EventQueue;
34 36
 
35  
-import java.util.ArrayList;
36  
-
37 37
 /**
38 38
  * An implementation of APCMailbox.
39 39
  */
@@ -61,69 +61,88 @@
61 61
      *
62 62
      * @param bufferedEventQueue The lower-level mailbox which transports messages as 1-way events.
63 63
      */
64  
-    public JAPCMailbox(BufferedEventsQueue<JAMessage> bufferedEventQueue, final MailboxFactory mailboxFactory) {
  64
+    public JAPCMailbox(final BufferedEventsQueue<JAMessage> bufferedEventQueue,
  65
+            final MailboxFactory mailboxFactory) {
65 66
         this.bufferedEventQueue = bufferedEventQueue;
66  
-        bufferedEventQueue.setActiveEventProcessor(new EventProcessor<JAMessage>() {
67  
-            @Override
68  
-            public void haveEvents() {
69  
-                dispatchEvents();
70  
-            }
71  
-
72  
-            @Override
73  
-            public void processEvent(JAMessage event) {
74  
-                if (event instanceof JARequest) {
75  
-                    currentRequest = (JARequest) event;
76  
-                    try {
77  
-                        setExceptionHandler(null);
78  
-                        currentRequest.getUnwrappedRequest().processRequest(currentRequest.getDestinationActor(), currentRequest);
79  
-                    } catch (Exception ex) {
80  
-                        if (exceptionHandler == null) {
81  
-                            if (currentRequest.isEvent()) {
82  
-                                mailboxFactory.eventException(currentRequest.getUnwrappedRequest(), ex);
83  
-                            } else
84  
-                                response(currentRequest, ex);
85  
-                        } else try {
86  
-                            exceptionHandler.process(ex);
87  
-                        } catch (Exception ex2) {
88  
-                            if (currentRequest.isEvent()) {
89  
-                                mailboxFactory.eventException(currentRequest.getUnwrappedRequest(), ex2);
90  
-                            } else
91  
-                                response(currentRequest, ex2);
92  
-                        }
  67
+        bufferedEventQueue
  68
+                .setActiveEventProcessor(new EventProcessor<JAMessage>() {
  69
+                    @Override
  70
+                    public void haveEvents() {
  71
+                        dispatchEvents();
93 72
                     }
94  
-                } else {
95  
-                    JAResponse jaResponse = (JAResponse) event;
96  
-                    JARequest jaRequest = jaResponse.getRequest();
97  
-                    try {
98  
-                        Object response = jaResponse.getUnwrappedResponse();
99  
-                        jaRequest.restoreSourceMailbox();
100  
-                        if (response instanceof Exception) {
101  
-                            processException(jaRequest.sourceRequest, (Exception) response);
102  
-                        } else try {
103  
-                            jaRequest.rp.processResponse(response);
104  
-                        } catch (Exception ex) {
105  
-                            processException(jaRequest.sourceRequest, ex);
  73
+
  74
+                    @Override
  75
+                    public void processEvent(final JAMessage event) {
  76
+                        if (event instanceof JARequest) {
  77
+                            currentRequest = (JARequest) event;
  78
+                            try {
  79
+                                setExceptionHandler(null);
  80
+                                currentRequest.getUnwrappedRequest()
  81
+                                        .processRequest(
  82
+                                                currentRequest
  83
+                                                        .getDestinationActor(),
  84
+                                                currentRequest);
  85
+                            } catch (final Throwable ex) {
  86
+                                if (exceptionHandler == null) {
  87
+                                    if (currentRequest.isEvent()) {
  88
+                                        mailboxFactory.eventException(
  89
+                                                currentRequest
  90
+                                                        .getUnwrappedRequest(),
  91
+                                                ex);
  92
+                                    } else
  93
+                                        response(currentRequest, ex);
  94
+                                } else
  95
+                                    try {
  96
+                                        exceptionHandler.process(ex);
  97
+                                    } catch (final Throwable ex2) {
  98
+                                        if (currentRequest.isEvent()) {
  99
+                                            mailboxFactory.eventException(
  100
+                                                    currentRequest
  101
+                                                            .getUnwrappedRequest(),
  102
+                                                    ex2);
  103
+                                        } else
  104
+                                            response(currentRequest, ex2);
  105
+                                    }
  106
+                            }
  107
+                        } else {
  108
+                            final JAResponse jaResponse = (JAResponse) event;
  109
+                            final JARequest jaRequest = jaResponse.getRequest();
  110
+                            try {
  111
+                                final Object response = jaResponse
  112
+                                        .getUnwrappedResponse();
  113
+                                jaRequest.restoreSourceMailbox();
  114
+                                if (response instanceof Throwable) {
  115
+                                    processException(jaRequest.sourceRequest,
  116
+                                            (Throwable) response);
  117
+                                } else
  118
+                                    try {
  119
+                                        jaRequest.rp.processResponse(response);
  120
+                                    } catch (final Throwable ex) {
  121
+                                        processException(
  122
+                                                jaRequest.sourceRequest, ex);
  123
+                                    }
  124
+                            } catch (final Throwable e) {
  125
+                                mailboxFactory.logException(false,
  126
+                                        "Unsupported Operation", e);
  127
+                                throw new UnsupportedOperationException(e);
  128
+                            } finally {
  129
+                                jaRequest.reset();
  130
+                            }
106 131
                         }
107  
-                    } catch (Exception e) {
108  
-                        mailboxFactory.logException(false, "Unsupported Operation", e);
109  
-                        throw new UnsupportedOperationException(e);
110  
-                    } finally {
111  
-                        jaRequest.reset();
112 132
                     }
113  
-                }
114  
-            }
115 133
 
116  
-            private void processException(JARequest jaRequest, Exception ex) {
117  
-                if (exceptionHandler != null)
118  
-                    try {
119  
-                        exceptionHandler.process(ex);
120  
-                        return;
121  
-                    } catch (Exception x) {
122  
-                        ex = x;
  134
+                    private void processException(final JARequest jaRequest,
  135
+                            Throwable ex) {
  136
+                        if (exceptionHandler != null)
  137
+                            try {
  138
+                                exceptionHandler.process(ex);
  139
+                                return;
  140
+                            } catch (final Throwable x) {
  141
+                                ex = x;
  142
+                            }
  143
+                        response(jaRequest, ex);
123 144
                     }
124  
-                response(jaRequest, ex);
125  
-            }
126  
-        });
  145
+                });
127 146
     }
128 147
 
129 148
     /**
@@ -132,8 +151,10 @@ private void processException(JARequest jaRequest, Exception ex) {
132 151
      * @param threadManager Provides a thread for processing dispatched events.
133 152
      * @param autonomous    Inhibits the acquireControl operation when true.
134 153
      */
135  
-    public JAPCMailbox(ThreadManager threadManager, boolean autonomous, MailboxFactory mailboxFactory) {
136  
-        this(new JABufferedEventsQueue<JAMessage>(threadManager, autonomous), mailboxFactory);
  154
+    public JAPCMailbox(final ThreadManager threadManager,
  155
+            final boolean autonomous, final MailboxFactory mailboxFactory) {
  156
+        this(new JABufferedEventsQueue<JAMessage>(threadManager, autonomous),
  157
+                mailboxFactory);
137 158
     }
138 159
 
139 160
     /**
@@ -152,7 +173,8 @@ final public ExceptionHandler getExceptionHandler() {
152 173
      * @param exceptionHandler The exception handler.
153 174
      */
154 175
     @Override
155  
-    final public void setExceptionHandler(final ExceptionHandler exceptionHandler) {
  176
+    final public void setExceptionHandler(
  177
+            final ExceptionHandler exceptionHandler) {
156 178
         this.exceptionHandler = exceptionHandler;
157 179
     }
158 180
 
@@ -161,6 +183,7 @@ final public void setExceptionHandler(final ExceptionHandler exceptionHandler) {
161 183
      *
162 184
      * @return The request message being processed.
163 185
      */
  186
+    @Override
164 187
     final public JARequest getCurrentRequest() {
165 188
         return currentRequest;
166 189
     }
@@ -170,7 +193,8 @@ final public JARequest getCurrentRequest() {
170 193
      *
171 194
      * @param currentRequest The request message being processed.
172 195
      */
173  
-    final public void setCurrentRequest(JARequest currentRequest) {
  196
+    @Override
  197
+    final public void setCurrentRequest(final JARequest currentRequest) {
174 198
         this.currentRequest = currentRequest;
175 199
     }
176 200
 
@@ -198,7 +222,8 @@ public boolean dispatchEvents() {
198 222
      * @param bufferedEvents The events to be processed.
199 223
      */
200 224
     @Override
201  
-    final public void putBufferedEvents(ArrayList<JAMessage> bufferedEvents) {
  225
+    final public void putBufferedEvents(
  226
+            final ArrayList<JAMessage> bufferedEvents) {
202 227
         bufferedEventQueue.putBufferedEvents(bufferedEvents);
203 228
     }
204 229
 
@@ -216,7 +241,7 @@ final public void sendPendingMessages() {
216 241
      * @param initialBufferCapacity The initial capacity for buffered outgoing messages.
217 242
      */
218 243
     @Override
219  
-    final public void setInitialBufferCapacity(int initialBufferCapacity) {
  244
+    final public void setInitialBufferCapacity(final int initialBufferCapacity) {
220 245
         bufferedEventQueue.setInitialBufferCapacity(initialBufferCapacity);
221 246
     }
222 247
 
@@ -227,7 +252,8 @@ final public void setInitialBufferCapacity(int initialBufferCapacity) {
227 252
      * @param request     The request to be sent.
228 253
      */
229 254
     @Override
230  
-    public void send(BufferedEventsDestination<JAMessage> destination, JARequest request) {
  255
+    public void send(final BufferedEventsDestination<JAMessage> destination,
  256
+            final JARequest request) {
231 257
         bufferedEventQueue.send(destination, request);
232 258
     }
233 259
 
@@ -237,7 +263,8 @@ public void send(BufferedEventsDestination<JAMessage> destination, JARequest req
237 263
      * @param unwrappedResponse
238 264
      */
239 265
     @Override
240  
-    final public void response(JARequest jaRequest, Object unwrappedResponse) {
  266
+    final public void response(final JARequest jaRequest,
  267
+            final Object unwrappedResponse) {
241 268
         if (jaRequest.isActive()) {
242 269
             jaRequest.inactive();
243 270
             jaRequest.response(bufferedEventQueue, unwrappedResponse);
@@ -249,14 +276,15 @@ final public void response(JARequest jaRequest, Object unwrappedResponse) {
249 276
      *
250 277
      * @return The event queue.
251 278
      */
  279
+    @Override
252 280
     public EventQueue<ArrayList<JAMessage>> getEventQueue() {
253 281
         return bufferedEventQueue.getEventQueue();
254 282
     }
255 283
 
256 284
     /*
257 285
     final public void processResponse(JARequest jaRequest, Object response) {
258  
-        if (response instanceof Exception) {
259  
-            processException(jaRequest, (Exception) response);
  286
+        if (response instanceof Throwable) {
  287
+            processException(jaRequest, (Throwable) response);
260 288
             return;
261 289
         }
262 290
         if (jaRequest.isEvent()) {
@@ -300,7 +328,7 @@ private void processSyncResponse(JARequest jaRequest, Object response) {
300 328
         }
301 329
         try {
302 330
             jaRequest.handleResponse(response);
303  
-        } catch (Exception ex) {
  331
+        } catch (Throwable ex) {
304 332
             ex.printStackTrace();
305 333
             System.exit(1);
306 334
         }
49  src/main/java/org/agilewiki/jactor/concurrent/JAThreadManager.java
@@ -23,13 +23,13 @@
23 23
  */
24 24
 package org.agilewiki.jactor.concurrent;
25 25
 
26  
-import org.slf4j.Logger;
27  
-import org.slf4j.LoggerFactory;
28  
-
29 26
 import java.util.concurrent.ConcurrentLinkedQueue;
30 27
 import java.util.concurrent.Semaphore;
31 28
 import java.util.concurrent.ThreadFactory;
32 29
 
  30
+import org.slf4j.Logger;
  31
+import org.slf4j.LoggerFactory;
  32
+
33 33
 /**
34 34
  * A high performance implementation of ThreadManager.
35 35
  */
@@ -68,8 +68,8 @@
68 68
      * @param threadCount The number of concurrent to be used.
69 69
      * @return A new JAThreadManager.
70 70
      */
71  
-    public static ThreadManager newThreadManager(int threadCount) {
72  
-        ThreadFactory threadFactory = new JAThreadFactory();
  71
+    public static ThreadManager newThreadManager(final int threadCount) {
  72
+        final ThreadFactory threadFactory = new JAThreadFactory();
73 73
         return newThreadManager(threadCount, threadFactory);
74 74
     }
75 75
 
@@ -80,8 +80,9 @@ public static ThreadManager newThreadManager(int threadCount) {
80 80
      * @param threadFactory Used to create the concurrent.
81 81
      * @return A new JAThreadManager.
82 82
      */
83  
-    public static ThreadManager newThreadManager(int threadCount, ThreadFactory threadFactory) {
84  
-        ThreadManager threadManager = new JAThreadManager();
  83
+    public static ThreadManager newThreadManager(final int threadCount,
  84
+            final ThreadFactory threadFactory) {
  85
+        final ThreadManager threadManager = new JAThreadManager();
85 86
         threadManager.start(threadCount, threadFactory);
86 87
         return threadManager;
87 88
     }
@@ -93,30 +94,35 @@ public static ThreadManager newThreadManager(int threadCount, ThreadFactory thre
93 94
      * @param threadFactory Used to create the concurrent.
94 95
      */
95 96
     @Override
96  
-    final public void start(int threadCount, ThreadFactory threadFactory) {
  97
+    final public void start(final int threadCount,
  98
+            final ThreadFactory threadFactory) {
97 99
         this.threadCount = threadCount;
98  
-        Runnable runnable = new Runnable() {
  100
+        final Runnable runnable = new Runnable() {
99 101
             @Override
100 102
             public void run() {
101 103
                 while (true) {
102 104
                     try {
103 105
                         taskRequest.acquire();
104  
-                        if (closing) return;
105  
-                        Runnable task = tasks.poll();
  106
+                        if (closing)
  107
+                            return;
  108
+                        final Runnable task = tasks.poll();
106 109
                         if (task != null)
107 110
                             try {
108 111
                                 task.run();
109  
-                            } catch (Exception e) {
110  
-                                logException(false, "Exception thrown by a task's run method", e);
  112
+                            } catch (final Throwable e) {
  113
+                                logException(
  114
+                                        false,
  115
+                                        "Exception thrown by a task's run method",
  116
+                                        e);
111 117
                             }
112  
-                    } catch (InterruptedException e) {
  118
+                    } catch (final InterruptedException e) {
113 119
                     }
114 120
                 }
115 121
             }
116 122
         };
117 123
         threads = new Thread[this.threadCount];
118 124
         for (int c = 0; c < threadCount; c++) {
119  
-            Thread t = threadFactory.newThread(runnable);
  125
+            final Thread t = threadFactory.newThread(runnable);
120 126
             threads[c] = t;
121 127
             t.start();
122 128
         }
@@ -128,7 +134,7 @@ public void run() {
128 134
      * @param task A task to be processed on another thread.
129 135
      */
130 136
     @Override
131  
-    final public void process(Runnable task) {
  137
+    final public void process(final Runnable task) {
132 138
         tasks.add(task);
133 139
         taskRequest.release();
134 140
     }
@@ -143,17 +149,17 @@ final public void process(Runnable task) {
143 149
     final public void close() {
144 150
         closing = true;
145 151
         taskRequest.release(threadCount);
146  
-        Thread ct = Thread.currentThread();
147  
-        for (Thread t : threads) {
  152
+        final Thread ct = Thread.currentThread();
  153
+        for (final Thread t : threads) {
148 154
             if (ct != t) {
149 155
                 t.interrupt();
150 156
             }
151 157
         }
152  
-        for (Thread t : threads) {
  158
+        for (final Thread t : threads) {
153 159
             if (ct != t) {
154 160
                 try {
155 161
                     t.join();
156  
-                } catch (InterruptedException e) {
  162
+                } catch (final InterruptedException e) {
157 163
                 }
158 164
             }
159 165
         }
@@ -162,7 +168,8 @@ final public void close() {
162 168
     }
163 169
 
164 170
     @Override
165  
-    public void logException(boolean fatal, String msg, Exception exception) {
  171
+    public void logException(final boolean fatal, final String msg,
  172
+            final Throwable exception) {
166 173
         if (fatal)
167 174
             logger.error(msg, exception);
168 175
         else
7  src/main/java/org/agilewiki/jactor/concurrent/ThreadManager.java
@@ -37,19 +37,20 @@
37 37
      * @param threadCount   The number of concurrent to be used.
38 38
      * @param threadFactory Used to create the concurrent.
39 39
      */
40  
-    public void start(int threadCount, ThreadFactory threadFactory);
  40
+    public void start(final int threadCount, final ThreadFactory threadFactory);
41 41
 
42 42
     /**
43 43
      * Begin running a task.
44 44
      *
45 45
      * @param runnable The run method is to be called by another thread.
46 46
      */
47  
-    public void process(Runnable runnable);
  47
+    public void process(final Runnable runnable);
48 48
 
49 49
     /**
50 50
      * Stop all the threads as they complete their tasks.
51 51
      */
52 52
     public void close();
53 53
 
54  
-    public void logException(boolean fatal, String msg, Exception exception);
  54
+    public void logException(final boolean fatal, final String msg,
  55
+            final Throwable exception);
55 56
 }
233  src/main/java/org/agilewiki/jactor/lpc/JLPCActor.java
@@ -23,15 +23,24 @@
23 23
  */
24 24
 package org.agilewiki.jactor.lpc;
25 25
 
26  
-import org.agilewiki.jactor.*;
27  
-import org.agilewiki.jactor.apc.*;
  26
+import java.util.ArrayList;
  27
+
  28
+import org.agilewiki.jactor.Actor;
  29
+import org.agilewiki.jactor.ExceptionHandler;
  30
+import org.agilewiki.jactor.JANoResponse;
  31
+import org.agilewiki.jactor.Mailbox;
  32
+import org.agilewiki.jactor.MailboxFactory;
  33
+import org.agilewiki.jactor.RP;
  34
+import org.agilewiki.jactor.apc.APCRequestSource;
  35
+import org.agilewiki.jactor.apc.JAMessage;
  36
+import org.agilewiki.jactor.apc.JARequest;
  37
+import org.agilewiki.jactor.apc.JAResponse;
  38
+import org.agilewiki.jactor.apc.RequestProcessor;
28 39
 import org.agilewiki.jactor.bufferedEvents.BufferedEventsDestination;
29 40
 import org.agilewiki.jactor.bufferedEvents.BufferedEventsQueue;
30 41
 import org.agilewiki.jactor.events.EventQueue;
31 42
 import org.agilewiki.jactor.simpleMachine._SMBuilder;
32 43
 
33  
-import java.util.ArrayList;
34  
-
35 44
 /**
36 45
  * <p>
37 46
  * An actor which implements Local Procedure Calls (LPC)
@@ -58,7 +67,8 @@
58 67
  * }
59 68
  * </pre>
60 69
  */
61  
-abstract public class JLPCActor implements TargetActor, RequestProcessor, RequestSource {
  70
+abstract public class JLPCActor implements TargetActor, RequestProcessor,
  71
+        RequestSource {
62 72
     /**
63 73
      * The inbox and outbox of the actor.
64 74
      */
@@ -81,7 +91,7 @@ public void initialize() throws Exception {
81 91
      *
82 92
      * @param parent The parent actor.
83 93
      */
84  
-    public void initialize(Actor parent) throws Exception {
  94
+    public void initialize(final Actor parent) throws Exception {
85 95
         initialize(null, parent);
86 96
     }
87 97
 
@@ -100,7 +110,8 @@ public void initialize(final Mailbox mailbox) throws Exception {
100 110
      * @param mailbox A mailbox which may be shared with other actors.
101 111
      * @param parent  The parent actor.
102 112
      */
103  
-    public void initialize(final Mailbox mailbox, Actor parent) throws Exception {
  113
+    public void initialize(final Mailbox mailbox, final Actor parent)
  114
+            throws Exception {
104 115
         if (this.mailbox != null || this.parent != null)
105 116
             throw new IllegalStateException("already initialized");
106 117
         this.mailbox = mailbox;
@@ -117,7 +128,8 @@ final public JLPCActor getParent() {
117 128
         return parent;
118 129
     }
119 130
 
120  
-    public JLPCActor getMatch(Class targetClass) {
  131
+    @Override
  132
+    public JLPCActor getMatch(final Class targetClass) {
121 133
         if (targetClass.isInstance(this))
122 134
             return this;
123 135
         return getAncestor(targetClass);
@@ -130,7 +142,7 @@ public JLPCActor getMatch(Class targetClass) {
130 142
      * @return The matching ancestor, or null.
131 143
      */
132 144
     @Override
133  
-    final public JLPCActor getAncestor(Class targetClass) {
  145
+    final public JLPCActor getAncestor(final Class targetClass) {
134 146
         if (parent == null)
135 147
             return null;
136 148
         if (targetClass.isInstance(parent))
@@ -154,7 +166,8 @@ final public ExceptionHandler getExceptionHandler() {
154 166
      * @param exceptionHandler The exception handler.
155 167
      */
156 168
     @Override
157  
-    final public void setExceptionHandler(final ExceptionHandler exceptionHandler) {
  169
+    final public void setExceptionHandler(
  170
+            final ExceptionHandler exceptionHandler) {
158 171
         mailbox.setExceptionHandler(exceptionHandler);
159 172
     }
160 173
 
@@ -183,8 +196,9 @@ final public Mailbox getMailbox() {
183 196
      * @param japcResponse The wrapped response to be enqueued.
184 197
      */
185 198
     @Override
186  
-    final public void responseFrom(final BufferedEventsQueue<JAMessage> eventQueue,
187  
-                                   final JAResponse japcResponse) {
  199
+    final public void responseFrom(
  200
+            final BufferedEventsQueue<JAMessage> eventQueue,
  201
+            final JAResponse japcResponse) {
188 202
         eventQueue.send(mailbox, japcResponse);
189 203
     }
190 204
 
@@ -195,8 +209,9 @@ final public void responseFrom(final BufferedEventsQueue<JAMessage> eventQueue,
195 209
      * @param japcRequest The wrapped request to be sent.
196 210
      */
197 211
     @Override
198  
-    final public void send(final BufferedEventsDestination<JAMessage> destination,
199  
-                           final JARequest japcRequest) {
  212
+    final public void send(
  213
+            final BufferedEventsDestination<JAMessage> destination,
  214
+            final JARequest japcRequest) {
200 215
         mailbox.send(destination, japcRequest);
201 216
     }
202 217
 
@@ -219,12 +234,10 @@ final public void setInitialBufferCapacity(final int initialBufferCapacity) {
219 234
      * @throws Exception Any uncaught exceptions raised while processing the request.
220 235
      */
221 236
     @Override
222  
-    final public void acceptRequest(APCRequestSource apcRequestSource,
223  
-                                    Request request,
224  
-                                    RP rp)
225  
-            throws Exception {
226  
-        RequestSource rs = (RequestSource) apcRequestSource;
227  
-        Mailbox sourceMailbox = rs.getMailbox();
  237
+    final public void acceptRequest(final APCRequestSource apcRequestSource,
  238
+            final Request request, final RP rp) throws Exception {
  239
+        final RequestSource rs = (RequestSource) apcRequestSource;
  240
+        final Mailbox sourceMailbox = rs.getMailbox();
228 241
         if (sourceMailbox == mailbox) {
229 242
             syncSend(rs, request, rp);
230 243
             return;
@@ -236,13 +249,13 @@ final public void acceptRequest(APCRequestSource apcRequestSource,
236 249
         acceptOtherRequest(sourceMailbox, rs, request, rp);
237 250
     }
238 251
 
239  
-    private void acceptOtherRequest(
240  
-            Mailbox sourceMailbox,
241  
-            RequestSource rs,
242  
-            Request request,
243  
-            RP rp) throws Exception {
244  
-        EventQueue<ArrayList<JAMessage>> eventQueue = mailbox.getEventQueue();
245  
-        EventQueue<ArrayList<JAMessage>> srcController = sourceMailbox.getEventQueue().getController();
  252
+    private void acceptOtherRequest(final Mailbox sourceMailbox,
  253
+            final RequestSource rs, final Request request, final RP rp)
  254
+            throws Exception {
  255
+        final EventQueue<ArrayList<JAMessage>> eventQueue = mailbox
  256
+                .getEventQueue();
  257
+        final EventQueue<ArrayList<JAMessage>> srcController = sourceMailbox
  258
+                .getEventQueue().getController();
246 259
         if (eventQueue.getController() == srcController) {
247 260
             syncSend(rs, request, rp);
248 261
             return;
@@ -260,29 +273,17 @@ private void acceptOtherRequest(
260 273
         }
261 274
     }
262 275
 
263  
-    private void asyncSend(final RequestSource rs,
264  
-                           final Request request,
265  
-                           final RP rp)
266  
-            throws Exception {
267  
-        AsyncRequest asyncRequest = new AsyncRequest(
268  
-                rs,
269  
-                this,
270  
-                request,
271  
-                rp,
272  
-                mailbox);
  276
+    private void asyncSend(final RequestSource rs, final Request request,
  277
+            final RP rp) throws Exception {
  278
+        final AsyncRequest asyncRequest = new AsyncRequest(rs, this, request,
  279
+                rp, mailbox);
273 280
         rs.send(mailbox, asyncRequest);
274 281
     }
275 282
 
276  
-    private void syncSend(RequestSource rs,
277  
-                          Request request,
278  
-                          RP rp)
279  
-            throws Exception {
280  
-        SyncRequest syncRequest = new SyncRequest(
281  
-                rs,
282  
-                JLPCActor.this,
283  
-                request,
284  
-                rp,
285  
-                mailbox);
  283
+    private void syncSend(final RequestSource rs, final Request request,
  284
+            final RP rp) throws Exception {
  285
+        final SyncRequest syncRequest = new SyncRequest(rs, JLPCActor.this,
  286
+                request, rp, mailbox);
286 287
         mailbox.setCurrentRequest(syncRequest);
287 288
         try {
288 289
             setExceptionHandler(null);
@@ -291,12 +292,19 @@ private void syncSend(RequestSource rs,
291 292
                 syncRequest.async = true;
292 293
                 syncRequest.restoreSourceMailbox();
293 294
             }
294  
-        } catch (TransparentException tx) {
295  
-            throw (Exception) tx.getCause();
296  
-        } catch (Exception ex) {
  295
+        } catch (final TransparentException tx) {
  296
+            final Throwable cause = tx.getCause();
  297
+            if (cause instanceof Exception) {
  298
+                throw (Exception) cause;
  299
+            }
  300
+            throw (Error) cause;
  301
+        } catch (final Throwable ex) {
297 302
             if (!syncRequest.sync)
298 303
                 syncRequest.restoreSourceMailbox();
299  
-            throw ex;
  304
+            if (ex instanceof Exception) {
  305
+                throw (Exception) ex;
  306
+            }
  307
+            throw (Error) ex;
300 308
         }
301 309
     }
302 310
 
@@ -308,12 +316,12 @@ private void syncSend(RequestSource rs,
308 316
      * @throws Exception Any uncaught exceptions raised while processing the request.
309 317
      */
310 318
     @Override
311  
-    final public void acceptEvent(APCRequestSource apcRequestSource,
312  
-                                  Request request)
313  
-            throws Exception {
314  
-        RequestSource rs = (RequestSource) apcRequestSource;
315  
-        ExceptionHandler sourceExceptionHandler = rs.getExceptionHandler();
316  
-        Mailbox sourceMailbox = rs.getMailbox();
  319
+    final public void acceptEvent(final APCRequestSource apcRequestSource,
  320
+            final Request request) throws Exception {
  321
+        final RequestSource rs = (RequestSource) apcRequestSource;
  322
+        final ExceptionHandler sourceExceptionHandler = rs
  323
+                .getExceptionHandler();
  324
+        final Mailbox sourceMailbox = rs.getMailbox();
317 325
         if (sourceMailbox == mailbox) {
318 326
             syncSendEvent(rs, request, sourceExceptionHandler);
319 327
             return;
@@ -322,8 +330,10 @@ final public void acceptEvent(APCRequestSource apcRequestSource,
322 330
             asyncSendEvent(rs, request);
323 331
             return;
324 332
         }
325  
-        EventQueue<ArrayList<JAMessage>> eventQueue = mailbox.getEventQueue();
326  
-        EventQueue<ArrayList<JAMessage>> srcController = sourceMailbox.getEventQueue().getController();
  333
+        final EventQueue<ArrayList<JAMessage>> eventQueue = mailbox
  334
+                .getEventQueue();
  335
+        final EventQueue<ArrayList<JAMessage>> srcController = sourceMailbox
  336
+                .getEventQueue().getController();
327 337
         if (eventQueue.getController() == srcController) {
328 338
             syncSendEvent(rs, request, sourceExceptionHandler);
329 339
             return;
@@ -347,8 +357,9 @@ final public void acceptEvent(APCRequestSource apcRequestSource,
347 357
      * @param rs      The source of the request.
348 358
      * @param request The request.
349 359
      */
350  
-    private void asyncSendEvent(RequestSource rs, Request request) {
351  
-        JAEventRequest jaRequest = new JAEventRequest(rs, this, request, mailbox);
  360
+    private void asyncSendEvent(final RequestSource rs, final Request request) {
  361
+        final JAEventRequest jaRequest = new JAEventRequest(rs, this, request,
  362
+                mailbox);
352 363
         rs.send(mailbox, jaRequest);
353 364
     }
354 365
 
@@ -359,23 +370,23 @@ private void asyncSendEvent(RequestSource rs, Request request) {
359 370
      * @param request                The request.
360 371
      * @param sourceExceptionHandler Exception handler of the source actor.
361 372
      */
362  
-    private void syncSendEvent(RequestSource rs,
363  
-                               Request request,
364  
-                               ExceptionHandler sourceExceptionHandler) {
365  
-        Mailbox oldSourceMailbox = rs.getMailbox();
366  
-        JARequest oldSourceRequest = oldSourceMailbox.getCurrentRequest();
367  
-        JAEventRequest jaRequest = new JAEventRequest(rs, this, request, mailbox);
  373
+    private void syncSendEvent(final RequestSource rs, final Request request,
  374
+            final ExceptionHandler sourceExceptionHandler) {
  375
+        final Mailbox oldSourceMailbox = rs.getMailbox();
  376
+        final JARequest oldSourceRequest = oldSourceMailbox.getCurrentRequest();
  377
+        final JAEventRequest jaRequest = new JAEventRequest(rs, this, request,
  378
+                mailbox);
368 379
         mailbox.setCurrentRequest(jaRequest);
369 380
         try {
370 381
             setExceptionHandler(null);
371 382
             request.processRequest(this, JANoResponse.nrp);
372  
-        } catch (Exception ex) {
373  
-            ExceptionHandler eh = getExceptionHandler();
  383
+        } catch (final Throwable ex) {
  384
+            final ExceptionHandler eh = getExceptionHandler();
374 385
             if (eh != null)
375 386
                 try {
376 387
                     eh.process(ex);
377 388
                     return;
378  
-                } catch (Exception x) {
  389
+                } catch (final Throwable x) {
379 390
                     getMailboxFactory().eventException(request, x);
380 391
                 }
381 392
             else {
@@ -394,10 +405,8 @@ private void syncSendEvent(RequestSource rs,
394 405
      * @param rp      The response processor.
395 406
      * @throws Exception Any uncaught exceptions raised while processing the request.
396 407
      */
397  
-    final protected void send(final Actor actor,
398  
-                              final Request request,
399  
-                              final RP rp)
400  
-            throws Exception {
  408
+    final protected void send(final Actor actor, final Request request,
  409
+            final RP rp) throws Exception {
401 410
         actor.acceptRequest(this, request, rp);
402 411
     }
403 412
 
@@ -407,10 +416,10 @@ final protected void send(final Actor actor,
407 416
      * @param actor   The target actor.
408 417
      * @param request The request.
409 418
      */
410  
-    final protected void sendEvent(Actor actor, Request request) {
  419
+    final protected void sendEvent(final Actor actor, final Request request) {
411 420
         try {
412 421
             send(actor, request, JANoResponse.nrp);
413  
-        } catch (Exception ex) {
  422
+        } catch (final Throwable ex) {
414 423
             throw new UnsupportedOperationException("Unexpected exception", ex);
415 424
         }
416 425
     }
@@ -420,8 +429,8 @@ final protected void sendEvent(Actor actor, Request request) {
420 429
      */
421 430
     final public class SMBuilder extends _SMBuilder {
422 431
         @Override
423  
-        final public void send(Actor actor, Request request, RP rp)
424  
-                throws Exception {
  432
+        final public void send(final Actor actor, final Request request,
  433
+                final RP rp) throws Exception {
425