• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/db-4.8.30/docs/java/com/sleepycat/db/
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_03) on Mon Apr 12 16:25:46 EDT 2010 -->
6<TITLE>
7EventHandler (Oracle - Berkeley DB Java API)
8</TITLE>
9
10<META NAME="date" CONTENT="2010-04-12">
11
12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../style.css" TITLE="Style">
13
14<SCRIPT type="text/javascript">
15function windowTitle()
16{
17    if (location.href.indexOf('is-external=true') == -1) {
18        parent.document.title="EventHandler (Oracle - Berkeley DB Java API)";
19    }
20}
21</SCRIPT>
22<NOSCRIPT>
23</NOSCRIPT>
24
25</HEAD>
26
27<BODY BGCOLOR="white" onload="windowTitle();">
28<HR>
29
30
31<!-- ========= START OF TOP NAVBAR ======= -->
32<A NAME="navbar_top"><!-- --></A>
33<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
34<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
35<TR>
36<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
37<A NAME="navbar_top_firstrow"><!-- --></A>
38<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
39  <TR ALIGN="center" VALIGN="top">
40  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
43  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/EventHandler.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
45  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
46  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</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<b>Berkeley DB</b><br><font size="-1"> version 4.8.30</font></EM>
53</TD>
54</TR>
55
56<TR>
57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58&nbsp;<A HREF="../../../com/sleepycat/db/ErrorHandler.html" title="interface in com.sleepycat.db"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../com/sleepycat/db/EventHandlerAdapter.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD>
60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61  <A HREF="../../../index.html?com/sleepycat/db/EventHandler.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="EventHandler.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;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&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">
91com.sleepycat.db</FONT>
92<BR>
93Interface EventHandler</H2>
94<DL>
95<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../com/sleepycat/db/EventHandlerAdapter.html" title="class in com.sleepycat.db">EventHandlerAdapter</A></DD>
96</DL>
97<HR>
98<DL>
99<DT><PRE>public interface <B>EventHandler</B></DL>
100</PRE>
101
102<P>
103An interface classs with prototype definitions of all event functions that
104can be called via the Berkeley DB event callback mechanism.
105<p>
106A user can choose to implement the EventHandler class, and implement handlers
107for all of the event types. Alternatively it is possible to extend the
108EventHandlerAdapter class, and implement only those events relevant to the
109specific application.
110<p>
111The <A HREF="../../../com/sleepycat/db/EnvironmentConfig.html#setEventHandler(com.sleepycat.db.EventHandler)"><CODE>EnvironmentConfig.setEventHandler</CODE></A> is used to provide
112a mechanism for reporting event messages from the Berkeley DB library
113to the application.
114<p>
115Berkeley DB is not re-entrant. Callback functions should not attempt
116to make library calls (for example, to release locks or close open
117handles). Re-entering Berkeley DB is not guaranteed to work correctly,
118and the results are undefined.
119<P>
120
121<P>
122<HR>
123
124<P>
125
126<!-- ========== METHOD SUMMARY =========== -->
127
128<A NAME="method_summary"><!-- --></A>
129<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
130<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
131<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
132<B>Method Summary</B></FONT></TH>
133</TR>
134<TR BGCOLOR="white" CLASS="TableRowColor">
135<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
136<CODE>&nbsp;void</CODE></FONT></TD>
137<TD><CODE><B><A HREF="../../../com/sleepycat/db/EventHandler.html#handlePanicEvent()">handlePanicEvent</A></B>()</CODE>
138
139<BR>
140&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A callback function to be called when a panic event is sent from the    Berkeley DB library.</TD>
141</TR>
142<TR BGCOLOR="white" CLASS="TableRowColor">
143<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
144<CODE>&nbsp;void</CODE></FONT></TD>
145<TD><CODE><B><A HREF="../../../com/sleepycat/db/EventHandler.html#handleRepClientEvent()">handleRepClientEvent</A></B>()</CODE>
146
147<BR>
148&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A callback function to be called when a Replication Client event is sent
149    from the Berkeley DB library.</TD>
150</TR>
151<TR BGCOLOR="white" CLASS="TableRowColor">
152<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
153<CODE>&nbsp;void</CODE></FONT></TD>
154<TD><CODE><B><A HREF="../../../com/sleepycat/db/EventHandler.html#handleRepElectedEvent()">handleRepElectedEvent</A></B>()</CODE>
155
156<BR>
157&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A callback function to be called when an event is sent from the
158    Berkeley DB library.</TD>
159</TR>
160<TR BGCOLOR="white" CLASS="TableRowColor">
161<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
162<CODE>&nbsp;void</CODE></FONT></TD>
163<TD><CODE><B><A HREF="../../../com/sleepycat/db/EventHandler.html#handleRepMasterEvent()">handleRepMasterEvent</A></B>()</CODE>
164
165<BR>
166&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A callback function to be called when an event is sent from the
167    Berkeley DB library.</TD>
168</TR>
169<TR BGCOLOR="white" CLASS="TableRowColor">
170<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
171<CODE>&nbsp;void</CODE></FONT></TD>
172<TD><CODE><B><A HREF="../../../com/sleepycat/db/EventHandler.html#handleRepNewMasterEvent(int)">handleRepNewMasterEvent</A></B>(int&nbsp;envId)</CODE>
173
174<BR>
175&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A callback function to be called when an event is sent from the
176    Berkeley DB library.</TD>
177</TR>
178<TR BGCOLOR="white" CLASS="TableRowColor">
179<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
180<CODE>&nbsp;void</CODE></FONT></TD>
181<TD><CODE><B><A HREF="../../../com/sleepycat/db/EventHandler.html#handleRepPermFailedEvent()">handleRepPermFailedEvent</A></B>()</CODE>
182
183<BR>
184&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A callback function to be called when an event is sent from the
185    Berkeley DB library.</TD>
186</TR>
187<TR BGCOLOR="white" CLASS="TableRowColor">
188<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
189<CODE>&nbsp;void</CODE></FONT></TD>
190<TD><CODE><B><A HREF="../../../com/sleepycat/db/EventHandler.html#handleRepStartupDoneEvent()">handleRepStartupDoneEvent</A></B>()</CODE>
191
192<BR>
193&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A callback function to be called when an event is sent from the
194    Berkeley DB library.</TD>
195</TR>
196<TR BGCOLOR="white" CLASS="TableRowColor">
197<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
198<CODE>&nbsp;void</CODE></FONT></TD>
199<TD><CODE><B><A HREF="../../../com/sleepycat/db/EventHandler.html#handleWriteFailedEvent(int)">handleWriteFailedEvent</A></B>(int&nbsp;errorCode)</CODE>
200
201<BR>
202&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A callback function to be called when an event is sent from the
203    Berkeley DB library.</TD>
204</TR>
205</TABLE>
206&nbsp;
207<P>
208
209<!-- ============ METHOD DETAIL ========== -->
210
211<A NAME="method_detail"><!-- --></A>
212<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
213<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
214<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
215<B>Method Detail</B></FONT></TH>
216</TR>
217</TABLE>
218
219<A NAME="handlePanicEvent()"><!-- --></A><H3>
220handlePanicEvent</H3>
221<PRE>
222void <B>handlePanicEvent</B>()</PRE>
223<DL>
224<DD>A callback function to be called when a panic event is sent from the    Berkeley DB library.
225    <p>    This event callback is received when an error occurs in the Berkeley DB
226    library where the only solution is to shut down the application and run
227    recovery. In such cases, the Berkeley DB methods will throw
228    <A HREF="../../../com/sleepycat/db/RunRecoveryException.html" title="class in com.sleepycat.db"><CODE>RunRecoveryException</CODE></A> exceptions. It is often easier to simply exit
229    the application when such errors occur, rather than gracefully return up
230    the stack.
231    <p>
232    When this callback is received the database environment has failed. All
233    threads of control in the database environment should exit the environment
234    and recovery should be run.
235<P>
236<DD><DL>
237</DL>
238</DD>
239</DL>
240<HR>
241
242<A NAME="handleRepClientEvent()"><!-- --></A><H3>
243handleRepClientEvent</H3>
244<PRE>
245void <B>handleRepClientEvent</B>()</PRE>
246<DL>
247<DD>A callback function to be called when a Replication Client event is sent
248    from the Berkeley DB library.
249    <p>
250    This event callback is received when this member of a replication group is
251    now a client site.
252<P>
253<DD><DL>
254</DL>
255</DD>
256</DL>
257<HR>
258
259<A NAME="handleRepElectedEvent()"><!-- --></A><H3>
260handleRepElectedEvent</H3>
261<PRE>
262void <B>handleRepElectedEvent</B>()</PRE>
263<DL>
264<DD>A callback function to be called when an event is sent from the
265    Berkeley DB library.
266    <p>
267    This event callback is received when this site has just won an election. An
268    Application using the Base replication API should arrange for a call to
269    the <A HREF="../../../com/sleepycat/db/Environment.html#startReplication(com.sleepycat.db.DatabaseEntry, boolean)"><CODE>Environment.startReplication</CODE></A> method after receiving this
270    event to, reconfigure the local environment as a replication master.
271    <p>
272    Replication Manager applications may safely igore this event. The
273    Replication Manager calls <A HREF="../../../com/sleepycat/db/Environment.html#startReplication(com.sleepycat.db.DatabaseEntry, boolean)"><CODE>Environment.startReplication</CODE></A>
274    automatically on behalf of the application when appropriate (resulting in
275    firing of the <A HREF="../../../com/sleepycat/db/EventHandler.html#handleRepMasterEvent()"><CODE>EventHandler.handleRepMasterEvent</CODE></A> event).
276<P>
277<DD><DL>
278</DL>
279</DD>
280</DL>
281<HR>
282
283<A NAME="handleRepMasterEvent()"><!-- --></A><H3>
284handleRepMasterEvent</H3>
285<PRE>
286void <B>handleRepMasterEvent</B>()</PRE>
287<DL>
288<DD>A callback function to be called when an event is sent from the
289    Berkeley DB library.
290    <p>
291    This event callback is received when this site is now the master site of
292    its replication group. It is the application's responsibility to begin
293    acting as the master environment.
294<P>
295<DD><DL>
296</DL>
297</DD>
298</DL>
299<HR>
300
301<A NAME="handleRepNewMasterEvent(int)"><!-- --></A><H3>
302handleRepNewMasterEvent</H3>
303<PRE>
304void <B>handleRepNewMasterEvent</B>(int&nbsp;envId)</PRE>
305<DL>
306<DD>A callback function to be called when an event is sent from the
307    Berkeley DB library.
308    <p>
309    This event callback is received when the replication group of which this
310    site is a member has just established a new master; the local site is not
311    the new master.
312<P>
313<DD><DL>
314<DT><B>Parameters:</B><DD><CODE>envId</CODE> - The environment ID of the new master site.</DL>
315</DD>
316</DL>
317<HR>
318
319<A NAME="handleRepPermFailedEvent()"><!-- --></A><H3>
320handleRepPermFailedEvent</H3>
321<PRE>
322void <B>handleRepPermFailedEvent</B>()</PRE>
323<DL>
324<DD>A callback function to be called when an event is sent from the
325    Berkeley DB library.
326    <p>
327    This event callback is received when the replication manager did not
328    receive enough acknowledgements (based on the acknowledgement policy
329    configured with <A HREF="../../../com/sleepycat/db/EnvironmentConfig.html#setReplicationManagerAckPolicy(com.sleepycat.db.ReplicationManagerAckPolicy)"><CODE>EnvironmentConfig.setReplicationManagerAckPolicy</CODE></A>)
330    to ensure a transaction's durability within the replication group. The
331    transaction will be flushed to the master's local disk storage for
332    durability.
333<P>
334<DD><DL>
335</DL>
336</DD>
337</DL>
338<HR>
339
340<A NAME="handleRepStartupDoneEvent()"><!-- --></A><H3>
341handleRepStartupDoneEvent</H3>
342<PRE>
343void <B>handleRepStartupDoneEvent</B>()</PRE>
344<DL>
345<DD>A callback function to be called when an event is sent from the
346    Berkeley DB library.
347    <p>
348    This event callback is received when the client has completed startup
349    synchronization and is now processing live log records received from the
350    master.
351<P>
352<DD><DL>
353</DL>
354</DD>
355</DL>
356<HR>
357
358<A NAME="handleWriteFailedEvent(int)"><!-- --></A><H3>
359handleWriteFailedEvent</H3>
360<PRE>
361void <B>handleWriteFailedEvent</B>(int&nbsp;errorCode)</PRE>
362<DL>
363<DD>A callback function to be called when an event is sent from the
364    Berkeley DB library.
365    <p>
366    This event callback is received when a Berkeley DB write to stable storage
367    failed.
368<P>
369<DD><DL>
370<DT><B>Parameters:</B><DD><CODE>errorCode</CODE> - If an operating system specific error code is available for the failure it
371    will be passed in the errorCode parameter.</DL>
372</DD>
373</DL>
374<!-- ========= END OF CLASS DATA ========= -->
375<HR>
376
377
378<!-- ======= START OF BOTTOM NAVBAR ====== -->
379<A NAME="navbar_bottom"><!-- --></A>
380<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
381<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
382<TR>
383<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
384<A NAME="navbar_bottom_firstrow"><!-- --></A>
385<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
386  <TR ALIGN="center" VALIGN="top">
387  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
388  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
389  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
390  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/EventHandler.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
391  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
392  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
393  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
394  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
395  </TR>
396</TABLE>
397</TD>
398<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
399<b>Berkeley DB</b><br><font size="-1"> version 4.8.30</font></EM>
400</TD>
401</TR>
402
403<TR>
404<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
405&nbsp;<A HREF="../../../com/sleepycat/db/ErrorHandler.html" title="interface in com.sleepycat.db"><B>PREV CLASS</B></A>&nbsp;
406&nbsp;<A HREF="../../../com/sleepycat/db/EventHandlerAdapter.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD>
407<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
408  <A HREF="../../../index.html?com/sleepycat/db/EventHandler.html" target="_top"><B>FRAMES</B></A>  &nbsp;
409&nbsp;<A HREF="EventHandler.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
410&nbsp;<SCRIPT type="text/javascript">
411  <!--
412  if(window==top) {
413    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
414  }
415  //-->
416</SCRIPT>
417<NOSCRIPT>
418  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
419</NOSCRIPT>
420
421
422</FONT></TD>
423</TR>
424<TR>
425<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
426  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
427<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
428DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
429</TR>
430</TABLE>
431<A NAME="skip-navbar_bottom"></A>
432<!-- ======== END OF BOTTOM NAVBAR ======= -->
433
434<HR>
435<font size=1>Copyright (c) 1996-2009 Oracle.  All rights reserved.</font>
436</BODY>
437</HTML>
438