summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
ab9d7c4)
Prior to this failed write transactions were not cancelled. For
consistency the read transactions are now handled the same way.
Also deprecated legacy implementations.
refs #7633
Change-Id: Ic301acc2d7f05bb8f42df3322e94cf56b1631203
public static AbstractEventHandler emptyOnClick(ReadGraph graph) throws DatabaseException {
return new EventHandler() {
@Override
public static AbstractEventHandler emptyOnClick(ReadGraph graph) throws DatabaseException {
return new EventHandler() {
@Override
public static AbstractEventHandler writeEventHandler(ReadGraph graph, final Variable variable, final Function fn) {
final Session session = graph.getSession();
public static AbstractEventHandler writeEventHandler(ReadGraph graph, final Variable variable, final Function fn) {
final Session session = graph.getSession();
return (String)response;
}
return null;
return (String)response;
}
return null;
- } catch (Throwable t) {
- t.printStackTrace();
} finally {
sclContext.put("graph", oldGraph);
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
}
} finally {
sclContext.put("graph", oldGraph);
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
}
public static AbstractEventHandler readEventHandler(ReadGraph graph, final Variable variable, final Function fn) {
final Session session = graph.getSession();
public static AbstractEventHandler readEventHandler(ReadGraph graph, final Variable variable, final Function fn) {
final Session session = graph.getSession();
return (String)response;
}
return null;
return (String)response;
}
return null;
- } catch (Throwable t) {
- t.printStackTrace();
} finally {
sclContext.put("graph", oldGraph);
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
}
} finally {
sclContext.put("graph", oldGraph);
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
}
public static AbstractEventHandler readEventHandler2(ReadGraph graph, final Function fn) {
final Session session = graph.getSession();
public static AbstractEventHandler readEventHandler2(ReadGraph graph, final Function fn) {
final Session session = graph.getSession();
return (CommandResult)response;
}
return null;
return (CommandResult)response;
}
return null;
- } catch (Throwable t) {
- t.printStackTrace();
} finally {
sclContext.put("graph", oldGraph);
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
}
} finally {
sclContext.put("graph", oldGraph);
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
}
Object oldGraph = sclContext.put("graph", graph);
Object oldPrinter = sclContext.put(SCLReportingHandler.REPORTING_HANDLER, printer);
try {
Object oldGraph = sclContext.put("graph", graph);
Object oldPrinter = sclContext.put(SCLReportingHandler.REPORTING_HANDLER, printer);
try {
- Object response = fn.apply(parameters);
- return response;
- } catch (Throwable t) {
- return new org.simantics.document.server.serverResponse.Error(formatError(graph, t));
+ return fn.apply(parameters);
} finally {
sclContext.put("graph", oldGraph);
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
} finally {
sclContext.put("graph", oldGraph);
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
Object oldPrinter = sclContext.put(SCLReportingHandler.REPORTING_HANDLER, printer);
try {
Object oldPrinter = sclContext.put(SCLReportingHandler.REPORTING_HANDLER, printer);
try {
- Object response = fn.apply(parameters);
- return response;
- } catch (Throwable t) {
- return new org.simantics.document.server.serverResponse.Error(formatError(graph, t));
+ return fn.apply(parameters);
} finally {
sclContext.put("graph", oldGraph);
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
} finally {
sclContext.put("graph", oldGraph);
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
public static AbstractEventHandler writeEventHandler2(ReadGraph graph, final Function fn) {
final Session session = graph.getSession();
public static AbstractEventHandler writeEventHandler2(ReadGraph graph, final Function fn) {
final Session session = graph.getSession();
return (CommandResult)response;
}
return null;
return (CommandResult)response;
}
return null;
- } catch (Throwable t) {
- t.printStackTrace();
} finally {
sclContext.put("graph", oldGraph);
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
}
} finally {
sclContext.put("graph", oldGraph);
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
}
public static AbstractEventHandler eventHandler2(ReadGraph graph, final Function fn) {
return new AbstractEventHandler() {
public static AbstractEventHandler eventHandler2(ReadGraph graph, final Function fn) {
return new AbstractEventHandler() {
return (CommandResult)response;
}
return null;
return (CommandResult)response;
}
return null;
- } catch (Throwable t) {
- t.printStackTrace();
} finally {
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
}
} finally {
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
}
} catch (Throwable e) {
Logger.defaultLogError(e);
return new org.simantics.document.server.serverResponse.Error(e.getMessage());
} catch (Throwable e) {
Logger.defaultLogError(e);
return new org.simantics.document.server.serverResponse.Error(e.getMessage());
public static AbstractEventHandler eventHandler(ReadGraph graph, final Function fn) {
return new AbstractEventHandler() {
public static AbstractEventHandler eventHandler(ReadGraph graph, final Function fn) {
return new AbstractEventHandler() {
if(response instanceof String) {
result = (String)response;
}
if(response instanceof String) {
result = (String)response;
}
- } catch (Throwable t) {
- t.printStackTrace();
} finally {
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
}
} finally {
sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
}