ejb-jar.xml weblogic-ejb-jar.xml
4.6 Examples of JMS Wrapper Functions
■ Section 4.6.1, Example of JMS Wrapper Functions ■ Section 4.6.2, Sending a JMS Message In a Java EE Container ■ Section 4.6.3, Dependency Injection ■ Section 4.6.4, EJB 3.0 Wrapper Without Injection4.6.1 Example of JMS Wrapper Functions
The following files make up a simple stateless EJB session bean that uses the WebLogic JMS wrapper functions to send a transactional message sendXATransactional when an EJB is called. Although this example uses a session bean, the same XML descriptors and bean class with very few changes can be used for a message-driven bean. ■ Section 4.6.1.1, ejb-jar.xml ■ Section 4.6.1.2, weblogic-ejb-jar.xml ■ Section 4.6.1.3, PoolTest.java ■ Section 4.6.1.4, PoolTestHome.java ■ Section 4.6.1.5, PoolTestBean.java4.6.1.1 ejb-jar.xml
This section describes the EJB components. For the JMS wrapper code snippets provided in this section, note that this section declares the resource-ref and resource-env-ref elements for the wrapped JMS connection factory QueueConnectionFactory and referenced JMS destination TESTQUEUE. ejb-jar xmlns=http:java.sun.comxmlnsj2ee xmlns:xsi=http:www.w3.org2001XMLSchema-instance xsi:schemaLocation=http:java.sun.comxmlnsj2ee http:java.sun.comxmlnsj2eeejb-jar_2_1.xsd ?xml version=1.0? ... ejb-jar enterprise-beans session ejb-namePoolTestBeanejb-name homeweblogic.jms.pool.test.PoolTestHomehome remoteweblogic.jms.pool.test.PoolTestremote ejb-classweblogic.jms.pool.test.PoolTestBeanejb-class session-typeStatelesssession-type transaction-typeContainertransaction-type resource-ref res-ref-namejmsQCFres-ref-name res-typejavax.jms.QueueConnectionFactoryres-type res-authContainerres-auth 4-12 Programming JMS for Oracle WebLogic Server res-sharing-scopeShareableres-sharing-scope resource-ref resource-env-ref resource-env-ref-namejmsTESTQUEUEresource-env-ref-name resource-env-ref-typejavax.jms.Queueresource-env-ref-type resource-env-ref session enterprise-beans assembly-descriptor container-transaction method ejb-namePoolTestBeanejb-name method-namemethod-name method trans-attributeRequiredtrans-attribute container-transaction assembly-descriptor ejb-jar4.6.1.2 weblogic-ejb-jar.xml
This section declares matching resource-description queue connection factory and queue destination elements that tell the Java EE container which JMS connection factory and destination to put in that location. DOCweblogic-ejb-jar xmlns=http:www.bea.comnsweblogic920 xmlns:xsi=http:www.w3.org2001XMLSchema-instance xsi:schemaLocation=http:www.bea.comnsweblogic920 http:www.bea.comnsweblogic920weblogic-ejb-jar.xsd ... weblogic-ejb-jar weblogic-enterprise-bean ejb-namePoolTestBeanejb-name stateless-session-descriptor pool max-beans-in-free-pool8max-beans-in-free-pool initial-beans-in-free-pool2initial-beans-in-free-pool pool stateless-session-descriptor resource-description res-ref-namejmsQCFres-ref-name jndi-nameweblogic.jms.XAConnectionFactoryjndi-name resource-description resource-env-description res-env-ref-namejmsTESTQUEUEres-env-ref-name jndi-nameTESTQUEUEjndi-name resource-env-description jndi-namePoolTestjndi-name weblogic-enterprise-bean weblogic-ejb-jar4.6.1.3 PoolTest.java
Parts
» Oracle Fusion Middleware Online Documentation Library
» Document Scope and Audience Guide to this Document
» Related Documentation New and Changed JMS Features In This Release
» Major Components WebLogic JMS Architecture
» Point-to-Point Messaging PublishSubscribe Messaging
» Using the Default Connection Factories
» Connection Understanding the JMS API
» WebLogic JMS Session Guidelines Session Subclasses Non-Transacted Session
» MessageProducer and MessageConsumer Understanding the JMS API
» Message Header Fields Message
» Message Property Fields Message
» ServerSessionPoolFactory ServerSessionPool ServerSession Understanding the JMS API
» ConnectionConsumer Understanding the JMS API
» Message Compression Message Properties and Message Header Fields Message Ordering
» Topics vs. Queues Asynchronous vs. Synchronous Consumers
» Persistent vs. Non-Persistent Messages
» Deferring Acknowledges and Commits Using AUTO_ACK for Non-Durable Subscribers
» Avoid Multi-threading Using the JMSXUserID Property
» Declaring a Wrapped JMS Factory using Deployment Descriptors
» Injecting Resource Dependency into a Class Non-Injected EJB 3.0 Resource Reference Annotations
» Automatically Enlisting Transactions Container-Managed Security
» Connection Testing Java EE Compliance Pooled JMS Connection Objects
» Speeding Up JNDI Lookups by Pooling Session Objects Speeding Up Object Creation Through Caching
» Performance and Tuning Disabling Wrapping and Pooling Simplified Access to Foreign JMS Providers
» ejb-jar.xml weblogic-ejb-jar.xml
» PoolTest.java PoolTestHome.java PoolTestBean.java
» Using compenv Sending a JMS Message In a Java EE Container
» Dependency Injection EJB 3.0 Wrapper Without Injection
» Create a Queue Session Create a Topic Session
» Create QueueSenders and QueueReceivers Create TopicPublishers and TopicSubscribers
» Step 1: Look Up a Connection Factory in JNDI Step 6a: Create the Message Object Message Producers
» Step 6b: Optionally Register an Asynchronous Message Listener
» Step 1 Step 2 Step 3 Step 4 Step 5 Step 6 Step 7
» Send a Message Using Queue Sender
» Send a Message Using TopicPublisher
» Create a Message Object Define a Message Setting Message Producer Attributes
» Asynchronous Message Pipeline Receiving Messages Asynchronously
» Use Prefetch Mode to Create a Synchronous Message Pipeline
» Importing Required Packages Acknowledging Received Messages
» Setting a Redelivery Delay Overriding the Redelivery Delay on a Destination
» Defining a Session Exception Listener Closing a Session
» Preconditions for Deleting Destinations What Happens when a Destination is Deleted
» Defining the Persistent Store Setting the Client ID Policy
» Defining the Client ID Creating a Sharable Subscription Policy
» Creating Subscribers for a Durable Subscription Best Practice: Always Close Failed JMS ClientIDs
» Deleting Durable Subscriptions Modifying Durable Subscriptions
» Setting Message Header Fields
» Setting Message Property Fields
» Browsing Header and Property Fields
» Displaying Message Selectors Indexing Topic Subscriber Message Selectors To Optimize Performance
» WebLogic XML APIs Using a String Representation Using a DOM Representation
» Releasing Object Resources Configuring JMS System Resources Using JMSModuleHelper
» Creating a JMS System Resource Deleting a JMS System Resource
» Configuring JMS Servers and Store-and-Forward Agents Best Practices when Using JMSModuleHelper
» Benefits of Using Multicasting Limitations of Using Multicasting Using WebLogic Server Unicast
» Step 2: Set Up the Message Listener Dynamically Configuring Multicasting Configuration Attributes
» Uniform Distributed Destinations Weighted Distributed Destinations
» Queue Forwarding QueueSenders QueueReceivers
» TopicPublishers TopicSubscribers Using Replicated Distributed Topics
» Maximizing Production Stuck Messages
» Message Processing According to the JMS Specification Message Processing with Unit-of-Order
» Message Delivery with Unit-of-Order
» Joe Orders a Book What Happened to Joes Order
» Unit-of-Order and Distributed Topics Unit-of-Order, Topics, and Message Driven Beans
» Basic UOW Terminology Rules For Processing UOW Messages
» Example UOW Producer Code UOW Exceptions
» Limitations of UOW Message Groups Overview of Transactions
» WebLogic Messaging High Availability Features
» Application Design Limitations When using Replicated Distributed Topics Advanced Topic Features
» What is the Subscription Key Configuring a Shared Subscription
» Managing Durable Subscriptions How Sharing a Durable Subscription Works
» Sample Producer Code Re-usable ConnectionFactory Objects
» Re-usable Destination Objects Reconnected Connection Objects
» Reconnected Session Objects Automatic Failover for JMS Producers
» Special Cases for Reconnected Consumers
» Integer int Long long Character char String
» Closing Connections Helper Functions
Show more