@Override public void error(String msg) { if (isErrorEnabled()) { log.error(msg); } }
@Override public void error(String format, Object... arguments) { if (isErrorEnabled()) { FormattingTuple ft = MessageFormatter.arrayFormat(format, arguments); log.error(ft.getMessage()); } }
@Override public void error(String msg, Throwable t) { if (isErrorEnabled()) { log.error(msg, t); } } }
@Override public void error(String format, Object arg1, Object arg2) { if (isErrorEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg1, arg2); log.error(ft.getMessage()); } }
@Override public void error(String format, Object arg) { if (isErrorEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg); log.error(ft.getMessage()); } }
@Override public Object createNewEntity() { try { Consumer c = (Consumer) clazz.newInstance(); c.setId(UUID.randomUUID().toString()); return c; } catch (InstantiationException|IllegalAccessException e) { getApp().getLog().error("error instantiating entity", e); return null; } }
protected void handleExit() { if (serverSession != null) { try { serverSession.disconnect(SshConstants.SSH2_DISCONNECT_BY_APPLICATION, ""); } catch (IOException e) { Log.getLog(Q2.LOGGER_NAME, "sshd").error(e); } } }
public int getPort () { int port = 0; try { port = Integer.parseInt ( getProperty (getProperties ("channel"), "port") ); } catch (NumberFormatException e) { getLog().error (e); } return port; } public synchronized void setSocketFactory (String sFac) {
@Override protected void initService() throws Exception { try { // attempt to bind, if another instance is already bound, an // exception will get throwm ss = new ServerSocket(port); } catch (IOException e) { getLog().error("An instance of Q2 is already running. Shutting this instance"); getServer().shutdown(); } }
public int getPort () { int port = 0; try { port = Integer.parseInt ( getProperty (getProperties ("channel"), "port") ); } catch (NumberFormatException e) { getLog().error(e); } return port; } public synchronized void setSocketFactory (String sFac) {
public Journal getJournal (long id) { try { return (Journal) DB.exec(db -> db.session().get(Journal.class, id)); } catch (Exception e) { getApp().getLog().error(e); return null; } } }
private synchronized void setResponse (String id, String response) { try { db.open (); mgr.setResponse (id, response); } catch (Throwable t) { getLog().error (t); } finally { close(); } } public class MonitorTimerTask extends TimerTask {
public List<Journal> getJournals() { try { return (List<Journal>) DB.exec(db -> { GLSession session = new GLSession(db); return session.getAllJournals(); }); } catch (Exception e) { getApp().getLog().error(e); return null; } }
public List<Role> getRoles() { try { return (List<Role>) DB.exec((db) -> { RoleManager mgr = new RoleManager(db); return mgr.getAll(); }); } catch (Exception e) { getApp().getLog().error(e); return null; } }
public User getUserByNick (String nick, boolean includeDeleted) { try { return (User) DB.exec((db) -> { UserManager mgr = new UserManager(db); return mgr.getUserByNick(nick,includeDeleted); }); } catch (Exception e) { getApp().getLog().error(e); return null; } }
public Role getRoleByName(String name) { try { return (Role) DB.exec((db) -> { RoleManager mgr = new RoleManager(db); return mgr.getRoleByName(name); }); } catch (Exception e) { getApp().getLog().error(e); return null; } } }
public List<Role> getRoles() { try { return DB.exec(db-> { RoleManager mgr = new RoleManager(db); return mgr.getAll(); }); } catch (Exception e) { getApp().getLog().error(e); return null; } } }
private List<Journal> getJournals () { try { return DB.exec(db -> { GLSession session = new GLSession(db); return session.getAllJournals(); }); } catch (Exception e) { QI.getQI().getLog().error(e); return null; } }
private String getDefaultJournalName() { try { return DB.exec(db -> { SysConfigManager syscMgr= new SysConfigManager(db); return syscMgr.get(MiniGLConstants.DEFAULT_GL_JOURNAL.toString(), "jcard"); }); } catch (Exception e) { QI.getQI().getLog().error(e); return null; } } }
@Override protected void cancelClick(Button.ClickEvent event, Layout formLayout) { super.cancelClick(event, formLayout); entryGrid.setValue(getInstance()); try { newEntryForm.setTransaction(getInstance().clone()); } catch (CloneNotSupportedException e) { // Log error and ignore. Clone should be supported for a GLTransaction. QI.getQI().getLog().error(e); } setReadOnly(true); }