| 
 | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||
See:
          Description
| Interface Summary | |
|---|---|
| BytesMessage | A BytesMessageobject is used to send a message containing a 
 stream of uninterpreted bytes. | 
| Connection | A Connectionobject is a client's active connection to its JMS 
 provider. | 
| ConnectionConsumer | For application servers, Connectionobjects provide a special 
 facility 
 for creating aConnectionConsumer(optional). | 
| ConnectionFactory | A ConnectionFactoryobject encapsulates a set of connection 
 configuration 
 parameters that has been defined by an administrator. | 
| ConnectionMetaData | A ConnectionMetaDataobject provides information describing theConnectionobject. | 
| DeliveryMode | The delivery modes supported by the JMS API are PERSISTENTandNON_PERSISTENT. | 
| Destination | A Destinationobject encapsulates a provider-specific 
 address. | 
| ExceptionListener | If a JMS provider detects a serious problem with a Connectionobject, it informs theConnectionobject'sExceptionListener, if one has been registered. | 
| MapMessage | A MapMessageobject is used to send a set of name-value pairs. | 
| Message | The Messageinterface is the root interface of all JMS 
 messages. | 
| MessageConsumer | A client uses a MessageConsumerobject to receive messages 
 from a destination. | 
| MessageListener | A MessageListenerobject is used to receive asynchronously 
 delivered messages. | 
| MessageProducer | A client uses a MessageProducerobject to send messages to a 
 destination. | 
| ObjectMessage | An ObjectMessageobject is used to send a message that contains
 a serializable object in the Java programming language ("Java object"). | 
| Queue | A Queueobject encapsulates a provider-specific queue name. | 
| QueueBrowser | A client uses a QueueBrowserobject to look at messages on a 
 queue without removing them. | 
| QueueConnection | A QueueConnectionobject is an active connection to a 
 point-to-point JMS provider. | 
| QueueConnectionFactory | A client uses a QueueConnectionFactoryobject to createQueueConnectionobjects with a point-to-point JMS provider. | 
| QueueReceiver | A client uses a QueueReceiverobject to receive messages that 
 have been delivered to a queue. | 
| QueueSender | A client uses a QueueSenderobject to send messages to a queue. | 
| QueueSession | A QueueSessionobject provides methods for creatingQueueReceiver,QueueSender,QueueBrowser, andTemporaryQueueobjects. | 
| ServerSession | A ServerSessionobject is an application server object that 
 is used by a server to associate a thread with a JMS session (optional). | 
| ServerSessionPool | A ServerSessionPoolobject is an object implemented by an 
 application server to provide a pool ofServerSessionobjects 
 for processing the messages of aConnectionConsumer(optional). | 
| Session | A Sessionobject is a single-threaded context for producing and consuming 
 messages. | 
| StreamMessage | A StreamMessageobject is used to send a stream of primitive
 types in the Java programming language. | 
| TemporaryQueue | A TemporaryQueueobject is a uniqueQueueobject 
 created for the duration of aConnection. | 
| TemporaryTopic | A TemporaryTopicobject is a uniqueTopicobject 
 created for the duration of aConnection. | 
| TextMessage | A TextMessageobject is used to send a message containing ajava.lang.String. | 
| Topic | A Topicobject encapsulates a provider-specific topic name. | 
| TopicConnection | A TopicConnectionobject is an active connection to a 
 publish/subscribe JMS provider. | 
| TopicConnectionFactory | A client uses a TopicConnectionFactoryobject to createTopicConnectionobjects with a publish/subscribe JMS provider. | 
| TopicPublisher | A client uses a TopicPublisherobject to publish messages on a 
 topic. | 
| TopicSession | A TopicSessionobject provides methods for creatingTopicPublisher,TopicSubscriber, andTemporaryTopicobjects. | 
| TopicSubscriber | A client uses a TopicSubscriberobject to receive messages that
 have been published to a topic. | 
| XAConnection | The XAConnectioninterface extends the capability ofConnectionby providing anXASession(optional). | 
| XAConnectionFactory | The XAConnectionFactoryinterface is a base interface for theXAQueueConnectionFactoryandXATopicConnectionFactoryinterfaces. | 
| XAQueueConnection | An XAQueueConnectionprovides the same create options asQueueConnection(optional). | 
| XAQueueConnectionFactory | An XAQueueConnectionFactoryprovides the same create options as
 aQueueConnectionFactory(optional). | 
| XAQueueSession | An XAQueueSessionprovides a regularQueueSession,
 which can be used to
 createQueueReceiver,QueueSender, andQueueBrowserobjects (optional). | 
| XASession | The XASessioninterface extends the capability ofSessionby adding access to a JMS provider's support for the
 Java Transaction API (JTA) (optional). | 
| XATopicConnection | An XATopicConnectionprovides the same create options asTopicConnection(optional). | 
| XATopicConnectionFactory | An XATopicConnectionFactoryprovides the same create options as 
 aTopicConnectionFactory(optional). | 
