01: /*
02: * Copyright 2005-2007 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.routemanager;
18:
19: import edu.iu.uis.eden.messaging.PersistedMessage;
20: import edu.iu.uis.eden.messaging.exceptionhandling.ExceptionRoutingServiceImpl;
21: import edu.iu.uis.eden.test.TestUtilities;
22:
23: public class TestExceptionRoutingServiceImpl extends
24: ExceptionRoutingServiceImpl {
25:
26: @Override
27: public void placeInExceptionRouting(Throwable throwable,
28: PersistedMessage persistedMessage, Long routeHeaderId) {
29: ExceptionThreader exceptionThreader = new ExceptionThreader(
30: throwable, persistedMessage, routeHeaderId, this );
31: exceptionThreader.start();
32: }
33:
34: private static class ExceptionThreader extends Thread {
35:
36: private Throwable throwable;
37: private PersistedMessage message;
38: Long routeHeaderId;
39: private TestExceptionRoutingServiceImpl testExceptionService;
40:
41: public ExceptionThreader(Throwable throwable,
42: PersistedMessage message, Long routeHeaderId,
43: TestExceptionRoutingServiceImpl testExceptionService) {
44: this .throwable = throwable;
45: this .message = message;
46: this .routeHeaderId = routeHeaderId;
47: this .testExceptionService = testExceptionService;
48: TestUtilities.setExceptionThreader(this );
49: }
50:
51: public void run() {
52: testExceptionService.callRealPlaceInExceptionRouting(
53: throwable, message, routeHeaderId);
54: }
55: }
56:
57: public void callRealPlaceInExceptionRouting(Throwable throwable,
58: PersistedMessage message, Long routeHeaderId) {
59: super
60: .placeInExceptionRouting(throwable, message,
61: routeHeaderId);
62: }
63: }
|