~slub.team/goobi-indexserver/3.x

« back to all changes in this revision

Viewing changes to solr/core/src/java/org/apache/solr/core/CloseHook.java

  • Committer: Sebastian Meyer
  • Date: 2012-08-03 09:12:40 UTC
  • Revision ID: sebastian.meyer@slub-dresden.de-20120803091240-x6861b0vabq1xror
Remove Lucene and Solr source code and add patches instead
Fix Bug #985487: Auto-suggestion for the search interface

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package org.apache.solr.core;
2
 
/**
3
 
 * Licensed to the Apache Software Foundation (ASF) under one or more
4
 
 * contributor license agreements.  See the NOTICE file distributed with
5
 
 * this work for additional information regarding copyright ownership.
6
 
 * The ASF licenses this file to You under the Apache License, Version 2.0
7
 
 * (the "License"); you may not use this file except in compliance with
8
 
 * the License.  You may obtain a copy of the License at
9
 
 *
10
 
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 
 *
12
 
 * Unless required by applicable law or agreed to in writing, software
13
 
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 
 * See the License for the specific language governing permissions and
16
 
 * limitations under the License.
17
 
 */
18
 
 
19
 
 
20
 
/**
21
 
 * Used to request notification when the core is closed.
22
 
 * <p/>
23
 
 * Call {@link org.apache.solr.core.SolrCore#addCloseHook(org.apache.solr.core.CloseHook)} during the {@link org.apache.solr.util.plugin.SolrCoreAware#inform(SolrCore)} method to
24
 
 * add a close hook to your object.
25
 
 * <p/>
26
 
 * The close hook can be useful for releasing objects related to the request handler (for instance, if you have a JDBC DataSource or something like that)
27
 
 */
28
 
 
29
 
public abstract class CloseHook {
30
 
 
31
 
  /**
32
 
   * Method called when the given SolrCore object is closing / shutting down but before the update handler and
33
 
   * searcher(s) are actually closed
34
 
   * <br />
35
 
   * <b>Important:</b> Keep the method implementation as short as possible. If it were to use any heavy i/o , network connections -
36
 
   * it might be a better idea to launch in a separate Thread so as to not to block the process of
37
 
   * shutting down a given SolrCore instance.
38
 
   *
39
 
   * @param core SolrCore object that is shutting down / closing
40
 
   */
41
 
  public abstract void preClose(SolrCore core);
42
 
 
43
 
  /**
44
 
   * Method called when the given SolrCore object has been shut down and update handlers and searchers are closed
45
 
   * <br/>
46
 
   * Use this method for post-close clean up operations e.g. deleting the index from disk.
47
 
   * <br/>
48
 
   * <b>The core's passed to the method is already closed and therefore, it's update handler or searcher should *NOT* be used</b>
49
 
   *
50
 
   * <b>Important:</b> Keep the method implementation as short as possible. If it were to use any heavy i/o , network connections -
51
 
   * it might be a better idea to launch in a separate Thread so as to not to block the process of
52
 
   * shutting down a given SolrCore instance.
53
 
   *
54
 
   * @param core
55
 
   */
56
 
  public abstract void postClose(SolrCore core);
57
 
}