You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by ho...@apache.org on 2009/01/22 02:31:44 UTC

svn commit: r736518 - /lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java

Author: hossman
Date: Wed Jan 21 17:31:43 2009
New Revision: 736518

URL: http://svn.apache.org/viewvc?rev=736518&view=rev
Log:
SOLR-930 - better javadocs explaining SolrCore.close()

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java?rev=736518&r1=736517&r2=736518&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java Wed Jan 21 17:31:43 2009
@@ -677,7 +677,7 @@
   }
   
   /**
-   * Close all resources allocated by the core...
+   * Close all resources allocated by the core if it is no longer in use...
    * <ul>
    *   <li>searcher</li>
    *   <li>updateHandler</li>
@@ -686,15 +686,23 @@
    *       </li>
    * </ul>
    * <p>
-   * This should always be called when the core is obtained through {@link CoreContainer#getCore} or {@link CoreContainer#getAdminCore}
+   * This method should always be called when the core is obtained through
+   * {@link CoreContainer#getCore} or {@link CoreContainer#getAdminCore}.
    * </p>
    * <p>
-   * The actual close is performed if the core usage count is 1.
-   * (A core is created with a usage count of 1).
-   * If usage count is > 1, the usage count is decreased by 1.
-   * If usage count is &lt; 0, this is an error and a runtime exception 
-   * is thrown.
+   * The behavior of this method is determined by the result of decrementing
+   * the core's reference count (A core is created with a refrence count of 1)...
    * </p>
+   * <ul>
+   *   <li>If reference count is > 0, the usage count is decreased by 1 and no
+   *       resources are released.
+   *   </li>
+   *   <li>If reference count is == 0, the resources are released.
+   *   <li>If reference count is &lt; 0, and error is logged and no further action
+   *       is taken.
+   *   </li>
+   * </ul>
+   * @see #isClosed() 
    */
   public void close() {
     int count = refCount.decrementAndGet();