acolyte.ConnectionHandler Maven / Gradle / Ivy
package acolyte;
/**
* Connection handler.
*
* @author Cedric Chantepie
* @see StatementHandler
*/
public interface ConnectionHandler {
/**
* Returns statement handler.
*/
public StatementHandler getStatementHandler();
// --- Inner classes ---
/**
* Default implementation.
*/
public static final class Default implements ConnectionHandler {
final StatementHandler stmtHandler;
/**
* Bulk constructor.
*/
public Default(final StatementHandler handler) {
if (handler == null) {
throw new IllegalArgumentException();
} // end of if
this.stmtHandler = handler;
} // end of
/**
* {@inheritDoc}
*/
public StatementHandler getStatementHandler() {
return this.stmtHandler;
} // end of getStatementHandler
} // end of class DefaultHandler
} // end of interface ConnectionHandler