01: /*
02: * $Id: JmsTopicResolver.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.transport.jms;
12:
13: import org.mule.api.endpoint.ImmutableEndpoint;
14:
15: import javax.jms.Destination;
16:
17: /**
18: * A strategy interface to detect a {@code javax.jms.Topic} in,
19: * possibly, a vendor-specific way.
20: */
21: public interface JmsTopicResolver {
22: /**
23: * Use endpoint configuration to detect a topic.
24: * @param endpoint endpoint to test
25: * @return true if endpoint's config tells it's a topic
26: * @see #isTopic(org.mule.api.endpoint.ImmutableEndpoint, boolean)
27: */
28: boolean isTopic(ImmutableEndpoint endpoint);
29:
30: /**
31: * Use endpoint configuration to detect a topic. Additionally,
32: * specify a fallback mechanism to search in endpoint's properties
33: * in case resource info yields {@code false}. In case resource info
34: * returned {@code true} no endpoint properties would be consulted.
35: * @param endpoint endpoint to test
36: * @param fallbackToEndpointProperties whether to check endpoint's properties if
37: * resource info returned false
38: * @return true if endpoint's config tells it's a topic
39: */
40: boolean isTopic(ImmutableEndpoint endpoint,
41: boolean fallbackToEndpointProperties);
42:
43: /**
44: * Use any means suitable to detect a topic. This can
45: * be as simple as an {@code instanceof} call or utilize
46: * reflection and/or vendor API instead.
47: * @param destination a jms destination to test
48: * @return {@code true} for topic
49: */
50: boolean isTopic(Destination destination);
51: }
|