/** * Called to end a SQL listener context * * @param context the listener context to end */ protected void endContext(SQLListenerContextImpl context) { listeners.end(context); this.context = null; }
/** * Called to create and start a new SQL Listener context * * @param connection the database connection * @param metadata the meta data for that context * @param entity the entity for that context * @return the newly started context */ protected SQLListenerContextImpl startContext( Connection connection, QueryMetadata metadata, RelationalPath<?> entity) { SQLListenerContextImpl context = new SQLListenerContextImpl(metadata, connection, entity); listeners.start(context); return context; }
/** * Called to make the call back to listeners when an exception happens * * @param context the current context in play * @param e the exception */ protected void onException(SQLListenerContextImpl context, Exception e) { context.setException(e); listeners.exception(context); }
/** * Add a listener * * @param listener listener to add */ public void addListener(SQLListener listener) { listeners.add(listener); }