View Javadoc

1   /*
2    * $Id: JmsSupport.java 7976 2007-08-21 14:26:13Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.providers.jms;
12  
13  import javax.jms.Connection;
14  import javax.jms.ConnectionFactory;
15  import javax.jms.Destination;
16  import javax.jms.JMSException;
17  import javax.jms.Message;
18  import javax.jms.MessageConsumer;
19  import javax.jms.MessageProducer;
20  import javax.jms.Session;
21  
22  /**
23   * <code>JmsSupport</code> is an interface that provides a polymorphic facade to
24   * the JMS 1.0.2b and 1.1 API specifications. this interface is not intended for
25   * general purpose use and should only be used with the Mule JMS connector.
26   */
27  
28  public interface JmsSupport
29  {
30      Connection createConnection(ConnectionFactory connectionFactory) throws JMSException;
31  
32      Connection createConnection(ConnectionFactory connectionFactory, String username, String password)
33          throws JMSException;
34  
35      Session createSession(Connection connection,
36                            boolean topic,
37                            boolean transacted,
38                            int ackMode,
39                            boolean noLocal) throws JMSException;
40  
41      MessageProducer createProducer(Session session, Destination destination, boolean topic)
42          throws JMSException;
43  
44      MessageConsumer createConsumer(Session session,
45                                     Destination destination,
46                                     String messageSelector,
47                                     boolean noLocal,
48                                     String durableName,
49                                     boolean topic) throws JMSException;
50  
51      MessageConsumer createConsumer(Session session, Destination destination, boolean topic)
52          throws JMSException;
53  
54      Destination createDestination(Session session, String name, boolean topic) throws JMSException;
55  
56      Destination createTemporaryDestination(Session session, boolean topic) throws JMSException;
57  
58      void send(MessageProducer producer, Message message, boolean topic) throws JMSException;
59  
60      void send(MessageProducer producer,
61                Message message,
62                boolean persistent,
63                int priority,
64                long ttl,
65                boolean topic) throws JMSException;
66  
67      void send(MessageProducer producer, Message message, Destination dest, boolean topic) throws JMSException;
68  
69      void send(MessageProducer producer,
70                Message message,
71                Destination dest,
72                boolean persistent,
73                int priority,
74                long ttl,
75                boolean topic) throws JMSException;
76  }