source: java/main/src/main/java/com/framsticks/util/dispatching/DispatchingExceptionHandler.java @ 193

Last change on this file since 193 was 193, checked in by Maciej Komosinski, 10 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
File size: 776 bytes
Line 
1package com.framsticks.util.dispatching;
2
3import com.framsticks.util.ExceptionHandler;
4import com.framsticks.util.FramsticksException;
5
6public class DispatchingExceptionHandler implements ExceptionHandler {
7
8        protected final Dispatcher<?> dispatcher;
9        protected final ExceptionHandler handler;
10
11        /**
12         * @param dispatcher
13         * @param handler
14         */
15        public DispatchingExceptionHandler(Dispatcher<?> dispatcher, ExceptionHandler handler) {
16                this.dispatcher = dispatcher;
17                this.handler = handler;
18        }
19
20        @SuppressWarnings({ "rawtypes", "unchecked" })
21        @Override
22        public void handle(final FramsticksException exception) {
23                dispatcher.dispatch(new RunAt(ThrowExceptionHandler.getInstance()) {
24                        @Override
25                        protected void runAt() {
26                                handler.handle(exception);
27                        }
28                });
29        }
30
31}
Note: See TracBrowser for help on using the repository browser.