org.figure8.join.core.messaging
Class ActiveMQDestinationResolver

java.lang.Object
  extended by org.figure8.join.core.messaging.ActiveMQDestinationResolver
All Implemented Interfaces:
JMSDestinationResolver

public class ActiveMQDestinationResolver
extends java.lang.Object
implements JMSDestinationResolver

This is an implementation of JMSDestinationResolver for resolving ActiveMQ provider destinations. It uses ActiveMQ Jndi integration to resolve remote destinations.

Version:
$Revision: 1.1 $
Author:
Laurent Broudoux

Field Summary
static java.lang.String AMQ_NAMING_FACTORY
          Value of naming factory for ActiveMQ Jndi implementation
static java.lang.String AMQ_QUEUE_PREFIX
          Name of ActiveMQ properties prefix for queue names
static java.lang.String AMQ_TOPIC_PREFIX
          Name of ActiveMQ properties preix for topic names
protected  ApplicationConfig configuration
          The application configuration to use for acquiring destinations
 
Constructor Summary
ActiveMQDestinationResolver()
          Creates a new instance of ActiveMQDestinationResolver
 
Method Summary
protected  java.lang.Object resolveLocalObject(java.lang.String name)
          Resolve destination as a locally available object through container context.
 javax.jms.Queue resolveQueue(java.lang.String name)
          Resolve a JMS queue using its name.
protected  java.lang.Object resolveRemoteObject(java.lang.String name, boolean isQueue)
          Resolve destination as a remote object bound into a Jndi tree.
 javax.jms.Topic resolveTopic(java.lang.String name)
          Resolve a JMS topic using its name.
 void setApplicationConfig(ApplicationConfig configuration)
          Set the current application conifguration to this resolver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AMQ_NAMING_FACTORY

public static final java.lang.String AMQ_NAMING_FACTORY
Value of naming factory for ActiveMQ Jndi implementation

See Also:
Constant Field Values

AMQ_QUEUE_PREFIX

public static final java.lang.String AMQ_QUEUE_PREFIX
Name of ActiveMQ properties prefix for queue names

See Also:
Constant Field Values

AMQ_TOPIC_PREFIX

public static final java.lang.String AMQ_TOPIC_PREFIX
Name of ActiveMQ properties preix for topic names

See Also:
Constant Field Values

configuration

protected ApplicationConfig configuration
The application configuration to use for acquiring destinations

Constructor Detail

ActiveMQDestinationResolver

public ActiveMQDestinationResolver()
Creates a new instance of ActiveMQDestinationResolver

Method Detail

setApplicationConfig

public void setApplicationConfig(ApplicationConfig configuration)
Set the current application conifguration to this resolver

Specified by:
setApplicationConfig in interface JMSDestinationResolver
Parameters:
configuration - The application configured settings

resolveQueue

public javax.jms.Queue resolveQueue(java.lang.String name)
                             throws InfrastructureException,
                                    InvalidParameterException
Resolve a JMS queue using its name. Resolution means name resolution and application of mechanism necessary to acquire the queue (may be a remote queue)

Specified by:
resolveQueue in interface JMSDestinationResolver
Parameters:
name - The name of the queue to retrive
Returns:
The acquired queue
Throws:
InfrastructureException - if acquisition context (Jndi for example) is not available
InvalidParameterException - if the specified destination name is unknown by resolution system

resolveTopic

public javax.jms.Topic resolveTopic(java.lang.String name)
                             throws InfrastructureException,
                                    InvalidParameterException
Resolve a JMS topic using its name. Resolution means name resolution and application of mechanism necessary to acquire the topic (may be a remote topic)

Specified by:
resolveTopic in interface JMSDestinationResolver
Parameters:
name - The name of the topic to retrieve
Returns:
The acquired topic
Throws:
InfrastructureException - if acquisition context (Jndi for example) is not available
InvalidParameterException - if the specified destination name is unknown by resolution system

resolveLocalObject

protected java.lang.Object resolveLocalObject(java.lang.String name)
                                       throws InfrastructureException,
                                              InvalidParameterException
Resolve destination as a locally available object through container context.

Parameters:
name - The name of destination to lookup
Returns:
The resolved local object
Throws:
InfrastructureException
InvalidParameterException

resolveRemoteObject

protected java.lang.Object resolveRemoteObject(java.lang.String name,
                                               boolean isQueue)
                                        throws InfrastructureException,
                                               InvalidParameterException
Resolve destination as a remote object bound into a Jndi tree.

Parameters:
name - The jndi name of destination to lookup
isQueue - Flag telling telling whether destination is a queue or a topic
Returns:
The resolved remote object
Throws:
InfrastructureException
InvalidParameterException


Copyright © 2005-2008 Join. All Rights Reserved.