01: /*
02: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
03: *
04: * This file is part of Resin(R) Open Source
05: *
06: * Each copy or derived work must preserve the copyright notice and this
07: * notice unmodified.
08: *
09: * Resin Open Source is free software; you can redistribute it and/or modify
10: * it under the terms of the GNU General Public License as published by
11: * the Free Software Foundation; either version 2 of the License, or
12: * (at your option) any later version.
13: *
14: * Resin Open Source is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17: * of NON-INFRINGEMENT. See the GNU General Public License for more
18: * details.
19: *
20: * You should have received a copy of the GNU General Public License
21: * along with Resin Open Source; if not, write to the
22: *
23: * Free Software Foundation, Inc.
24: * 59 Temple Place, Suite 330
25: * Boston, MA 02111-1307 USA
26: *
27: * @author Scott Ferguson
28: */
29:
30: package com.caucho.jms.connection;
31:
32: import javax.jms.*;
33: import javax.jms.IllegalStateException;
34:
35: /**
36: * A sample queue connection factory.
37: */
38: public class TopicConnectionImpl extends ConnectionImpl implements
39: XATopicConnection {
40: /**
41: * Create a new topic connection.
42: */
43: public TopicConnectionImpl(ConnectionFactoryImpl factory,
44: boolean isXA) {
45: super (factory, isXA);
46: }
47:
48: /**
49: * Create a new topic connection.
50: */
51: public TopicConnectionImpl(ConnectionFactoryImpl factory) {
52: super (factory);
53: }
54:
55: /**
56: * Creates a new consumer (optional)
57: */
58: public ConnectionConsumer createConnectionConsumer(Topic topic,
59: String messageSelector, ServerSessionPool sessionPool,
60: int maxMessages) throws JMSException {
61: throw new UnsupportedOperationException();
62: }
63:
64: /**
65: * Creates a new consumer (optional)
66: */
67: public ConnectionConsumer createDurableConnectionConsumer(
68: Topic topic, String name, String messageSelector,
69: ServerSessionPool sessionPool, int maxMessages)
70: throws JMSException {
71: throw new UnsupportedOperationException();
72: }
73:
74: /**
75: * Creates a new connection session.
76: */
77: public TopicSession createTopicSession(boolean transacted,
78: int acknowledgeMode) throws JMSException {
79: checkOpen();
80:
81: assignClientID();
82:
83: return new TopicSessionImpl(this , transacted, acknowledgeMode,
84: isXA());
85: }
86:
87: /**
88: * Creates a new connection session.
89: */
90: public XATopicSession createXATopicSession() throws JMSException {
91: checkOpen();
92:
93: assignClientID();
94:
95: return new TopicSessionImpl(this , true, 0, true);
96: }
97: }
|