📄 topicsession.html
字号:
The default value for this attribute is false.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javax/jms/Session.html#createDurableSubscriber(javax.jms.Topic, java.lang.String)">createDurableSubscriber</A></CODE> in interface <CODE><A HREF="../../javax/jms/Session.html" title="interface in javax.jms">Session</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>topic</CODE> - the non-temporary <CODE>Topic</CODE> to subscribe to<DD><CODE>name</CODE> - the name used to identify this subscription<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the session fails to create a subscriber due to some internal error.<DD><CODE><A HREF="../../javax/jms/InvalidDestinationException.html" title="class in javax.jms">InvalidDestinationException</A></CODE> - if an invalid topic is specified.</DL></DD></DL><HR><A NAME="createDurableSubscriber(javax.jms.Topic, java.lang.String, java.lang.String, boolean)"><!-- --></A><H3>createDurableSubscriber</H3><PRE>public <A HREF="../../javax/jms/TopicSubscriber.html" title="interface in javax.jms">TopicSubscriber</A> <B>createDurableSubscriber</B>(<A HREF="../../javax/jms/Topic.html" title="interface in javax.jms">Topic</A> topic, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> messageSelector, boolean noLocal) throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Creates a durable subscriber to the specified topic, using a message selector or specifying whether messages published by its own connection should be delivered to it. <P>If a client needs to receive all the messages published on a topic, including the ones published while the subscriber is inactive, it uses a durable <CODE>TopicSubscriber</CODE>. The JMS provider retains a record of this durable subscription and insures that all messages from the topic's publishers are retained until they are acknowledged by this durable subscriber or they have expired. <P>Sessions with durable subscribers must always provide the same client identifier. In addition, each client must specify a name which uniquely identifies (within client identifier) each durable subscription it creates. Only one session at a time can have a <CODE>TopicSubscriber</CODE> for a particular durable subscription. An inactive durable subscriber is one that exists but does not currently have a message consumer associated with it. <P>A client can change an existing durable subscription by creating a durable <CODE>TopicSubscriber</CODE> with the same name and a new topic and/or message selector. Changing a durable subscriber is equivalent to unsubscribing (deleting) the old one and creating a new one.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javax/jms/Session.html#createDurableSubscriber(javax.jms.Topic, java.lang.String, java.lang.String, boolean)">createDurableSubscriber</A></CODE> in interface <CODE><A HREF="../../javax/jms/Session.html" title="interface in javax.jms">Session</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>topic</CODE> - the non-temporary <CODE>Topic</CODE> to subscribe to<DD><CODE>name</CODE> - the name used to identify this subscription<DD><CODE>messageSelector</CODE> - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.<DD><CODE>noLocal</CODE> - if set, inhibits the delivery of messages published by its own connection<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the session fails to create a subscriber due to some internal error.<DD><CODE><A HREF="../../javax/jms/InvalidDestinationException.html" title="class in javax.jms">InvalidDestinationException</A></CODE> - if an invalid topic is specified.<DD><CODE><A HREF="../../javax/jms/InvalidSelectorException.html" title="class in javax.jms">InvalidSelectorException</A></CODE> - if the message selector is invalid.</DL></DD></DL><HR><A NAME="createPublisher(javax.jms.Topic)"><!-- --></A><H3>createPublisher</H3><PRE>public <A HREF="../../javax/jms/TopicPublisher.html" title="interface in javax.jms">TopicPublisher</A> <B>createPublisher</B>(<A HREF="../../javax/jms/Topic.html" title="interface in javax.jms">Topic</A> topic) throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Creates a publisher for the specified topic. <P>A client uses a <CODE>TopicPublisher</CODE> object to publish messages on a topic. Each time a client creates a <CODE>TopicPublisher</CODE> on a topic, it defines a new sequence of messages that have no ordering relationship with the messages it has previously sent.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>topic</CODE> - the <CODE>Topic</CODE> to publish to, or null if this is an unidentified producer<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the session fails to create a publisher due to some internal error.<DD><CODE><A HREF="../../javax/jms/InvalidDestinationException.html" title="class in javax.jms">InvalidDestinationException</A></CODE> - if an invalid topic is specified.</DL></DD></DL><HR><A NAME="createTemporaryTopic()"><!-- --></A><H3>createTemporaryTopic</H3><PRE>public <A HREF="../../javax/jms/TemporaryTopic.html" title="interface in javax.jms">TemporaryTopic</A> <B>createTemporaryTopic</B>() throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Creates a <CODE>TemporaryTopic</CODE> object. Its lifetime will be that of the <CODE>TopicConnection</CODE> unless it is deleted earlier.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javax/jms/Session.html#createTemporaryTopic()">createTemporaryTopic</A></CODE> in interface <CODE><A HREF="../../javax/jms/Session.html" title="interface in javax.jms">Session</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a temporary topic identity<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the session fails to create a temporary topic due to some internal error.</DL></DD></DL><HR><A NAME="unsubscribe(java.lang.String)"><!-- --></A><H3>unsubscribe</H3><PRE>public void <B>unsubscribe</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> name) throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Unsubscribes a durable subscription that has been created by a client. <P>This method deletes the state being maintained on behalf of the subscriber by its provider. <P>It is erroneous for a client to delete a durable subscription while there is an active <CODE>TopicSubscriber</CODE> for the subscription, or while a consumed message is part of a pending transaction or has not been acknowledged in the session.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javax/jms/Session.html#unsubscribe(java.lang.String)">unsubscribe</A></CODE> in interface <CODE><A HREF="../../javax/jms/Session.html" title="interface in javax.jms">Session</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name used to identify this subscription<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the session fails to unsubscribe to the durable subscription due to some internal error.<DD><CODE><A HREF="../../javax/jms/InvalidDestinationException.html" title="class in javax.jms">InvalidDestinationException</A></CODE> - if an invalid subscription name is specified.</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"> <A HREF="../../javax/jms/TopicPublisher.html" title="interface in javax.jms"><B>PREV CLASS</B></A> <A HREF="../../javax/jms/TopicSubscriber.html" title="interface in javax.jms"><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="TopicSession.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 + -