/** * Returns the current thread-local class loader * * @return the current thread-local class loader */ public ClassLoader getCurrentClassLoader() { final ClassLoader result = Thread.currentThread().getContextClassLoader(); // Attempt to provide more information to issue 604. if (result == null) { LOG.error(new Throwable(), "The CCL of current thread ''{0}'' is null", Thread.currentThread().getName()); } return result; } }
/** * Returns the current thread-local class loader * * @return the current thread-local class loader */ public ClassLoader getCurrentClassLoader() { final ClassLoader result = Thread.currentThread().getContextClassLoader(); // Attempt to provide more information to issue 604. if (result == null) { LOG.error(new Throwable(), "The CCL of current thread ''{0}'' is null", Thread .currentThread().getName()); } return result; } }
@Override public void setContextClassLoader(ClassLoader cl) { if (cl == null) { LOG.error(new Throwable(), "Attempting to set the CCL of thread ''{0}'' to null", getName()); } super.setContextClassLoader(cl); } }
/** * Returns the current thread-local class loader * * @return the current thread-local class loader */ public ClassLoader getCurrentClassLoader() { final ClassLoader result = Thread.currentThread().getContextClassLoader(); // Attempt to provide more information to issue 604. if (result == null) { LOG.error(new Throwable(), "The CCL of current thread ''{0}'' is null", Thread .currentThread().getName()); } return result; } }
@Override public void setContextClassLoader(ClassLoader cl) { if (cl == null) { _log.error(new Throwable(), "Attempting to set the CCL of thread ''{0}'' to null", getName()); } super.setContextClassLoader(cl); } }
@Override public void setContextClassLoader(ClassLoader cl) { if (cl == null) { LOG.error(new Throwable(), "Attempting to set the CCL of thread ''{0}'' to null", getName()); } super.setContextClassLoader(cl); } }
private void execute() throws SQLException { ResultSet resultSet = conn.allCsvFiles(); try { if (resultSet == null || resultSet.wasNull()) { LOG.error("Test failed"); throw new ConnectorException("Test failed"); } } finally { if (resultSet != null) { resultSet.close(); } } } }
private void checkCCL() { if (getContextClassLoader() == null) { _log.error(new Throwable(), "The CCL of thread ''{0}'' was null after initialization. The CCL of current thread ''{1}'' is {2}", getName(), Thread.currentThread().getName(), Thread.currentThread().getContextClassLoader()); } else { _log.info("Creating thread ''{0}'' with a non-null CCL", getName()); } }
private void checkCCL() { if (getContextClassLoader() == null) { LOG.error(new Throwable(), "The CCL of thread ''{0}'' was null after initialization. The CCL of current thread ''{1}'' is {2}", getName(), Thread.currentThread().getName(), Thread.currentThread().getContextClassLoader()); } else { LOG.info("Creating thread ''{0}'' with a non-null CCL", getName()); } }
private void checkCCL() { if (getContextClassLoader() == null) { LOG.error(new Throwable(), "The CCL of thread ''{0}'' was null after initialization. The CCL of current thread ''{1}'' is {2}", getName(), Thread.currentThread().getName(), Thread.currentThread().getContextClassLoader()); } else { LOG.info("Creating thread ''{0}'' with a non-null CCL", getName()); } }
public Schema execute() { try { return executeImpl(); } catch (Exception e) { LOG.error(e, "error during updating"); throw new ConnectorException(e); } }
public void test() { try { execute(); } catch (Exception e) { LOG.error(e, "error during test connection"); throw new ConnectorException(e); } }
@Override public final void test() { LOG.info("Connection test"); try { new CSVDirTest(configuration).test(); } catch (Exception e) { LOG.error("Test failed", e); } } }
/** * commit transaction */ public void commit() { try { getConnection().commit(); } catch (SQLException e) { SQLUtil.rollbackQuietly(getConnection()); log.error(e, "error in commit"); throw ConnectorException.wrap(e); } } }
@Override public ConnectorFacade newInstance(final ConnectorInfo connectorInfo, String config) { ConnectorFacade ret = null; if (connectorInfo instanceof LocalConnectorInfoImpl) { try { // create a new Provisioner. ret = new LocalConnectorFacadeImpl((LocalConnectorInfoImpl) connectorInfo, config); } catch (Exception ex) { String connector = connectorInfo.getConnectorKey().toString(); LOG.error(ex, "Failed to create new connector facade: {0}, {1}", connector, config); throw ConnectorException.wrap(ex); } } else if (connectorInfo instanceof RemoteConnectorInfoImpl) { ret = new RemoteConnectorFacadeImpl((RemoteConnectorInfoImpl) connectorInfo, config); } else { throw new IllegalArgumentException("Unknown ConnectorInfo type"); } return ret; }