]> gerrit.simantics Code Review - simantics/platform.git/blob - workbench/handler/AbstractDatabaseHandler.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / workbench / handler / AbstractDatabaseHandler.java
1 package org.simantics.ui.workbench.handler;
2
3 import org.eclipse.core.commands.AbstractHandler;
4 import org.eclipse.core.commands.ExecutionEvent;
5 import org.eclipse.core.commands.ExecutionException;
6 import org.simantics.db.exception.DatabaseException;
7
8 abstract public class AbstractDatabaseHandler extends AbstractHandler {
9
10         abstract public Object checkedExecute(ExecutionEvent event) throws ExecutionException, DatabaseException;
11         
12     @Override
13     final public Object execute(ExecutionEvent event) throws ExecutionException {
14         try {
15                         return checkedExecute(event);
16                 } catch (DatabaseException e) {
17                         throw new ExecutionException("The handler caught an unhandled exception, ", e);
18                 }
19     }   
20         
21 }