📄 ejbcontext.html
字号:
<DT><B>Returns:</B><DD>The enterprise bean's local home interface.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the enterprise bean does not have a local home interface.</DL></DD></DL><HR><A NAME="getEnvironment()"><!-- --></A><H3>getEnvironment</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Properties.html" title="class or interface in java.util">Properties</A> <B>getEnvironment</B>()</PRE><DL><DD><B>Deprecated.</B> <I>Use the JNDI naming context java:comp/env to access enterprise bean's environment.</I><P><DD>Obtain the enterprise bean's environment properties. <p><b>Note:</b> If the enterprise bean has no environment properties this method returns an empty java.util.Properties object. This method never returns null.<P><DD><DL><DT><B>Returns:</B><DD>The environment properties for the enterprise bean.</DL></DD></DL><HR><A NAME="getCallerIdentity()"><!-- --></A><H3>getCallerIdentity</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/security/Identity.html" title="class or interface in java.security">Identity</A> <B>getCallerIdentity</B>()</PRE><DL><DD><B>Deprecated.</B> <I>Use Principal getCallerPrincipal() instead.</I><P><DD>Obtain the java.security.Identity of the caller. This method is deprecated in EJB 1.1. The Container is allowed to return alway null from this method. The enterprise bean should use the getCallerPrincipal method instead.<P><DD><DL><DT><B>Returns:</B><DD>The Identity object that identifies the caller.</DL></DD></DL><HR><A NAME="getCallerPrincipal()"><!-- --></A><H3>getCallerPrincipal</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/security/Principal.html" title="class or interface in java.security">Principal</A> <B>getCallerPrincipal</B>()</PRE><DL><DD>Obtain the java.security.Principal that identifies the caller.<P><DD><DL><DT><B>Returns:</B><DD>The Principal object that identifies the caller. This method never returns null.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - The Container throws the exception if the instance is not allowed to call this method.</DL></DD></DL><HR><A NAME="isCallerInRole(java.security.Identity)"><!-- --></A><H3>isCallerInRole</H3><PRE>public boolean <B>isCallerInRole</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/security/Identity.html" title="class or interface in java.security">Identity</A> role)</PRE><DL><DD><B>Deprecated.</B> <I>Use boolean isCallerInRole(String roleName) instead.</I><P><DD>Test if the caller has a given role. <p>This method is deprecated in EJB 1.1. The enterprise bean should use the isCallerInRole(String roleName) method instead.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>role</CODE> - The java.security.Identity of the role to be tested.<DT><B>Returns:</B><DD>True if the caller has the specified role.</DL></DD></DL><HR><A NAME="isCallerInRole(java.lang.String)"><!-- --></A><H3>isCallerInRole</H3><PRE>public boolean <B>isCallerInRole</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> roleName)</PRE><DL><DD>Test if the caller has a given security role.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>roleName</CODE> - The name of the security role. The role must be one of the security roles that is defined in the deployment descriptor.<DT><B>Returns:</B><DD>True if the caller has the specified role.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - The Container throws the exception if the instance is not allowed to call this method.</DL></DD></DL><HR><A NAME="getUserTransaction()"><!-- --></A><H3>getUserTransaction</H3><PRE>public <A HREF="../../javax/transaction/UserTransaction.html" title="interface in javax.transaction">UserTransaction</A> <B>getUserTransaction</B>() throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></PRE><DL><DD>Obtain the transaction demarcation interface. Only enterprise beans with bean-managed transactions are allowed to to use the UserTransaction interface. As entity beans must always use container-managed transactions, only session beans or message-driven beans with bean-managed transactions are allowed to invoke this method.<P><DD><DL><DT><B>Returns:</B><DD>The UserTransaction interface that the enterprise bean instance can use for transaction demarcation.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - The Container throws the exception if the instance is not allowed to use the UserTransaction interface (i.e. the instance is of a bean with container-managed transactions).</DL></DD></DL><HR><A NAME="setRollbackOnly()"><!-- --></A><H3>setRollbackOnly</H3><PRE>public void <B>setRollbackOnly</B>() throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></PRE><DL><DD>Mark the current transaction for rollback. The transaction will become permanently marked for rollback. A transaction marked for rollback can never commit. Only enterprise beans with container-managed transactions are allowed to use this method.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - The Container throws the exception if the instance is not allowed to use this method (i.e. the instance is of a bean with bean-managed transactions).</DL></DD></DL><HR><A NAME="getRollbackOnly()"><!-- --></A><H3>getRollbackOnly</H3><PRE>public boolean <B>getRollbackOnly</B>() throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></PRE><DL><DD>Test if the transaction has been marked for rollback only. An enterprise bean instance can use this operation, for example, to test after an exception has been caught, whether it is fruitless to continue computation on behalf of the current transaction. Only enterprise beans with container-managed transactions are allowed to use this method.<P><DD><DL><DT><B>Returns:</B><DD>True if the current transaction is marked for rollback, false otherwise.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - The Container throws the exception if the instance is not allowed to use this method (i.e. the instance is of a bean with bean-managed transactions).</DL></DD></DL><HR><A NAME="getTimerService()"><!-- --></A><H3>getTimerService</H3><PRE>public <A HREF="../../javax/ejb/TimerService.html" title="interface in javax.ejb">TimerService</A> <B>getTimerService</B>() throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></PRE><DL><DD>Get access to the EJB Timer Service.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - The Container throws the exception if the instance is not allowed to use this method (e.g. if the bean is a stateful session bean)</DL></DD></DL><!-- ========= 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=3 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> </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><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Ent. Ed. v1.4</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../javax/ejb/EJBHome.html" title="interface in javax.ejb"><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="EJBContext.html" target="_top"><B>NO FRAMES</B></A> <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: NESTED | 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><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2003 Sun Microsystems, Inc. All rights reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -