001/* 002 * Copyright 2002-2015 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.jms.listener; 018 019import org.springframework.context.SmartLifecycle; 020import org.springframework.jms.support.converter.MessageConverter; 021import org.springframework.jms.support.destination.DestinationResolver; 022 023/** 024 * Internal abstraction used by the framework representing a message 025 * listener container. Not meant to be implemented externally with 026 * support for both JMS and JCA style containers. 027 * 028 * @author Stephane Nicoll 029 * @since 4.1 030 */ 031public interface MessageListenerContainer extends SmartLifecycle { 032 033 /** 034 * Setup the message listener to use. Throws an {@link IllegalArgumentException} 035 * if that message listener type is not supported. 036 */ 037 void setupMessageListener(Object messageListener); 038 039 /** 040 * Return the {@link MessageConverter} that can be used to 041 * convert {@link javax.jms.Message}, if any. 042 */ 043 MessageConverter getMessageConverter(); 044 045 /** 046 * Return the {@link DestinationResolver} to use to resolve 047 * destinations by names. 048 */ 049 DestinationResolver getDestinationResolver(); 050 051 /** 052 * Return whether the Publish/Subscribe domain ({@link javax.jms.Topic Topics}) is used. 053 * Otherwise, the Point-to-Point domain ({@link javax.jms.Queue Queues}) is used. 054 */ 055 boolean isPubSubDomain(); 056 057 /** 058 * Return whether the reply destination uses Publish/Subscribe domain 059 * ({@link javax.jms.Topic Topics}). Otherwise, the Point-to-Point domain 060 * ({@link javax.jms.Queue Queues}) is used. 061 * <p>By default, the value is identical to {@link #isPubSubDomain()}. 062 */ 063 boolean isReplyPubSubDomain(); 064 065}