KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > jms > support > destination > DestinationResolver


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.springframework.jms.support.destination;
18
19 import javax.jms.Destination JavaDoc;
20 import javax.jms.JMSException JavaDoc;
21 import javax.jms.Session JavaDoc;
22
23 /**
24  * Strategy interface for resolving JMS destinations.
25  *
26  * <p>Used by {@link org.springframework.jms.core.JmsTemplate} for resolving
27  * destination names from simple {@link String Strings} to actual
28  * {@link Destination} implementation instances.
29  *
30  * <p>The default {@link DestinationResolver} implementation used by
31  * {@link org.springframework.jms.core.JmsTemplate} instances is the
32  * {@link DynamicDestinationResolver} class. Consider using the
33  * {@link JndiDestinationResolver} for more advanced scenarios.
34  *
35  * @author Juergen Hoeller
36  * @since 1.1
37  * @see org.springframework.jms.core.JmsTemplate#setDestinationResolver
38  * @see org.springframework.jms.support.destination.DynamicDestinationResolver
39  * @see org.springframework.jms.support.destination.JndiDestinationResolver
40  */

41 public interface DestinationResolver {
42
43     /**
44      * Resolve the given destination name, either as located resource
45      * or as dynamic destination.
46      * @param session the current JMS Session
47      * @param destinationName the name of the destination
48      * @param pubSubDomain <code>true</code> if the domain is pub-sub, <code>false</code> if P2P
49      * @return the JMS destination (either a topic or a queue)
50      * @throws javax.jms.JMSException if resolution failed
51      */

52     Destination JavaDoc resolveDestinationName(Session JavaDoc session, String JavaDoc destinationName, boolean pubSubDomain)
53             throws JMSException JavaDoc;
54
55 }
56
Popular Tags