BEA Systems, Inc.

WebLogic Server 8.1 API Reference

weblogic.jms.extensions
Class JMSHelper

java.lang.Object
  |
  +--weblogic.jms.extensions.JMSHelper

public final class JMSHelper
extends java.lang.Object

JMS extension methods for dynamically creating permanent queues and topics, and converting between WebLogic JMS 6.0 and pre-6.0 JMSMessageID formats. It is recommended that the use of the create methods be strictly limited, as they directly modify the configuration file and provide minimal feedback for detecting success or failure.

Author:
Copyright © 2002 BEA Systems, Inc. All Rights Reserved.

Constructor Summary
JMSHelper()
           
 
Method Summary
static void createPermanentQueueAsync(javax.naming.Context ctx, java.lang.String jmsServerName, java.lang.String queueName, java.lang.String jndiName)
          Submit an asynchronous request to create a permanent JMS queue.
static void createPermanentTopicAsync(javax.naming.Context ctx, java.lang.String jmsServerName, java.lang.String topicName, java.lang.String jndiName)
          Submit an asynchronous request to create a permanent JMS topic.
static void deletePermanentQueue(javax.naming.Context ctx, java.lang.String jmsServerName, java.lang.String queueName)
          Submit a synchronous request to delete a permanent JMS queue.
static void deletePermanentTopic(javax.naming.Context ctx, java.lang.String jmsServerName, java.lang.String topicName)
          Submit a asynchronous request to delete a permanent JMS topic.
static JMSConnectionRuntimeMBean getJMSConnectionRuntimeMBean(javax.naming.Context ctx, javax.jms.Connection connection)
           
static JMSDestinationRuntimeMBean getJMSDestinationRuntimeMBean(javax.naming.Context ctx, javax.jms.Destination destination)
           
static JMSDestinationRuntimeMBean getJMSDestinationRuntimeMBean(javax.naming.Context ctx, java.lang.String jmsServerName, java.lang.String destinationName)
           
static JMSConsumerRuntimeMBean getJMSMessageConsumerRuntimeMBean(javax.naming.Context ctx, javax.jms.MessageConsumer messageConsumer)
           
static JMSProducerRuntimeMBean getJMSMessageProducerRuntimeMBean(javax.naming.Context ctx, javax.jms.MessageProducer messageProducer)
           
static JMSQueueMBean getJMSQueueConfigMBean(javax.naming.Context ctx, javax.jms.Queue jmsQueue)
           
static JMSQueueMBean getJMSQueueConfigMBean(javax.naming.Context ctx, java.lang.String jmsServerName, java.lang.String queueName)
           
static JMSServerMBean getJMSServerConfigMBean(javax.naming.Context ctx, java.lang.String jmsServerName)
           
static JMSServerRuntimeMBean getJMSServerRuntimeMBean(javax.naming.Context ctx, javax.jms.Destination destination)
           
static JMSServerRuntimeMBean getJMSServerRuntimeMBean(javax.naming.Context ctx, java.lang.String mbeanName)
           
static JMSSessionRuntimeMBean getJMSSessionRuntimeMBean(javax.naming.Context ctx, javax.jms.Session session)
           
static JMSTemplateMBean getJMSTemplateConfigMBean(javax.naming.Context ctx, java.lang.String template)
           
static JMSTopicMBean getJMSTopicConfigMBean(javax.naming.Context ctx, java.lang.String jmsServerName, java.lang.String topicName)
           
static JMSTopicMBean getJMSTopicConfigMBean(javax.naming.Context ctx, javax.jms.Topic jmsTopic)
           
 java.lang.String newJMSMessageIDToOld(java.lang.String messageId)
          Convert WebLogic JMS 6.0 JMSMessageID format to pre-6.0 format.
 java.lang.String oldJMSMessageIDToNew(java.lang.String messageId, long timeStamp)
          Convert WebLogic JMS pre-6.0 JMSMessageID format into 6.0 format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSHelper

public JMSHelper()
Method Detail

createPermanentQueueAsync

