@Override public LocalTransaction begin() { increase(); if (log.isDebugEnabled()) { if (isNewTransaction()) { log.debug("Begin a new transaction, referencedCount={}", referenceCount); } else { log.debug("Join a exists transaction, referencedCount={}", referenceCount); } } return this; }
public void error(String msg, Object... args) { log.error(msg, args); } }
@Override public void onFileDelete(FileChangeObserver observer, File file) { log.info("Sql file '" + file.getAbsolutePath() + "' was deleted, do nothing"); }
@Override public boolean tryDestroyDataSource(DataSource ds) { if(ds instanceof org.apache.tomcat.jdbc.pool.DataSource){ org.apache.tomcat.jdbc.pool.DataSource tds = ((org.apache.tomcat.jdbc.pool.DataSource)ds); log.debug("Destroy tomcat datasource of url : " + tds.getUrl()); try { tds.close(true); } catch (Throwable e) { log.warn("Error destroying tomcat jdbc pool, " + e.getMessage(), e); } return true; } return false; }
@Override public void dispose() throws Throwable { if(null != scheduledExecutor) { log.debug("Shutdown scheduler '{}'", name); scheduledExecutor.shutdownNow(); } } }
public void warn(String msg, Object... args) { log.warn(msg, args); }
public void load(AppResource[] resources) { Args.notNull(resources, "resources"); for (AppResource ar : resources) { Resource resource = ar.getResource(); if (log.isDebugEnabled()) { if (AppResources.isFrameworkAndCoreResource(resource.getURLString())) { log.trace("Load beans : {}", LogUtils.getUrl(resource)); } else { log.debug("Load beans : {}", LogUtils.getUrl(resource)); } } //todo : use AppResource's default override? readDefinitions(container, resource, ar.isDefaultOverride()); } }
private Class<?> instrumentClass(String name) throws ClassNotFoundException { Resource resource = tryGetResource(name); if(null == resource) { return null; } if(instrumenting.contains(resource.getURLString())) { log.debug("Found cyclic instrumenting class '{}', instrument it now", name); return instrumentClass(name, resource, false); } log.trace("Try instrument class '{}' (depFirst)", name); Class<?> c = instrumentClass(name, resource, true); return c; }
public void trace(String msg, Object... args) { log.trace(msg, args); }
@SuppressWarnings("resource") protected void setupConnectionOnBorrow(PooledConnection conn) throws SQLException { conn.setupBeforeOnBorrow(); Connection wrapped = conn.wrapped(); if(null == wrapped) { //Connection not created yet ( or was abandoned ). log.trace("Real Connection not created yet, Create it"); wrapped = createNewConnectionOnBorrow(conn); //todo : test the connection by validation query?. }else if(config.isTestOnBorrow() && !conn.isValid()) { log.info("Real Connection is invalid, Abandon it and Create a new one"); conn.abandonReal(); wrapped = createNewConnectionOnBorrow(conn); }else{ conn.setNewCreatedConnection(false); } setupConnectionStateOnBorrow(conn, wrapped, 1); conn.setupAfterOnBorrow(); }
public boolean isDebugEnabled() { return log.isDebugEnabled(); }
protected void handleAuthzServerLogoutNotification(Request request, Response response) throws Throwable { log.debug("Logout by oauth2 authorization server"); am.logoutImmediately(request, response); }
public void warn(String s) { log.warn(s); }
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public void postCreate(BeanFactory factory) throws Exception { this.caches = new ConcurrentHashMap<>(); this.caches.putAll((Map)factory.getNamedBeans(Cache.class)); log.trace("Found {} managed Cache bean(s)",caches.size()); }
/** * Remove the binding for the given name from the current JNDI context. * @param name the JNDI name of the object * @throws NamingException thrown by JNDI, mostly name not found */ public void unbind(final String name) throws NamingException { if (logger.isDebugEnabled()) { logger.debug("Unbinding JNDI object with name [" + name + "]"); } execute(new JndiCallback<Object>() { public Object doInContext(Context ctx) throws NamingException { ctx.unbind(name); return null; } }); }
public void error(String s) { log.error(s); } }
public void setNetworkTimeout(final Connection connection, final long timeoutMs) { if (supportsNetworkTimeout) { try { connection.setNetworkTimeout(getNetworkTimeoutExecutor(), (int) timeoutMs); } catch (Throwable e) { log.debug("Unable to reset network timeout for connection {}", connection.toString(), e); } } }
@Override public void onFileChange(FileChangeObserver observer, File file) { log.info("File '{}' changed, restart", file.getAbsolutePath()); restart(); }
public static void closeConnection(Connection connection){ if(null != connection){ try { connection.close(); } catch (SQLException e) { log.warn("Error closing connection : " + e.getMessage(),e); } } }