01: /*
02: * Copyright 2002-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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;
20: import javax.jms.JMSException;
21: import javax.jms.Session;
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 resolveDestinationName(Session session,
53: String destinationName, boolean pubSubDomain)
54: throws JMSException;
55:
56: }
|