/** * {@inheritDoc} */ @Override public void close() throws IOException { connection.close(); }
/** * {@inheritDoc} */ @Override public void close() throws IOException { connection.close(); }
@Override public void stop(BundleContext context) throws Exception { connection.close(); }
/** * {@inheritDoc} */ @Override public void close() throws IOException { connection.close(); }
/** * {@inheritDoc} */ public void destroyObject(LdapConnection connection) throws IOException { log.debug("destroy connection: {}", connection); connection.close(); }
/** * Close the connection for stop() */ private void closeConnection() throws IOException { if (connection.isConnected()) { connection.close(); } }
public static void unbindAndCloseSilently(final LdapConnection connection) { if (connection == null) { return; } try { connection.unBind(); } catch (final Exception e) { //ignore } try { connection.close(); } catch (final Exception e) { //ignore } }
/** * {@inheritDoc} */ public void destroyObject( Object obj ) throws Exception { LOG.debug( "destroying {}", obj ); LdapConnection connection = ( LdapConnection ) obj; connection.unBind(); connection.close(); }
/** * Close the connection for stop() */ private void closeConnection() throws IOException { if (connection.isConnected()) { connection.close(); } }
public static void closeConnections() { for ( LdapConnection con : OPEN_CONNECTIONS ) { if ( con == null ) { continue; } try { if ( con.isConnected() ) { con.close(); } } catch ( Exception e ) { // shouldn't happen, but print the stacktrace so that less pain during development to find the cause e.printStackTrace(); } } OPEN_CONNECTIONS.clear(); } }
/** * Closes the dao's connection. {@link LdapDaoException} is thrown in case of IO error. * */ public void disconnect() { try { connection.unBind(); connection.close(); } catch (Exception e) { throw new LdapDaoException(e); } }
connection.close();
connection.close();