|
| 1 | +// Derived from the Eclipse Project for JMS, available at; |
| 2 | +// https://github.com/eclipse-ee4j/jms-api |
| 3 | +// |
| 4 | +// This program and the accompanying materials are made available under the |
| 5 | +// terms of the Eclipse Public License 2.0, which is available at |
| 6 | +// http://www.eclipse.org/legal/epl-2.0. |
| 7 | +// |
| 8 | +// SPDX-License-Identifier: EPL-2.0 |
| 9 | + |
| 10 | +// |
| 11 | +package jms20subset |
| 12 | + |
| 13 | +// JMSContext represents a connection to the messaging provider, and |
| 14 | +// provides the capability for applications to create Producer and Consumer |
| 15 | +// objects so that it can send and receive messages. |
| 16 | +type JMSContext interface { |
| 17 | + |
| 18 | + // CreateProducer creates a new producer object that can be used to configure |
| 19 | + // and send messages. |
| 20 | + // |
| 21 | + // Note that the Destination object is always supplied when making the |
| 22 | + // individual producer.Send calls, and not as part of creating the producer |
| 23 | + // itself. |
| 24 | + CreateProducer() JMSProducer |
| 25 | + |
| 26 | + // CreateConsumer creates a consumer for the specified Destination so that |
| 27 | + // an application can receive messages from that Destination. |
| 28 | + CreateConsumer(dest Destination) (JMSConsumer, JMSException) |
| 29 | + |
| 30 | + // CreateConsumer creates a consumer for the specified Destination using a |
| 31 | + // message selector, so that an application can receive messages from a |
| 32 | + // Destination that match the selector criteria. |
| 33 | + // |
| 34 | + // Note that since Golang does not allow multiple functions with the same |
| 35 | + // name and different parameters we must use a different function name. |
| 36 | + CreateConsumerWithSelector(dest Destination, selector string) (JMSConsumer, JMSException) |
| 37 | + |
| 38 | + // CreateQueue creates a queue object which encapsulates a provider specific |
| 39 | + // queue name. |
| 40 | + // |
| 41 | + // Note that this method does not create the physical queue in the JMS |
| 42 | + // provider. Creating a physical queue is typically an administrative task |
| 43 | + // performed by an administrator using provider-specific tooling. |
| 44 | + CreateQueue(queueName string) Queue |
| 45 | + |
| 46 | + // CreateTextMessage creates a message object that is used to send a string |
| 47 | + // from one application to another. |
| 48 | + CreateTextMessage() TextMessage |
| 49 | + |
| 50 | + // CreateTextMessageWithString creates an initialized text message object |
| 51 | + // containing the string that needs to be sent. |
| 52 | + // |
| 53 | + // Note that since Golang does not allow multiple functions with the same |
| 54 | + // name and different parameters we must use a different function name. |
| 55 | + CreateTextMessageWithString(txt string) TextMessage |
| 56 | + |
| 57 | + // Closes the connection to the messaging provider. |
| 58 | + // |
| 59 | + // Since the provider typically allocates significant resources on behalf of |
| 60 | + // a connection applications should close these resources when they are not |
| 61 | + // needed. |
| 62 | + Close() |
| 63 | +} |
0 commit comments