public static void createPermanentQueueAsync(javax.naming.Context ctx,
                                             java.lang.String jmsServerName,
                                             java.lang.String queueName,
                                             java.lang.String jndiName)
                                      throws javax.jms.JMSException
Submit an asynchronous request to create a permanent JMS queue. This method updates the following:

Note: The createPermanentQueueAsync() method call can fail without throwing an exception. In addition, a thrown exception does not necessarily indicate that the method call failed.

The time required to create the destination on the JMS server and propagate the information on the JNDI namespace can be significant. The propagation delay increases if the environment contains multiple servers. It is recommended that you test for the existence of the queue using the session createQueue() method, rather than perform a JNDI lookup. By doing so, you can avoid some of the propagation-specific delay.

Parameters:
ctx - JNDI initial context.
jmsServerName - name of the JMS server.
queueName - name of the queue.
jndiName - name used to lookup the destination within the JNDI namespace.
Throws:
javax.jms.JMSException - if a JMS error occurs
See Also:
createPermanentTopicAsync(javax.naming.Context, java.lang.String, java.lang.String, java.lang.String), QueueSession.createQueue(java.lang.String)

createPermanentTopicAsync

public static void createPermanentTopicAsync(javax.naming.Context ctx,
                                             java.lang.String jmsServerName,
                                             java.lang.String topicName,
                                             java.lang.String jndiName)
                                      throws javax.jms.JMSException
Submit an asynchronous request to create a permanent JMS topic. This method is similar to the createPermanentQueueAsync() method, except that it creates topics rather than queues. Once the topic is created, you can test for its existence using the session createTopic() method, rather than perform a JNDI lookup, to avoid some of the propagation-specific delay.

Note: Like the createPermanentQueueAsync() method, the createPermanentTopicAsync() method call can fail without throwing an exception. In addition, a thrown exception does not necessarily indicate that the method call failed.

Parameters:
ctx - JNDI initial context.
jmsServerName - name of the JMS server.
queueName - name of the queue.
jndiName - name used to lookup the destination within the JNDI namespace.
Throws:
javax.jms.JMSException - if a JMS error occurs
See Also:
createPermanentQueueAsync(javax.naming.Context, java.lang.String, java.lang.String, java.lang.String), TopicSession.createTopic(java.lang.String)

deletePermanentQueue

public static void deletePermanentQueue(javax.naming.Context ctx,
                                        java.lang.String jmsServerName,
                                        java.lang.String queueName)
                                 throws weblogic.jms.common.ConfigurationException
Submit a synchronous request to delete a permanent JMS queue. This method updates the following:

A thrown exception does not necessarily indicate that the method call failed.

Parameters:
ctx - JNDI initial context.
jmsServerName - name of the JMS server.
queueName - name of the queue.
Throws:
javax.jms.JMSException - if a JMS error occurs
See Also:
weblogic.jms.extensions.JMSHelper#deletePermanentTopicAsync

deletePermanentTopic

public static void deletePermanentTopic(javax.naming.Context ctx,
                                        java.lang.String jmsServerName,
                                        java.lang.String topicName)
                                 throws weblogic.jms.common.ConfigurationException
Submit a asynchronous request to delete a permanent JMS topic. This method is similar to the deletePermanentQueue() method, except that it deletes topics rather than queues.

A thrown exception does not necessarily indicate that the method call failed.

Parameters:
ctx - JNDI initial context.
jmsServerName - name of the JMS server.
queueName - name of the queue.
Throws:
javax.jms.JMSException - if a JMS error occurs
See Also:
weblogic.jms.extensions.JMSHelper#deletePermanentQueueAsync, TopicSession.createTopic(java.lang.String)

getJMSTemplateConfigMBean

public static JMSTemplateMBean getJMSTemplateConfigMBean(javax.naming.Context ctx,
                                                         java.lang.String template)
                                                  throws javax.jms.JMSException

getJMSTopicConfigMBean

public static JMSTopicMBean getJMSTopicConfigMBean(javax.naming.Context ctx,
                                                   javax.jms.Topic jmsTopic)
                                            throws javax.jms.JMSException

