01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.components.jms;
18:
19: import javax.jms.JMSException;
20: import javax.jms.MessageListener;
21: import javax.jms.TopicPublisher;
22: import javax.jms.TopicSession;
23: import javax.naming.NamingException;
24:
25: import org.apache.avalon.framework.CascadingException;
26:
27: /**
28: * JMSConnection properties container plus utilities.
29: *
30: * @version CVS $Id: JMSConnection.java 433543 2006-08-22 06:22:54Z crossley $
31: * @author <a href="mailto:haul@apache.org">haul</a>
32: * @deprecated use {@link org.apache.cocoon.components.jms.JMSConnectionManager} instead
33: */
34: public interface JMSConnection {
35:
36: static final String ROLE = JMSConnection.class.getName();
37:
38: /**
39: * Register a new TopicListener for this connection.
40: *
41: * @param listener
42: * @param selector
43: *
44: * @throws CascadingException if the connection was not successfully
45: * initialized, JMSException or NamingException if errors occur during
46: * JMS methods. It is up to the MessageListener to determine how to
47: * handle this failure.
48: */
49: void registerListener(MessageListener listener, String selector)
50: throws CascadingException, JMSException, NamingException;
51:
52: /**
53: * Get a new TopicPublisher for this connection.
54: *
55: * @return new TopicPublisher
56: * @throws JMSException
57: * @throws NamingException
58: */
59: TopicPublisher getPublisher() throws JMSException, NamingException;
60:
61: /**
62: * Get the session associated with this connection. This is needed for example to
63: * create messages.
64: *
65: * @return TopicSession
66: * @throws NamingException
67: * @throws JMSException
68: */
69: TopicSession getSession() throws NamingException, JMSException;
70: }
|