blob: 1b2825cc60b0264e9a339bd1f34cb6115bed0425 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_01) on Tue Mar 18 12:43:11 PDT 2008 -->
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>
InstanceCallbacks (JDO2 API Legacy 2.1)
</TITLE>
<META NAME="date" CONTENT="2008-03-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="InstanceCallbacks (JDO2 API Legacy 2.1)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/InstanceCallbacks.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../javax/jdo/FetchPlan.html" title="interface in javax.jdo"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../javax/jdo/JDOCanRetryException.html" title="class in javax.jdo"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?javax/jdo/InstanceCallbacks.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="InstanceCallbacks.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;METHOD</FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.jdo</FONT>
<BR>
Interface InstanceCallbacks</H2>
<DL>
<DT><B>All Superinterfaces:</B> <DD><A HREF="../../javax/jdo/listener/ClearCallback.html" title="interface in javax.jdo.listener">ClearCallback</A>, <A HREF="../../javax/jdo/listener/DeleteCallback.html" title="interface in javax.jdo.listener">DeleteCallback</A>, <A HREF="../../javax/jdo/listener/LoadCallback.html" title="interface in javax.jdo.listener">LoadCallback</A>, <A HREF="../../javax/jdo/listener/StoreCallback.html" title="interface in javax.jdo.listener">StoreCallback</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>InstanceCallbacks</B><DT>extends <A HREF="../../javax/jdo/listener/ClearCallback.html" title="interface in javax.jdo.listener">ClearCallback</A>, <A HREF="../../javax/jdo/listener/DeleteCallback.html" title="interface in javax.jdo.listener">DeleteCallback</A>, <A HREF="../../javax/jdo/listener/LoadCallback.html" title="interface in javax.jdo.listener">LoadCallback</A>, <A HREF="../../javax/jdo/listener/StoreCallback.html" title="interface in javax.jdo.listener">StoreCallback</A></DL>
</PRE>
<P>
A <code>PersistenceCapable</code> class that provides callback methods for life
cycle events implements this interface.
<P>For JDO 2.0, <code>InstanceCallbacks</code> has been refactored to extend
four other interfaces, without changing any of the methods or semantics.
This allows fine-grained control over callbacks, for
example to allow a class to implement the load callback without
implementing any of the other callbacks. For backward compatibility
with JDO 1.0, the <code>InstanceCallbacks</code> interface is preserved.
<P>Classes which include non-persistent fields whose values depend
on the values of persistent fields require callbacks on specific
JDO instance life cycle events in order to correctly populate the
values in these fields.
<P>The callbacks might also be used if the persistent instances
need to be put into the runtime infrastructure of the application.
For example, a persistent instance might notify other instances
on changes to state. The persistent instance might be in a list of
managed instances. When the persistent instance is made hollow,
it can no longer generate change events, and the persistent
instance should be removed from the list of managed instances.
<P>To implement this, the application programmer would implement
<code>jdoPostLoad</code> to put itself into the list of managed
instances, and implement <code>jdoPreClear</code> to remove itself from
the list. With JDO 1.0, the domain class would be declared to implement
<code>InstanceCallbacks</code>. With JDO 2.0, the domain class
would be declared to implement
<code>javax.jdo.listener.LoadCallback</code> and
<code>javax.jdo.listener.ClearCallback</code>.
<P>Note that JDO does not manage the state of non-persistent
fields, and when a JDO instance transitions to hollow, JDO clears
the persistent fields. It is the programmer's responsibility to
clear non-persistent fields so that garbage collection of
referred instances can occur.
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>1.0</DD>
<DT><B>Version:</B></DT>
<DD>2.0</DD>
</DL>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.jdo.listener.ClearCallback"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from interface javax.jdo.listener.<A HREF="../../javax/jdo/listener/ClearCallback.html" title="interface in javax.jdo.listener">ClearCallback</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../javax/jdo/listener/ClearCallback.html#jdoPreClear()">jdoPreClear</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.jdo.listener.DeleteCallback"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from interface javax.jdo.listener.<A HREF="../../javax/jdo/listener/DeleteCallback.html" title="interface in javax.jdo.listener">DeleteCallback</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../javax/jdo/listener/DeleteCallback.html#jdoPreDelete()">jdoPreDelete</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.jdo.listener.LoadCallback"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from interface javax.jdo.listener.<A HREF="../../javax/jdo/listener/LoadCallback.html" title="interface in javax.jdo.listener">LoadCallback</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../javax/jdo/listener/LoadCallback.html#jdoPostLoad()">jdoPostLoad</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.jdo.listener.StoreCallback"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from interface javax.jdo.listener.<A HREF="../../javax/jdo/listener/StoreCallback.html" title="interface in javax.jdo.listener">StoreCallback</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../javax/jdo/listener/StoreCallback.html#jdoPreStore()">jdoPreStore</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/InstanceCallbacks.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../javax/jdo/FetchPlan.html" title="interface in javax.jdo"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../javax/jdo/JDOCanRetryException.html" title="class in javax.jdo"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?javax/jdo/InstanceCallbacks.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="InstanceCallbacks.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;METHOD</FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &copy; 2005-2008 Apache Software Foundation. All Rights Reserved.
</BODY>
</HTML>