| XATopicSession | An XATopicSessionprovides a regularTopicSession. | 
| Class Summary | |
|---|---|
| QueueRequestor | The QueueRequestorhelper class simplifies
 making service requests. | 
| TopicRequestor | The TopicRequestorhelper class simplifies
 making service requests. | 
| Exception Summary | |
|---|---|
| IllegalStateException | This exception is thrown when a method is invoked at an illegal or inappropriate time or if the provider is not in an appropriate state for the requested operation. | 
| InvalidClientIDException | This exception must be thrown when a client attempts to set a connection's client ID to a value that is rejected by a provider. | 
| InvalidDestinationException | This exception must be thrown when a destination either is not understood by a provider or is no longer valid. | 
| InvalidSelectorException | This exception must be thrown when a JMS client attempts to give a provider a message selector with invalid syntax. | 
| JMSException | This is the root class of all JMS API exceptions. | 
| JMSSecurityException | This exception must be thrown when a provider rejects a user name/password submitted by a client. | 
| MessageEOFException | This exception must be thrown when an unexpected 
     end of stream has been reached when a StreamMessageorBytesMessageis being read. | 
| MessageFormatException | This exception must be thrown when a JMS client attempts to use a data type not supported by a message or attempts to read data in a message as the wrong type. | 
| MessageNotReadableException | This exception must be thrown when a JMS client attempts to read a write-only message. | 
| MessageNotWriteableException | This exception must be thrown when a JMS client attempts to write to a read-only message. | 
| ResourceAllocationException | This exception is thrown when a provider is unable to allocate the resources required by a method. | 
| TransactionInProgressException | This exception is thrown when an operation is invalid because a transaction is in progress. | 
| TransactionRolledBackException | This exception must be thrown when a 
     call to Session.commitresults in a rollback of the current 
     transaction. | 
The Java Message Service (JMS) API provides a common way for Java programs to create, send, receive and read an enterprise messaging system's messages.
A JMS application is composed of the following parts:
JMS providers differ significantly in their implementations of underlying messaging technology. There are also major differences in how a JMS provider's system is installed and administered.
For JMS clients to be portable, they must be isolated from these proprietary aspects of a provider. This is done by defining JMS administered objects that are created and customized by a provider's administrator and later used by clients. The client uses them through JMS interfaces that are portable. The administrator creates them using provider-specific facilities.
There are two types of JMS administered objects:
Administered objects are placed in a Java Naming and Directory InterfaceTM (JNDI) namespace by an administrator. A JMS client typically notes in its documentation the JMS administered objects it requires and how the JNDI names of these objects should be provided to it.
The JMS specification defines two styles of messaging: the point-to-point (PTP) or the publish-and-subscribe (Pub/Sub). These styles can be combined in a single application, or a given application can use just one of these styles.
The JMS API defines these two styles because they represent two of the dominant approaches to messaging currently in use. While the domains have many similarities, they also have some differences. JMS provides a unified programming interface to allow the client programmer to easily send and receive message using either domain, but the client programmer must also be aware of the differences between the domains. The key differences relate to how message persistence is handled, and the meaning of certain message attributes.
In earlier versions of JMS, there were separate class hierarchies for the pub/sub and point-to-point programming models that had to be used. These class hierarchies are retained to support backward compatibility with earlier versions of the JMS API, but client developers are encouraged to use the common interfaces.
| JMS Common | PTP Domain | Pub/Sub Domain | 
|---|---|---|
| ConnectionFactory | QueueConnectionFactory | TopicConnectionFactory | 
| Connection | QueueConnection | TopicConnection | 
| Destination | Queue | Topic | 
| Session | QueueSession | TopicSession | 
| MessageProducer | QueueSender | TopicPublisher | 
| MessageConsumer | QueueReceiver | TopicSubscriber | 
The following provides a brief definition of these JMS concepts. See the PTP and Pub/Sub chapters of the JMS specification for more information.
The term consume is used in this document to mean the receipt of a message by a JMS client; that is, a JMS provider has received a message and has given it to its client. Since the JMS API supports both synchronous and asynchronous receipt of messages, the term consume is used when there is no need to make a distinction between them.
The term produce is used as the most general term for sending a message. It means giving a message to a JMS provider for delivery to a destination.
Broadly speaking, a JMS application is one or more JMS clients that exchange messages. The application may also involve non-JMS clients; however, these clients use the JMS provider's native API in place of the JMS API.
A JMS application can be architected and deployed as a unit. In many cases, JMS clients are added incrementally to an existing application.
The message definitions used by an application may originate with JMS, or they may have been defined by the non-JMS part of the application.
A typical JMS client executes the following setup procedure:
At this point a client has the basic setup needed to produce and consume messages.
Java Message Service Specification - Version 1.1
Java Message Service Tutorial
| 
 | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||
Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.
Generated on 10-February-2011 12:41