protected void taskError(Throwable t) { log().e(name,t); }
public static void trace(long connectionId, String original, String query, long start, Throwable t) { try { long delta = System.currentTimeMillis() - start; if (analyzer != null) analyzer.doAnalyze(connectionId,original,query,delta, t); } catch (Throwable t2) { log.e(t2); } }
@Override public void doUpdateValues() { for (Map.Entry<String, UiVaadin> entry : index.entrySet()) try { entry.getValue().doUpdateValue(); } catch (Throwable e) { log().e(entry.getKey(),e); } }
protected MActivator doCreateActivator() { try { return new DefaultActivator(null, getClass().getClassLoader()); } catch (MException e) { log().e(e); } return null; }
/** {@inheritDoc} */ @Override protected void send(String msg) { try { byte[] sendData = msg.getBytes(MString.CHARSET_UTF_8); send(sendData, 0, sendData.length); } catch (IOException e) { log().e(name,e); } }
@Override public void removeService(DbManagerService service) { if (service == null) return; synchronized (services) { services.remove(service); } try { service.doClose(); } catch (Throwable t) { log().e(t); } }
public void doUpdateValue(String name) { UiVaadin entry = index.get(name); try { entry.doUpdateValue(); } catch (Throwable e) { log().e(name,e); } }
@Override public JmsDataChannel addingService( ServiceReference<JmsDataChannel> reference) { try { JmsDataChannel service = context.getService(reference); if (service != null) addChannel(service); return service; } catch (Throwable t) { log().e(reference,t); return null; } }
protected void updateStorageDataSource() throws InvalidSyntaxException, MException { Collection<ServiceReference<DataSource>> refs = context.getServiceReferences(DataSource.class, "(osgi.jndi.service.name="+storageDsName+")"); if (refs.size() == 0) throw new MException("datasource not found",storageDsName); storageDataSource = context.getService(refs.iterator().next()); storageDsProvider.setDataSource(storageDataSource); try { String driver = storageDataSource.getConnection().getMetaData().getDriverName(); Dialect dialect = Dialect.findDialect(driver); storageDsProvider.setDialect(dialect); } catch (Exception e) { log().e(e); } }
@Override public void run() { try { doTick(); } catch (Throwable t) { log().e(t); } } }, 1000, 1000);
@Override public synchronized SecureRandom getSecureRandom() { try { // secureRandom = SecureRandom.getInstance("SHA1PRNG", "SUN"); if (secureRandom == null) secureRandom = new MySecureRandom(); } catch (Exception e) { MLogUtil.log().e(e); } return secureRandom; }
public static void setAnalyzer(SqlAnalyzer analyzer_) { try { if (analyzer != null) analyzer.stop(); analyzer = analyzer_; if (analyzer != null) analyzer.start(); } catch (Throwable t) { log.e(t); analyzer = null; } }
protected synchronized void doWritable() { if (isChanged()) return; try { current = node.getWritableNode(); } catch (MException e) { log().e("Can't edit node", e); } }
public void save() { if (context != null) { try { context.saveRuntime(); } catch (IOException e) { log().e(e); } } else { log().i("Context not set in runtime"); } }
public synchronized void close() { if (isClosed() || isShared()) return; try { closeConnection(); } catch (Throwable t) { log().e(getName(),"on close", t); } closed = true; }
public void init() { try { URL url = MSystem.locateResource(this, "SqlDbStorage.xml"); DbConnection con = pool.getConnection(); XmlConfigFile data = new XmlConfigFile(url.openStream()); data.setString("prefix", prefix); pool.getDialect().createStructure(data, con, null, false); con.close(); } catch (Exception e) { log().e(e); } }
private void removeIds(File file) { File meta = ((FdbCore)core).getMetaFileFor(file); MProperties p = MProperties.load(meta); if (p == null) p = new MProperties(); p.remove("_id"); try { p.save(meta); } catch (IOException e) { log().e(file,e); } }
protected void error(Object ... msg) { log().e(msg); try { getContext().getARuntime().doErrorMsg(getContext().getPNode(), msg); } catch (Throwable t) {} }
@Override public boolean uploadRendition(String name, File file) { try { CaoAction action = node.getConnection().getAction(CaoAction.UPLOAD_RENDITION); if (action == null) return false; UploadRenditionConfiguration configuration = (UploadRenditionConfiguration) action.createConfiguration(node, null); configuration.setRendition(name); configuration.setFile(file); OperationResult ret = action.doExecute(configuration, null); return ret != null && ret.isSuccessful(); } catch (Exception e) { log().e("uploadRendition",node,name,e); } return false; }