1
2
3
4
5 package org.epics.pvmanager;
6
7 import java.util.concurrent.Executor;
8 import java.util.logging.Level;
9 import java.util.logging.Logger;
10
11
12
13
14
15
16
17
18
19 public class ExceptionHandler {
20
21 private static final Logger log = Logger.getLogger(ExceptionHandler.class.getName());
22
23
24
25
26
27
28 public void handleException(Exception ex) {
29 log.log(Level.INFO, "Exception for PV", ex);
30 }
31
32 static ExceptionHandler safeHandler(final ExceptionHandler exceptionHandler) {
33 return new ExceptionHandler() {
34
35 @Override
36 public void handleException(Exception ex) {
37 try {
38 exceptionHandler.handleException(ex);
39 } catch(RuntimeException e) {
40 log.log(Level.INFO, "Exception handler throw an exception", e);
41 }
42 }
43
44 };
45 }
46 }