topicrequestor.html
来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 272 行
HTML
272 行
<!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:32 PST 2002 -->
<TITLE>
Java 2 Platform EE v1.3: Class TopicRequestor
</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/jms/QueueRequestor.html"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="TopicRequestor.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.jms</FONT>
<BR>
Class TopicRequestor</H2>
<PRE>
java.lang.Object
|
+--<B>javax.jms.TopicRequestor</B>
</PRE>
<HR>
<DL>
<DT>public class <B>TopicRequestor</B><DT>extends java.lang.Object</DL>
<P>
The <CODE>TopicRequestor</CODE> helper class simplifies
making service requests.
<P>The <CODE>TopicRequestor</CODE> constructor is given a non-transacted
<CODE>TopicSession</CODE> and a destination <CODE>Topic</CODE>. It creates a
<CODE>TemporaryTopic</CODE> for the responses and provides a
<CODE>request</CODE> method that sends the request message and waits
for its reply.
<P>This is a basic request/reply abstraction that should be sufficient
for most uses. JMS providers and clients are free to create more
sophisticated versions.
<P>
<DL>
<DT><B>See Also: </B><DD><A HREF="../../javax/jms/QueueRequestor.html"><CODE>QueueRequestor</CODE></A></DL>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../javax/jms/TopicRequestor.html#TopicRequestor(javax.jms.TopicSession, javax.jms.Topic)">TopicRequestor</A></B>(<A HREF="../../javax/jms/TopicSession.html">TopicSession</A> session,
<A HREF="../../javax/jms/Topic.html">Topic</A> topic)</CODE>
<BR>
Constructor for the <CODE>TopicRequestor</CODE> class.</TD>
</TR>
</TABLE>
<!-- ========== 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/jms/TopicRequestor.html#close()">close</A></B>()</CODE>
<BR>
Closes the <CODE>TopicRequestor</CODE> and its session.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/jms/Message.html">Message</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/jms/TopicRequestor.html#request(javax.jms.Message)">request</A></B>(<A HREF="../../javax/jms/Message.html">Message</A> message)</CODE>
<BR>
Sends a request and waits for a reply.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="TopicRequestor(javax.jms.TopicSession, javax.jms.Topic)"><!-- --></A><H3>
TopicRequestor</H3>
<PRE>
public <B>TopicRequestor</B>(<A HREF="../../javax/jms/TopicSession.html">TopicSession</A> session,
<A HREF="../../javax/jms/Topic.html">Topic</A> topic)
throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Constructor for the <CODE>TopicRequestor</CODE> class.
<P>This implementation assumes the session parameter to be non-transacted,
with a delivery mode of either <CODE>AUTO_ACKNOWLEDGE</CODE> or
<CODE>DUPS_OK_ACKNOWLEDGE</CODE>.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>session</CODE> - the <CODE>TopicSession</CODE> the topic belongs to<DD><CODE>topic</CODE> - the topic to perform the request/reply call on<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to create the
<CODE>TopicRequestor</CODE> due to some internal
error.<DD><CODE><A HREF="../../javax/jms/InvalidDestinationException.html">InvalidDestinationException</A></CODE> - if an invalid topic is specified.</DL>
</DD>
</DL>
<!-- ============ 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="request(javax.jms.Message)"><!-- --></A><H3>
request</H3>
<PRE>
public <A HREF="../../javax/jms/Message.html">Message</A> <B>request</B>(<A HREF="../../javax/jms/Message.html">Message</A> message)
throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Sends a request and waits for a reply. The temporary topic is used for
the <CODE>JMSReplyTo</CODE> destination; the first reply is returned,
and any following replies are discarded.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>message</CODE> - the message to send<DT><B>Returns:</B><DD>the reply message<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to complete the
request due to some internal error.</DL>
</DD>
</DL>
<HR>
<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public void <B>close</B>()
throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Closes the <CODE>TopicRequestor</CODE> and its session.
<P>Since a provider may allocate some resources on behalf of a
<CODE>TopicRequestor</CODE> outside the Java virtual machine, clients
should close them when they
are not needed. Relying on garbage collection to eventually reclaim
these resources may not be timely enough.
<P>Note that this method closes the <CODE>TopicSession</CODE> object
passed to the <CODE>TopicRequestor</CODE> constructor.<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to close the
<CODE>TopicRequestor</CODE> due to some internal
error.</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/jms/QueueRequestor.html"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="TopicRequestor.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?