OSDN Git Service

8bd7faa114cfc9bb3f95ffe2e8a1766667f07a13
[libre10/libre10.git] / solr / docs / solr-core / org / apache / solr / core / CloseHook.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--NewPage-->
3 <HTML>
4 <HEAD>
5 <!-- Generated by javadoc (build 1.6.0_45) on Mon Apr 29 15:10:31 CEST 2013 -->
6 <META http-equiv="Content-Type" content="text/html; charset=utf-8">
7 <TITLE>
8 CloseHook (Solr 4.3.0 API)
9 </TITLE>
10
11 <META NAME="date" CONTENT="2013-04-29">
12
13 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
14
15 <SCRIPT type="text/javascript">
16 function windowTitle()
17 {
18     if (location.href.indexOf('is-external=true') == -1) {
19         parent.document.title="CloseHook (Solr 4.3.0 API)";
20     }
21 }
22 </SCRIPT>
23 <NOSCRIPT>
24 </NOSCRIPT>
25
26 </HEAD>
27
28 <BODY BGCOLOR="white" onload="windowTitle();">
29 <HR>
30
31
32 <!-- ========= START OF TOP NAVBAR ======= -->
33 <A NAME="navbar_top"><!-- --></A>
34 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
35 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
36 <TR>
37 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
38 <A NAME="navbar_top_firstrow"><!-- --></A>
39 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
40   <TR ALIGN="center" VALIGN="top">
41   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
42   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
43   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
44   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/CloseHook.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
45   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
46   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
47   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
48   </TR>
49 </TABLE>
50 </TD>
51 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
52 </EM>
53 </TD>
54 </TR>
55
56 <TR>
57 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58 &nbsp;<A HREF="../../../../org/apache/solr/core/CachingDirectoryFactory.CloseListener.html" title="interface in org.apache.solr.core"><B>PREV CLASS</B></A>&nbsp;
59 &nbsp;<A HREF="../../../../org/apache/solr/core/CodecFactory.html" title="class in org.apache.solr.core"><B>NEXT CLASS</B></A></FONT></TD>
60 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61   <A HREF="../../../../index.html?org/apache/solr/core/CloseHook.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62 &nbsp;<A HREF="CloseHook.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
63 &nbsp;<SCRIPT type="text/javascript">
64   <!--
65   if(window==top) {
66     document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
67   }
68   //-->
69 </SCRIPT>
70 <NOSCRIPT>
71   <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
72 </NOSCRIPT>
73
74
75 </FONT></TD>
76 </TR>
77 <TR>
78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
79   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
82 </TR>
83 </TABLE>
84 <A NAME="skip-navbar_top"></A>
85 <!-- ========= END OF TOP NAVBAR ========= -->
86
87 <HR>
88 <!-- ======== START OF CLASS DATA ======== -->
89 <H2>
90 <FONT SIZE="-1">
91 org.apache.solr.core</FONT>
92 <BR>
93 Class CloseHook</H2>
94 <PRE>
95 <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
96   <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.solr.core.CloseHook</B>
97 </PRE>
98 <HR>
99 <DL>
100 <DT><PRE>public abstract class <B>CloseHook</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
101 </PRE>
102
103 <P>
104 Used to request notification when the core is closed.
105  <p/>
106  Call <A HREF="../../../../org/apache/solr/core/SolrCore.html#addCloseHook(org.apache.solr.core.CloseHook)"><CODE>SolrCore.addCloseHook(org.apache.solr.core.CloseHook)</CODE></A> during the <A HREF="../../../../org/apache/solr/util/plugin/SolrCoreAware.html#inform(org.apache.solr.core.SolrCore)"><CODE>SolrCoreAware.inform(SolrCore)</CODE></A> method to
107  add a close hook to your object.
108  <p/>
109  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)
110 <P>
111
112 <P>
113 <HR>
114
115 <P>
116
117 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
118
119 <A NAME="constructor_summary"><!-- --></A>
120 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
121 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
122 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
123 <B>Constructor Summary</B></FONT></TH>
124 </TR>
125 <TR BGCOLOR="white" CLASS="TableRowColor">
126 <TD><CODE><B><A HREF="../../../../org/apache/solr/core/CloseHook.html#CloseHook()">CloseHook</A></B>()</CODE>
127
128 <BR>
129 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
130 </TR>
131 </TABLE>
132 &nbsp;
133 <!-- ========== METHOD SUMMARY =========== -->
134
135 <A NAME="method_summary"><!-- --></A>
136 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
137 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
138 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
139 <B>Method Summary</B></FONT></TH>
140 </TR>
141 <TR BGCOLOR="white" CLASS="TableRowColor">
142 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
143 <CODE>abstract &nbsp;void</CODE></FONT></TD>
144 <TD><CODE><B><A HREF="../../../../org/apache/solr/core/CloseHook.html#postClose(org.apache.solr.core.SolrCore)">postClose</A></B>(<A HREF="../../../../org/apache/solr/core/SolrCore.html" title="class in org.apache.solr.core">SolrCore</A>&nbsp;core)</CODE>
145
146 <BR>
147 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method called when the given SolrCore object has been shut down and update handlers and searchers are closed
148  <br/>
149  Use this method for post-close clean up operations e.g.</TD>
150 </TR>
151 <TR BGCOLOR="white" CLASS="TableRowColor">
152 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
153 <CODE>abstract &nbsp;void</CODE></FONT></TD>
154 <TD><CODE><B><A HREF="../../../../org/apache/solr/core/CloseHook.html#preClose(org.apache.solr.core.SolrCore)">preClose</A></B>(<A HREF="../../../../org/apache/solr/core/SolrCore.html" title="class in org.apache.solr.core">SolrCore</A>&nbsp;core)</CODE>
155
156 <BR>
157 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method called when the given SolrCore object is closing / shutting down but before the update handler and
158  searcher(s) are actually closed
159  <br />
160  <b>Important:</b> Keep the method implementation as short as possible.</TD>
161 </TR>
162 </TABLE>
163 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
164 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
165 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
166 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
167 </TR>
168 <TR BGCOLOR="white" CLASS="TableRowColor">
169 <TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
170 </TR>
171 </TABLE>
172 &nbsp;
173 <P>
174
175 <!-- ========= CONSTRUCTOR DETAIL ======== -->
176
177 <A NAME="constructor_detail"><!-- --></A>
178 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
179 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
180 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
181 <B>Constructor Detail</B></FONT></TH>
182 </TR>
183 </TABLE>
184
185 <A NAME="CloseHook()"><!-- --></A><H3>
186 CloseHook</H3>
187 <PRE>
188 public <B>CloseHook</B>()</PRE>
189 <DL>
190 </DL>
191
192 <!-- ============ METHOD DETAIL ========== -->
193
194 <A NAME="method_detail"><!-- --></A>
195 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
196 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
197 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
198 <B>Method Detail</B></FONT></TH>
199 </TR>
200 </TABLE>
201
202 <A NAME="preClose(org.apache.solr.core.SolrCore)"><!-- --></A><H3>
203 preClose</H3>
204 <PRE>
205 public abstract void <B>preClose</B>(<A HREF="../../../../org/apache/solr/core/SolrCore.html" title="class in org.apache.solr.core">SolrCore</A>&nbsp;core)</PRE>
206 <DL>
207 <DD>Method called when the given SolrCore object is closing / shutting down but before the update handler and
208  searcher(s) are actually closed
209  <br />
210  <b>Important:</b> Keep the method implementation as short as possible. If it were to use any heavy i/o , network connections -
211  it might be a better idea to launch in a separate Thread so as to not to block the process of
212  shutting down a given SolrCore instance.
213 <P>
214 <DD><DL>
215 <DT><B>Parameters:</B><DD><CODE>core</CODE> - SolrCore object that is shutting down / closing</DL>
216 </DD>
217 </DL>
218 <HR>
219
220 <A NAME="postClose(org.apache.solr.core.SolrCore)"><!-- --></A><H3>
221 postClose</H3>
222 <PRE>
223 public abstract void <B>postClose</B>(<A HREF="../../../../org/apache/solr/core/SolrCore.html" title="class in org.apache.solr.core">SolrCore</A>&nbsp;core)</PRE>
224 <DL>
225 <DD>Method called when the given SolrCore object has been shut down and update handlers and searchers are closed
226  <br/>
227  Use this method for post-close clean up operations e.g. deleting the index from disk.
228  <br/>
229  <b>The core's passed to the method is already closed and therefore, it's update handler or searcher should *NOT* be used</b>
230
231  <b>Important:</b> Keep the method implementation as short as possible. If it were to use any heavy i/o , network connections -
232  it might be a better idea to launch in a separate Thread so as to not to block the process of
233  shutting down a given SolrCore instance.
234 <P>
235 <DD><DL>
236 </DL>
237 </DD>
238 </DL>
239 <!-- ========= END OF CLASS DATA ========= -->
240 <HR>
241
242
243 <!-- ======= START OF BOTTOM NAVBAR ====== -->
244 <A NAME="navbar_bottom"><!-- --></A>
245 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
246 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
247 <TR>
248 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
249 <A NAME="navbar_bottom_firstrow"><!-- --></A>
250 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
251   <TR ALIGN="center" VALIGN="top">
252   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
253   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
254   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
255   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/CloseHook.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
256   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
257   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
258   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
259   </TR>
260 </TABLE>
261 </TD>
262 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
263 </EM>
264 </TD>
265 </TR>
266
267 <TR>
268 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
269 &nbsp;<A HREF="../../../../org/apache/solr/core/CachingDirectoryFactory.CloseListener.html" title="interface in org.apache.solr.core"><B>PREV CLASS</B></A>&nbsp;
270 &nbsp;<A HREF="../../../../org/apache/solr/core/CodecFactory.html" title="class in org.apache.solr.core"><B>NEXT CLASS</B></A></FONT></TD>
271 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
272   <A HREF="../../../../index.html?org/apache/solr/core/CloseHook.html" target="_top"><B>FRAMES</B></A>  &nbsp;
273 &nbsp;<A HREF="CloseHook.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
274 &nbsp;<SCRIPT type="text/javascript">
275   <!--
276   if(window==top) {
277     document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
278   }
279   //-->
280 </SCRIPT>
281 <NOSCRIPT>
282   <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
283 </NOSCRIPT>
284
285
286 </FONT></TD>
287 </TR>
288 <TR>
289 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
290   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
291 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
292 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
293 </TR>
294 </TABLE>
295 <A NAME="skip-navbar_bottom"></A>
296 <!-- ======== END OF BOTTOM NAVBAR ======= -->
297
298 <HR>
299
300           <i>Copyright &copy; 2000-2013 Apache Software Foundation.  All Rights Reserved.</i>
301           <script src='../../../../prettify.js' type='text/javascript'></script>
302           <script type='text/javascript'>
303             (function(){
304               var oldonload = window.onload;
305               if (typeof oldonload != 'function') {
306                 window.onload = prettyPrint;
307               } else {
308                 window.onload = function() {
309                   oldonload();
310                   prettyPrint();
311                 }
312               }
313             })();
314           </script>
315         
316 </BODY>
317 </HTML>