View Javadoc

1   /**
2    * Copyright 2005-2006 the original author or authors.
3    *
4    * Licensed under the Gnu General Pubic License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with
6    * the License. You may obtain a copy of the License at
7    *
8    *      http://www.opensource.org/licenses/gpl-license.php
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13   * See the Gnu General Public License for more details.
14   */
15  package org.figure8.join.core.messaging;
16  
17  import org.figure8.join.core.InfrastructureException;
18  import org.figure8.join.core.InvalidParameterException;
19  import org.figure8.join.core.setup.ApplicationConfig;
20  
21  import javax.jms.Queue;
22  import javax.jms.Topic;
23  /**
24   * This is an interface allowing abstraction of the mechanism to implement
25   * for retrieving JMS destinations. Implementation may need the application
26   * configuration handler object that shall be set to resolver befaore any destination
27   * acquisition.
28   *
29   * @see org.figure8.join.core.setup.ApplicationConfig
30   *
31   * @author <a href="mailto:laurent.broudoux@free.fr">Laurent Broudoux</a>
32   * @version $Revision: 1.1 $
33   */
34  public interface JMSDestinationResolver{
35  
36     // Public -------------------------------------------------------------------
37  
38     /**
39      * Set the current application conifguration to this resolver
40      * @param configuration The application configured settings
41      */
42     public void setApplicationConfig(ApplicationConfig configuration);
43  
44     /**
45      * Resolve a JMS queue using its name. Resolution means name resolution
46      * and application of mechanism necessary to acquire the queue (may be a
47      * remote queue)
48      * @param name The name of the queue to retrieve
49      * @throws InfrastructureException if acquisition context (Jndi for example) is not available
50      * @throws InvalidParameterException if the specified destination name is unknown by resolution system
51      * @return The acquired queue
52      */
53     public Queue resolveQueue(String name) throws InfrastructureException, InvalidParameterException;
54  
55     /**
56      * Resolve a JMS topic using its name. Resolution means name resolution
57      * and application of mechanism necessary to acquire the topic (may be a
58      * remote topic)
59      * @param name The name of the topic to retrieve
60      * @throws InfrastructureException if acquisition context (Jndi for example) is not available
61      * @throws InvalidParameterException if the specified destination name is unknown by resolution system
62      * @return The acquired topic
63      */
64     public Topic resolveTopic(String name) throws InfrastructureException, InvalidParameterException;
65  }