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