org.exolab.jmscts.core
Class DestinationHelper

java.lang.Object
  |
  +--org.exolab.jmscts.core.DestinationHelper

public final class DestinationHelper
extends java.lang.Object

Helper for creating, destroying and comparing Destination objects

Version:
$Revision: 1.3 $ $Date: 2004/01/31 13:44:24 $
Author:
Tim Anderson

Method Summary
static javax.jms.Destination create(javax.jms.Session session)
          Create a temporary destination
static javax.jms.Destination create(java.lang.String name, boolean queue, Administrator admin)
          Create an administered destination for the supplied name.
static javax.jms.Destination create(TestContext context, java.lang.String name)
          Create a destination for the supplied name, using a test context If the context specifies a messaging behaviour, then that will used to determine if an administered or temporary destination will be created, otherwise an administered destination will be created.
static void destroy(javax.jms.Destination destination, Administrator admin)
          Destroy a destination
static void destroy(java.lang.String name, Administrator admin)
          Destroy the named destination, if it exists
static void destroy(TestContext context, javax.jms.Destination destination)
          Destroy a destination if it exists, using a test context
static boolean equal(javax.jms.Destination a, javax.jms.Destination b)
          Compares two destinations for equality
static java.lang.String getName(javax.jms.Destination destination)
          Returns the name of a destination
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static javax.jms.Destination create(TestContext context,
                                           java.lang.String name)
                                    throws javax.jms.JMSException,
                                           javax.naming.NamingException
Create a destination for the supplied name, using a test context If the context specifies a messaging behaviour, then that will used to determine if an administered or temporary destination will be created, otherwise an administered destination will be created.
Parameters:
context - the test context
name - the destination name
Returns:
the new destination
Throws:
javax.jms.JMSException - if the destination cannot be created
javax.naming.NamingException - if the new administered destination cannot be located in JNDI

create

public static javax.jms.Destination create(java.lang.String name,
                                           boolean queue,
                                           Administrator admin)
                                    throws javax.jms.JMSException,
                                           javax.naming.NamingException
Create an administered destination for the supplied name.
Parameters:
name - the name of the destination
queue - true if the destination is a Queue
admin - the JMS provider administration interface
Returns:
the new destination
Throws:
javax.jms.JMSException - if the destination cannot be created
javax.naming.NamingException - if the new administered destination cannot be be located in JNDI

create

public static javax.jms.Destination create(javax.jms.Session session)
                                    throws javax.jms.JMSException
Create a temporary destination
Parameters:
session - the session to create the destination with
Returns:
the new destination
Throws:
javax.jms.JMSException - if the destination cannot be created

destroy

public static void destroy(TestContext context,
                           javax.jms.Destination destination)
                    throws javax.jms.JMSException
Destroy a destination if it exists, using a test context
Parameters:
context - the test context
destination - the destination to destroy
Throws:
javax.jms.JMSException - if the destination cannot be destroyed

destroy

public static void destroy(java.lang.String name,
                           Administrator admin)
                    throws javax.jms.JMSException
Destroy the named destination, if it exists
Parameters:
name - the name of the destination
admin - the provider administration interface to remove the destination with, if the destination exists
Throws:
javax.jms.JMSException - if the destination cannot be destroyed

destroy

public static void destroy(javax.jms.Destination destination,
                           Administrator admin)
                    throws javax.jms.JMSException
Destroy a destination
Parameters:
destination - the destination to destroy
admin - the provider administration interface to remove the destination with, if the destination is administered and exists
Throws:
javax.jms.JMSException - if the destination cannot be destroyed

equal

public static boolean equal(javax.jms.Destination a,
                            javax.jms.Destination b)
                     throws javax.jms.JMSException
Compares two destinations for equality
Parameters:
a - the first destination to compare
b - the second destination to compare
Returns:
true if the destinations are equal
Throws:
javax.jms.JMSException - if the destination names cannot be accessed

getName

public static java.lang.String getName(javax.jms.Destination destination)
                                throws javax.jms.JMSException
Returns the name of a destination
Parameters:
destination - the destination
Returns:
the name of the destination
Throws:
javax.jms.JMSException - if the name cannot be accessed


Copyright © 2001-2004 JMS CTS Team. All Rights Reserved.