KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > jms > JMSConnection


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.components.jms;
17
18 import javax.jms.JMSException JavaDoc;
19 import javax.jms.MessageListener JavaDoc;
20 import javax.jms.TopicPublisher JavaDoc;
21 import javax.jms.TopicSession JavaDoc;
22 import javax.naming.NamingException JavaDoc;
23
24 import org.apache.avalon.framework.CascadingException;
25
26 /**
27  * JMSConnection properties container plus utilities.
28  *
29  * @version CVS $Id: JMSConnection.java 36345 2004-08-13 13:27:29Z unico $
30  * @author <a HREF="mailto:haul@apache.org">haul</a>
31  * @deprecated use {@link org.apache.cocoon.components.jms.JMSConnectionManager} instead
32  */

33 public interface JMSConnection {
34     
35     static final String JavaDoc ROLE = JMSConnection.class.getName();
36     
37     /**
38      * Register a new TopicListener for this connection.
39      *
40      * @param listener
41      * @param selector
42      *
43      * @throws CascadingException if the connection was not successfully
44      * initialized, JMSException or NamingException if errors occur during
45      * JMS methods. It is up to the MessageListener to determine how to
46      * handle this failure.
47      */

48     void registerListener(MessageListener JavaDoc listener, String JavaDoc selector)
49         throws CascadingException, JMSException JavaDoc, NamingException JavaDoc;
50         
51     /**
52      * Get a new TopicPublisher for this connection.
53      *
54      * @return new TopicPublisher
55      * @throws JMSException
56      * @throws NamingException
57      */

58     TopicPublisher JavaDoc getPublisher() throws JMSException JavaDoc, NamingException JavaDoc;
59
60     /**
61      * Get the session associated with this connection. This is needed for example to
62      * create messages.
63      *
64      * @return TopicSession
65      * @throws NamingException
66      * @throws JMSException
67      */

68     TopicSession JavaDoc getSession() throws NamingException JavaDoc, JMSException JavaDoc;
69 }
Popular Tags