<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -93,6 +93,7 @@ final class Connector {
   }
   
   void returnToPool() throws SQLException {
+    // TODO catch RuntimeException from the pre-release hooks
     Fsm.runHooks(preReleaseHooks, EventType.preRelease, currentLease, null);
     try {
       if (deadTime &lt; time.now())</diff>
      <filename>src/main/java/net/nanopool/Connector.java</filename>
    </modified>
    <modified>
      <diff>@@ -29,7 +29,27 @@ import net.nanopool.Settings;
  * Hooks are mostly useful for debugging purpose, and for generating
  * performance data and counters.
  * @author cvh
+ * @see EventType
+ * @see Settings
  */
 public interface Hook {
+  /**
+   * This method is called on a hook when an event it is registered for occurs.
+   * &lt;p&gt;
+   * This method may throw a RuntimeException to abort a flow inside the pool -
+   * this is safe to do without putting the pool in an inconsistent state.
+   * &lt;p&gt;
+   * &lt;strong&gt;Note on dead-locks:&lt;/strong&gt; You are likely to hold locks inside
+   * the JDBC driver when hooks run - this is mostly true for the -release
+   * hooks, but you should not make assumptions. Therefore, be careful not
+   * to create any dead-locks between locks in your own code and locks in the
+   * JDBC driver.
+   * @param type The type of event that has occurred. Never null.
+   * @param con The connection, if any, that this event occurred in relation
+   * to. May be null.
+   * @param sqle Any SQLException that might have been thrown. This
+   * SQLException instance may be logged, but should not be re-thrown - please
+   * assume that it is otherwise properly handled. May be null.
+   */
   void run(EventType type, Connection con, SQLException sqle);
 }</diff>
      <filename>src/main/java/net/nanopool/hooks/Hook.java</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e45de1f7725f8dc209df9b95cdaa72d423937d1f</id>
    </parent>
  </parents>
  <author>
    <name>Christian Vest Hansen</name>
    <email>karmazilla@gmail.com</email>
  </author>
  <url>http://github.com/karmazilla/nanopool/commit/0220d1ea430cf1e6c1eb49a199cc2db0d4acfe77</url>
  <id>0220d1ea430cf1e6c1eb49a199cc2db0d4acfe77</id>
  <committed-date>2009-10-16T08:55:23-07:00</committed-date>
  <authored-date>2009-10-16T08:55:23-07:00</authored-date>
  <message>complete the javadoc for the Hook interface</message>
  <tree>fc782a105f80e84cc35ab14930439825275977f8</tree>
  <committer>
    <name>Christian Vest Hansen</name>
    <email>karmazilla@gmail.com</email>
  </committer>
</commit>