getJMSTopicConfigMBean

public static JMSTopicMBean getJMSTopicConfigMBean(javax.naming.Context ctx,
                                                   java.lang.String jmsServerName,
                                                   java.lang.String topicName)
                                            throws javax.jms.JMSException

getJMSQueueConfigMBean

public static JMSQueueMBean getJMSQueueConfigMBean(javax.naming.Context ctx,
                                                   javax.jms.Queue jmsQueue)
                                            throws javax.jms.JMSException

getJMSQueueConfigMBean

public static JMSQueueMBean getJMSQueueConfigMBean(javax.naming.Context ctx,
                                                   java.lang.String jmsServerName,
                                                   java.lang.String queueName)
                                            throws javax.jms.JMSException

getJMSServerConfigMBean

public static JMSServerMBean getJMSServerConfigMBean(javax.naming.Context ctx,
                                                     java.lang.String jmsServerName)
                                              throws javax.jms.JMSException

getJMSConnectionRuntimeMBean

public static JMSConnectionRuntimeMBean getJMSConnectionRuntimeMBean(javax.naming.Context ctx,
                                                                     javax.jms.Connection connection)
                                                              throws javax.jms.JMSException

getJMSMessageProducerRuntimeMBean

public static JMSProducerRuntimeMBean getJMSMessageProducerRuntimeMBean(javax.naming.Context ctx,
                                                                        javax.jms.MessageProducer messageProducer)
                                                                 throws javax.jms.JMSException

getJMSMessageConsumerRuntimeMBean

public static JMSConsumerRuntimeMBean getJMSMessageConsumerRuntimeMBean(javax.naming.Context ctx,
                                                                        javax.jms.MessageConsumer messageConsumer)
                                                                 throws javax.jms.JMSException

getJMSSessionRuntimeMBean

public static JMSSessionRuntimeMBean getJMSSessionRuntimeMBean(javax.naming.Context ctx,
                                                               javax.jms.Session session)
                                                        throws javax.jms.JMSException

getJMSServerRuntimeMBean

public static JMSServerRuntimeMBean getJMSServerRuntimeMBean(javax.naming.Context ctx,
                                                             javax.jms.Destination destination)
                                                      throws javax.jms.JMSException

getJMSDestinationRuntimeMBean

public static JMSDestinationRuntimeMBean getJMSDestinationRuntimeMBean(javax.naming.Context ctx,
                                                                       java.lang.String jmsServerName,
                                                                       java.lang.String destinationName)
                                                                throws javax.jms.JMSException

getJMSDestinationRuntimeMBean

public static JMSDestinationRuntimeMBean getJMSDestinationRuntimeMBean(javax.naming.Context ctx,
                                                                       javax.jms.Destination destination)
                                                                throws javax.jms.JMSException

getJMSServerRuntimeMBean

public static JMSServerRuntimeMBean getJMSServerRuntimeMBean(javax.naming.Context ctx,
                                                             java.lang.String mbeanName)
                                                      throws javax.jms.JMSException

oldJMSMessageIDToNew

public java.lang.String oldJMSMessageIDToNew(java.lang.String messageId,
                                             long timeStamp)
                                      throws javax.jms.JMSException
Convert WebLogic JMS pre-6.0 JMSMessageID format into 6.0 format.

Parameters:
messageId - old JMSMessageID.
timestamp - timestamp of message.
Throws:
javax.jms.JMSException - if a JMS error occurs
See Also:
newJMSMessageIDToOld(java.lang.String)

newJMSMessageIDToOld

public java.lang.String newJMSMessageIDToOld(java.lang.String messageId)
                                      throws javax.jms.JMSException
Convert WebLogic JMS 6.0 JMSMessageID format to pre-6.0 format.

Parameters:
messageId - old JMSMessageID.
Throws:
javax.jms.JMSException - if a JMS error occurs
See Also:
oldJMSMessageIDToNew(java.lang.String, long)

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs81b