sessionbean.html
来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 307 行
HTML
307 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Jan 17 03:51:31 PST 2002 -->
<TITLE>
Java 2 Platform EE v1.3: Interface SessionBean
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../javax/ejb/MessageDrivenContext.html"><B>PREV CLASS</B></A>
<A HREF="../../javax/ejb/SessionContext.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="SessionBean.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.ejb</FONT>
<BR>
Interface SessionBean</H2>
<DL>
<DT><B>All Superinterfaces:</B> <DD><A HREF="../../javax/ejb/EnterpriseBean.html">EnterpriseBean</A>, java.io.Serializable</DD>
</DL>
<HR>
<DL>
<DT>public interface <B>SessionBean</B><DT>extends <A HREF="../../javax/ejb/EnterpriseBean.html">EnterpriseBean</A></DL>
<P>
The SessionBean interface is implemented by every session enterprise Bean
class. The container uses the SessionBean methods to notify the enterprise
Bean instances of the instance's life cycle events.
<P>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/ejb/SessionBean.html#ejbActivate()">ejbActivate</A></B>()</CODE>
<BR>
The activate method is called when the instance is activated
from its "passive" state.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/ejb/SessionBean.html#ejbPassivate()">ejbPassivate</A></B>()</CODE>
<BR>
The passivate method is called before the instance enters
the "passive" state.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/ejb/SessionBean.html#ejbRemove()">ejbRemove</A></B>()</CODE>
<BR>
A container invokes this method before it ends the life of the session
object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/ejb/SessionBean.html#setSessionContext(javax.ejb.SessionContext)">setSessionContext</A></B>(<A HREF="../../javax/ejb/SessionContext.html">SessionContext</A> ctx)</CODE>
<BR>
Set the associated session context.</TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="setSessionContext(javax.ejb.SessionContext)"><!-- --></A><H3>
setSessionContext</H3>
<PRE>
public void <B>setSessionContext</B>(<A HREF="../../javax/ejb/SessionContext.html">SessionContext</A> ctx)
throws <A HREF="../../javax/ejb/EJBException.html">EJBException</A>,
java.rmi.RemoteException</PRE>
<DL>
<DD>Set the associated session context. The container calls this method
after the instance creation.
<p> The enterprise Bean instance should store the reference to the
context object in an instance variable.
<p> This method is called with no transaction context.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>ctx</CODE> - A SessionContext interface for the instance.<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/ejb/EJBException.html">EJBException</A></CODE> - Thrown by the method to indicate a failure
caused by a system-level error.<DD><CODE>java.rmi.RemoteException</CODE> - This exception is defined in the method
signature to provide backward compatibility for applications written
for the EJB 1.0 specification. Enterprise beans written for the
EJB 1.1 specification should throw the
javax.ejb.EJBException instead of this exception.
Enterprise beans written for the EJB2.0 and higher specifications
must throw the javax.ejb.EJBException instead of this exception.</DL>
</DD>
</DL>
<HR>
<A NAME="ejbRemove()"><!-- --></A><H3>
ejbRemove</H3>
<PRE>
public void <B>ejbRemove</B>()
throws <A HREF="../../javax/ejb/EJBException.html">EJBException</A>,
java.rmi.RemoteException</PRE>
<DL>
<DD>A container invokes this method before it ends the life of the session
object. This happens as a result of a client's invoking a remove
operation, or when a container decides to terminate the session object
after a timeout.
<p> This method is called with no transaction context.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/ejb/EJBException.html">EJBException</A></CODE> - Thrown by the method to indicate a failure
caused by a system-level error.<DD><CODE>java.rmi.RemoteException</CODE> - This exception is defined in the method
signature to provide backward compatibility for enterprise beans
written for the EJB 1.0 specification. Enterprise beans written
for the EJB 1.1 specification should throw the
javax.ejb.EJBException instead of this exception.
Enterprise beans written for the EJB2.0 and higher specifications
must throw the javax.ejb.EJBException instead of this exception.</DL>
</DD>
</DL>
<HR>
<A NAME="ejbActivate()"><!-- --></A><H3>
ejbActivate</H3>
<PRE>
public void <B>ejbActivate</B>()
throws <A HREF="../../javax/ejb/EJBException.html">EJBException</A>,
java.rmi.RemoteException</PRE>
<DL>
<DD>The activate method is called when the instance is activated
from its "passive" state. The instance should acquire any resource
that it has released earlier in the ejbPassivate() method.
<p> This method is called with no transaction context.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/ejb/EJBException.html">EJBException</A></CODE> - Thrown by the method to indicate a failure
caused by a system-level error.<DD><CODE>java.rmi.RemoteException</CODE> - This exception is defined in the method
signature to provide backward compatibility for enterprise beans
written for the EJB 1.0 specification. Enterprise beans written
for the EJB 1.1 specification should throw the
javax.ejb.EJBException instead of this exception.
Enterprise beans written for the EJB2.0 and higher specifications
must throw the javax.ejb.EJBException instead of this exception.</DL>
</DD>
</DL>
<HR>
<A NAME="ejbPassivate()"><!-- --></A><H3>
ejbPassivate</H3>
<PRE>
public void <B>ejbPassivate</B>()
throws <A HREF="../../javax/ejb/EJBException.html">EJBException</A>,
java.rmi.RemoteException</PRE>
<DL>
<DD>The passivate method is called before the instance enters
the "passive" state. The instance should release any resources that
it can re-acquire later in the ejbActivate() method.
<p> After the passivate method completes, the instance must be
in a state that allows the container to use the Java Serialization
protocol to externalize and store away the instance's state.
<p> This method is called with no transaction context.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/ejb/EJBException.html">EJBException</A></CODE> - Thrown by the method to indicate a failure
caused by a system-level error.<DD><CODE>java.rmi.RemoteException</CODE> - This exception is defined in the method
signature to provide backward compatibility for enterprise beans
written for the EJB 1.0 specification. Enterprise beans written
for the EJB 1.1 specification should throw the
javax.ejb.EJBException instead of this exception.
Enterprise beans written for the EJB2.0 and higher specifications
must throw the javax.ejb.EJBException instead of this exception.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../javax/ejb/MessageDrivenContext.html"><B>PREV CLASS</B></A>
<A HREF="../../javax/ejb/SessionContext.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="SessionBean.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?