|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.jms Interface QueueConnection
- All Superinterfaces:
- Connection
- All Known Subinterfaces:
- XAQueueConnection
public interface QueueConnection
- extends Connection
QueueConnection
对象是到点对点
JMS 提供者的活动连接。客户端使用 QueueConnection
对象创建一个或多个生产和使用消息的 QueueSession
对象。
QueueConnection
可用于创建
QueueSession
,可以从 QueueSession
中创建专门的与队列有关的对象。
一种更常用且建议采用的方法是使用
Connection
对象。
QueueConnection
对象
应用于支持已使用该对象的现有代码。
QueueConnection
无法用于创建
特定于发布/订阅域的对象。
createDurableConnectionConsumer
方法继承自
Connection
,但如果在 QueueConnection
中
使用,则必须抛出 IllegalStateException
。
version |
| |
See also | javax.jms.Connection, javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory |
A QueueConnection
object is an active connection to a
point-to-point JMS provider. A client uses a QueueConnection
object to create one or more QueueSession
objects
for producing and consuming messages.
A QueueConnection
can be used to create a
QueueSession
, from which specialized queue-related objects
can be created.
A more general, and recommended, approach is to use the
Connection
object.
The QueueConnection
object
should be used to support existing code that has already used it.
A QueueConnection
cannot be used to create objects
specific to the publish/subscribe domain. The
createDurableConnectionConsumer
method inherits
from Connection
, but must throw an
IllegalStateException
if used from QueueConnection
.
- Version:
- 1.1 - April 9, 2002
- Author:
- Mark Hapner, Rich Burridge, Kate Stout
- See Also:
Connection
,ConnectionFactory
,QueueConnectionFactory
Method Summary | |
---|---|
ConnectionConsumer |
createConnectionConsumer(Queue queue,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
Creates a connection consumer for this connection (optional operation). |
QueueSession |
createQueueSession(boolean transacted,
int acknowledgeMode)
Creates a QueueSession object. |
Methods inherited from interface javax.jms.Connection |
---|
close, createConnectionConsumer, createDurableConnectionConsumer, createSession, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop |
Method Detail |
---|
public QueueSession
createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException
创建 QueueSession
对象。
transacted | 指示会话是否是事务性的 |
acknowledgeMode |
指示使用方或
客户端是否将确认收到的任何消息;如果
会话是事务性的,则忽略此参数。合法值是 Session.AUTO_ACKNOWLEDGE 、
Session.CLIENT_ACKNOWLEDGE 和
Session.DUPS_OK_ACKNOWLEDGE 。 |
return | 新建的队列会话 |
Throws | JMSException:
如果 QueueConnection 对象
由于某个内部错误或
缺少对特定事务
和确认模式的支持无法创建会话。 |
See also | AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE |
createQueueSession
QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException
- Creates a
QueueSession
object. - Parameters:
transacted
- indicates whether the session is transactedacknowledgeMode
- indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values areSession.AUTO_ACKNOWLEDGE
,Session.CLIENT_ACKNOWLEDGE
, andSession.DUPS_OK_ACKNOWLEDGE
.- Returns:
- a newly created queue session
- Throws:
JMSException
- if theQueueConnection
object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.- See Also:
Session.AUTO_ACKNOWLEDGE
,Session.CLIENT_ACKNOWLEDGE
,Session.DUPS_OK_ACKNOWLEDGE
public ConnectionConsumer
createConnectionConsumer(Queue queue, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
创建此连接的连接使用方(可选操作)。
这是一个专家级工具,常规 JMS 客户端不使用。
queue | 要访问的队列 |
messageSelector | 仅传送属性 与消息选择器表达式相匹配的消息。值为 null 或 空字符串表示该消息使用方没有消息选择器 。 |
sessionPool | 与此连接使用方关联的服务器会话池 |
maxMessages | 可以一次分配给服务器会话的最大消息数 |
return | 连接使用方 |
Throws | JMSException:
如果 QueueConnection 对象
由于某个内部错误
或
sessionPool 和
messageSelector 的无效参数无法创建连接使用方。 |
Throws | InvalidDestinationException: 如果指定了无效的队列。 |
Throws | InvalidSelectorException: 如果消息选择器无效。 |
See also | javax.jms.ConnectionConsumer |
createConnectionConsumer
ConnectionConsumer createConnectionConsumer(Queue queue, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
- Creates a connection consumer for this connection (optional operation).
This is an expert facility not used by regular JMS clients.
- Parameters:
queue
- the queue to accessmessageSelector
- 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.sessionPool
- the server session pool to associate with this connection consumermaxMessages
- the maximum number of messages that can be assigned to a server session at one time- Returns:
- the connection consumer
- Throws:
JMSException
- if theQueueConnection
object fails to create a connection consumer due to some internal error or invalid arguments forsessionPool
andmessageSelector
.InvalidDestinationException
- if an invalid queue is specified.InvalidSelectorException
- if the message selector is invalid.- See Also:
ConnectionConsumer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!