INT-3262 JDK8 Javadoc Commit

Increase receive timeout for `Jsr223TransformerTests#testInt3162ScriptExecutorThreadSafety`.

JIRA: https://jira.springsource.org/browse/INT-3262
JIRA: https://jira.springsource.org/browse/INT-3263
This commit is contained in:
Gary Russell
2014-01-15 19:14:53 +02:00
committed by Artem Bilan
parent 66efb34342
commit c45b708341
249 changed files with 2265 additions and 985 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,8 +32,6 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.integration.gateway.MessagingGatewaySupport;
import org.springframework.integration.history.TrackableComponent;
import org.springframework.integration.support.MessageBuilder;
@@ -43,6 +41,8 @@ import org.springframework.jms.support.converter.MessageConverter;
import org.springframework.jms.support.converter.SimpleMessageConverter;
import org.springframework.jms.support.destination.DestinationResolver;
import org.springframework.jms.support.destination.DynamicDestinationResolver;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.util.Assert;
/**
@@ -90,6 +90,8 @@ public class ChannelPublishingJmsMessageListener
/**
* Specify whether a JMS reply Message is expected.
*
* @param expectReply true if a reply is expected.
*/
public void setExpectReply(boolean expectReply) {
this.expectReply = expectReply;
@@ -138,6 +140,8 @@ public class ChannelPublishingJmsMessageListener
* Set the default reply destination to send reply messages to. This will
* be applied in case of a request message that does not carry a
* "JMSReplyTo" field.
*
* @param defaultReplyDestination The default reply destination.
*/
public void setDefaultReplyDestination(Destination defaultReplyDestination) {
this.defaultReplyDestination = defaultReplyDestination;
@@ -148,6 +152,9 @@ public class ChannelPublishingJmsMessageListener
* This will be applied in case of a request message that does not carry a
* "JMSReplyTo" field.
* <p>Alternatively, specify a JMS Destination object as "defaultReplyDestination".
*
* @param destinationName The default reply destination name.
*
* @see #setDestinationResolver
* @see #setDefaultReplyDestination(javax.jms.Destination)
*/
@@ -160,6 +167,9 @@ public class ChannelPublishingJmsMessageListener
* This will be applied in case of a request message that does not carry a
* "JMSReplyTo" field.
* <p>Alternatively, specify a JMS Destination object as "defaultReplyDestination".
*
* @param destinationName The default reply topic name.
*
* @see #setDestinationResolver
* @see #setDefaultReplyDestination(javax.jms.Destination)
*/
@@ -169,6 +179,9 @@ public class ChannelPublishingJmsMessageListener
/**
* Specify the time-to-live property for JMS reply Messages.
*
* @param replyTimeToLive The reply time to live.
*
* @see javax.jms.MessageProducer#setTimeToLive(long)
*/
public void setReplyTimeToLive(long replyTimeToLive) {
@@ -177,6 +190,9 @@ public class ChannelPublishingJmsMessageListener
/**
* Specify the priority value for JMS reply Messages.
*
* @param replyPriority The reply priority.
*
* @see javax.jms.MessageProducer#setPriority(int)
*/
public void setReplyPriority(int replyPriority) {
@@ -185,6 +201,9 @@ public class ChannelPublishingJmsMessageListener
/**
* Specify the delivery mode for JMS reply Messages.
*
* @param replyDeliveryPersistent true for a persistent reply message.
*
* @see javax.jms.MessageProducer#setDeliveryMode(int)
*/
public void setReplyDeliveryPersistent(boolean replyDeliveryPersistent) {
@@ -201,6 +220,8 @@ public class ChannelPublishingJmsMessageListener
* instead, then this value should be set to "JMSCorrelationID".
* Any other value will be treated as a JMS String Property to be copied as-is
* from the request Message into the reply Message with the same property name.
*
* @param correlationKey The correlation key.
*/
public void setCorrelationKey(String correlationKey) {
this.correlationKey = correlationKey;
@@ -209,6 +230,8 @@ public class ChannelPublishingJmsMessageListener
/**
* Specify whether explicit QoS should be enabled for replies
* (for timeToLive, priority, and deliveryMode settings).
*
* @param explicitQosEnabledForReplies true to enable explicit QoS.
*/
public void setExplicitQosEnabledForReplies(boolean explicitQosEnabledForReplies) {
this.explicitQosEnabledForReplies = explicitQosEnabledForReplies;
@@ -219,6 +242,9 @@ public class ChannelPublishingJmsMessageListener
* destination names for this listener.
* <p>The default resolver is a DynamicDestinationResolver. Specify a
* JndiDestinationResolver for resolving destination names as JNDI locations.
*
* @param destinationResolver The destination resolver.
*
* @see org.springframework.jms.support.destination.DynamicDestinationResolver
* @see org.springframework.jms.support.destination.JndiDestinationResolver
*/
@@ -233,7 +259,7 @@ public class ChannelPublishingJmsMessageListener
* If none is provided, a {@link SimpleMessageConverter} will
* be used.
*
* @param messageConverter
* @param messageConverter The message converter.
*/
public void setMessageConverter(MessageConverter messageConverter) {
this.messageConverter = messageConverter;
@@ -243,6 +269,8 @@ public class ChannelPublishingJmsMessageListener
* Provide a {@link JmsHeaderMapper} implementation to use when
* converting between JMS Messages and Spring Integration Messages.
* If none is provided, a {@link DefaultJmsHeaderMapper} will be used.
*
* @param headerMapper The header mapper.
*/
public void setHeaderMapper(JmsHeaderMapper headerMapper) {
this.headerMapper = headerMapper;
@@ -253,6 +281,8 @@ public class ChannelPublishingJmsMessageListener
* to converting into a Spring Integration Message. This value is set to
* <code>true</code> by default. To send the JMS Message itself as a
* Spring Integration Message payload, set this to <code>false</code>.
*
* @param extractRequestPayload true if the request payload should be extracted.
*/
public void setExtractRequestPayload(boolean extractRequestPayload) {
this.extractRequestPayload = extractRequestPayload;
@@ -263,6 +293,8 @@ public class ChannelPublishingJmsMessageListener
* extracted prior to converting into a JMS Message. This value is set to
* <code>true</code> by default. To send the Spring Integration Message
* itself as the JMS Message's body, set this to <code>false</code>.
*
* @param extractReplyPayload true if the reply payload should be extracted.
*/
public void setExtractReplyPayload(boolean extractReplyPayload) {
this.extractReplyPayload = extractReplyPayload;
@@ -386,6 +418,7 @@ public class ChannelPublishingJmsMessageListener
/**
* Resolve the default reply destination into a JMS {@link Destination}, using this
* listener's {@link DestinationResolver} in case of a destination name.
* @param session The session.
* @return the located {@link Destination}
* @throws javax.jms.JMSException if resolution failed
* @see #setDefaultReplyDestination

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@ import javax.jms.JMSException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.messaging.MessageHeaders;
import org.springframework.util.StringUtils;
@@ -71,6 +72,8 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper {
* This does not affect the JMS properties covered by the specification/API,
* such as JMSCorrelationID, etc. The header names used for mapping such
* properties are all defined in our {@link JmsHeaders}.
*
* @param inboundPrefix The inbound prefix.
*/
public void setInboundPrefix(String inboundPrefix) {
this.inboundPrefix = (inboundPrefix != null) ? inboundPrefix : "";
@@ -84,11 +87,14 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper {
* This does not affect the JMS properties covered by the specification/API,
* such as JMSCorrelationID, etc. The header names used for mapping such
* properties are all defined in our {@link JmsHeaders}.
*
* @param outboundPrefix The outbound prefix.
*/
public void setOutboundPrefix(String outboundPrefix) {
this.outboundPrefix = (outboundPrefix != null) ? outboundPrefix : "";
}
@Override
public void fromHeaders(MessageHeaders headers, javax.jms.Message jmsMessage) {
try {
Object jmsCorrelationId = headers.get(JmsHeaders.CORRELATION_ID);
@@ -151,6 +157,7 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper {
}
}
@Override
public Map<String, Object> toHeaders(javax.jms.Message jmsMessage) {
Map<String, Object> headers = new HashMap<String, Object>();
try {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,13 +20,13 @@ import java.util.Map;
import javax.jms.Destination;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessagingException;
import org.springframework.integration.context.IntegrationObjectSupport;
import org.springframework.integration.core.MessageSource;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.support.converter.MessageConverter;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessagingException;
import org.springframework.util.Assert;
/**
@@ -34,7 +34,7 @@ import org.springframework.util.Assert;
* only recommended for very low message volume. Otherwise, the
* {@link JmsMessageDrivenEndpoint} that uses Spring's MessageListener container
* support is a better option.
*
*
* @author Mark Fisher
* @author Oleg Zhurakousky
*/
@@ -73,6 +73,8 @@ public class JmsDestinationPollingSource extends IntegrationObjectSupport implem
/**
* Specify a JMS Message Selector expression to use when receiving Messages.
*
* @param messageSelector The message selector.
*/
public void setMessageSelector(String messageSelector) {
this.messageSelector = messageSelector;
@@ -83,10 +85,11 @@ public class JmsDestinationPollingSource extends IntegrationObjectSupport implem
}
/**
* Will receive a JMS {@link javax.jms.Message} converting and returning it as
* Will receive a JMS {@link javax.jms.Message} converting and returning it as
* a Spring Integration {@link Message}. This method will also use the current
* {@link JmsHeaderMapper} instance to map JMS properties to the MessageHeaders.
*/
@Override
@SuppressWarnings("unchecked")
public Message<Object> receive() {
Message<Object> convertedMessage = null;

View File

@@ -45,7 +45,6 @@ import javax.jms.Topic;
import org.springframework.context.SmartLifecycle;
import org.springframework.expression.Expression;
import org.springframework.integration.IntegrationMessageHeaderAccessor;
import org.springframework.messaging.MessageHandlingException;
import org.springframework.integration.MessageTimeoutException;
import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
import org.springframework.integration.handler.ExpressionEvaluatingMessageProcessor;
@@ -60,6 +59,7 @@ import org.springframework.jms.support.destination.DynamicDestinationResolver;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessageDeliveryException;
import org.springframework.messaging.MessageHandlingException;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
@@ -149,6 +149,9 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
* specified as a boolean value ("true" or "false"). This will set the delivery
* mode accordingly to either "PERSISTENT" (1) or "NON_PERSISTENT" (2).
* <p>The default is "true", i.e. delivery mode "PERSISTENT".
*
* @param deliveryPersistent true for a persistent delivery.
*
* @see javax.jms.DeliveryMode#PERSISTENT
* @see javax.jms.DeliveryMode#NON_PERSISTENT
*/
@@ -159,6 +162,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
/**
* Set the JMS ConnectionFactory that this gateway should use.
* This is a <em>required</em> property.
*
* @param connectionFactory The connection factory.
*/
public void setConnectionFactory(ConnectionFactory connectionFactory) {
this.connectionFactory = connectionFactory;
@@ -167,6 +172,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
/**
* Set the JMS Destination to which request Messages should be sent.
* Either this or one of 'requestDestinationName' or 'requestDestinationExpression' is required.
*
* @param requestDestination The request destination.
*/
public void setRequestDestination(Destination requestDestination) {
if (requestDestination instanceof Topic) {
@@ -178,6 +185,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
/**
* Set the name of the JMS Destination to which request Messages should be sent.
* Either this or one of 'requestDestination' or 'requestDestinationExpression' is required.
*
* @param requestDestinationName The request destination name.
*/
public void setRequestDestinationName(String requestDestinationName) {
this.requestDestinationName = requestDestinationName;
@@ -187,6 +196,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
* Set the SpEL Expression to be used for determining the request Destination instance
* or request destination name. Either this or one of 'requestDestination' or
* 'requestDestinationName' is required.
*
* @param requestDestinationExpression The request destination expression.
*/
public void setRequestDestinationExpression(Expression requestDestinationExpression) {
Assert.notNull(requestDestinationExpression, "'requestDestinationExpression' must not be null");
@@ -196,6 +207,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
/**
* Set the JMS Destination from which reply Messages should be received.
* If none is provided, this gateway will create a {@link TemporaryQueue} per invocation.
*
* @param replyDestination The reply destination.
*/
public void setReplyDestination(Destination replyDestination) {
if (replyDestination instanceof Topic) {
@@ -207,6 +220,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
/**
* Set the name of the JMS Destination from which reply Messages should be received.
* If none is provided, this gateway will create a {@link TemporaryQueue} per invocation.
*
* @param replyDestinationName The reply destination name.
*/
public void setReplyDestinationName(String replyDestinationName) {
this.replyDestinationName = replyDestinationName;
@@ -216,6 +231,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
* Set the SpEL Expression to be used for determining the reply Destination instance
* or reply destination name. Either this or one of 'replyDestination' or
* 'replyDestinationName' is required.
*
* @param replyDestinationExpression The reply destination expression.
*/
public void setReplyDestinationExpression(Expression replyDestinationExpression) {
Assert.notNull(replyDestinationExpression, "'replyDestinationExpression' must not be null");
@@ -226,6 +243,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
* Provide the {@link DestinationResolver} to use when resolving either a
* 'requestDestinationName' or 'replyDestinationName' value. The default
* is an instance of {@link DynamicDestinationResolver}.
*
* @param destinationResolver The destination resolver.
*/
public void setDestinationResolver(DestinationResolver destinationResolver) {
this.destinationResolver = destinationResolver;
@@ -236,7 +255,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
* necessary when providing a destination name for a Topic rather than
* a destination reference.
*
* @param requestPubSubDomain true if the request destination is a Topic
* @param requestPubSubDomain true if the request destination is a Topic.
*/
public void setRequestPubSubDomain(boolean requestPubSubDomain) {
this.requestPubSubDomain = requestPubSubDomain;
@@ -247,7 +266,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
* necessary when providing a destination name for a Topic rather than
* a destination reference.
*
* @param replyPubSubDomain true if the reply destination is a Topic
* @param replyPubSubDomain true if the reply destination is a Topic.
*/
public void setReplyPubSubDomain(boolean replyPubSubDomain) {
this.replyPubSubDomain = replyPubSubDomain;
@@ -256,27 +275,18 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
/**
* Set the max timeout value for the MessageConsumer's receive call when
* waiting for a reply. The default value is 5 seconds.
*
* @param receiveTimeout The receive timeout.
*/
public void setReceiveTimeout(long receiveTimeout) {
this.receiveTimeout = receiveTimeout;
}
/**
* Specify the JMS DeliveryMode to use when sending request Messages.
* @deprecated use {@link #setDeliveryPersistent(boolean)}
* This should have been deprecated in 2.0 when the attribute was
* deprecated in the schema. As of 3.0, the attribute has been
* removed but this remains to allow users of the API to migrate.
* TODO: Remove in 3.1/4.0
*/
@Deprecated
public void setDeliveryMode(int deliveryMode) {
this.deliveryMode = deliveryMode;
}
/**
* Specify the JMS priority to use when sending request Messages.
* The value should be within the range of 0-9.
*
* @param priority The priority.
*/
public void setPriority(int priority) {
this.priority = priority;
@@ -285,6 +295,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
/**
* Specify the timeToLive for each sent Message.
* The default value indicates no expiration.
*
* @param timeToLive The time to live.
*/
public void setTimeToLive(long timeToLive) {
this.timeToLive = timeToLive;
@@ -293,6 +305,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
/**
* Specify whether explicit QoS settings are enabled
* (deliveryMode, priority, and timeToLive).
*
* @param explicitQosEnabled true to enable explicit QoS.
*/
public void setExplicitQosEnabled(boolean explicitQosEnabled) {
this.explicitQosEnabled = explicitQosEnabled;
@@ -308,6 +322,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
* If you want to store the outbound correlation UUID value in the actual
* JMSCorrelationID property, then set this value to "JMSCorrelationID".
* However, any other value will be treated as a JMS String Property.
*
* @param correlationKey The correlation key.
*/
public void setCorrelationKey(String correlationKey) {
this.correlationKey = correlationKey;
@@ -319,6 +335,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
* the JMS reply Messages back into Spring Integration Messages.
* <p>
* The default is {@link SimpleMessageConverter}.
*
* @param messageConverter The message converter.
*/
public void setMessageConverter(MessageConverter messageConverter) {
Assert.notNull(messageConverter, "'messageConverter' must not be null");
@@ -328,6 +346,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
/**
* Provide a {@link JmsHeaderMapper} implementation for mapping the
* Spring Integration Message Headers to/from JMS Message properties.
*
* @param headerMapper The header mapper.
*/
public void setHeaderMapper(JmsHeaderMapper headerMapper) {
this.headerMapper = headerMapper;
@@ -344,7 +364,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
* <br>
* Default is 'true'
*
* @param extractRequestPayload
* @param extractRequestPayload true to extract the request payload.
*/
public void setExtractRequestPayload(boolean extractRequestPayload) {
this.extractRequestPayload = extractRequestPayload;
@@ -357,7 +377,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
* Otherwise, the entire JMS Message will become the payload of the
* Spring Integration Message.
*
* @param extractReplyPayload
* @param extractReplyPayload true to extract the reply payload.
*/
public void setExtractReplyPayload(boolean extractReplyPayload) {
this.extractReplyPayload = extractReplyPayload;
@@ -366,6 +386,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
/**
* Specify the Spring Integration reply channel. If this property is not
* set the gateway will check for a 'replyChannel' header on the request.
*
* @param replyChannel The reply channel.
*/
public void setReplyChannel(MessageChannel replyChannel) {
this.setOutputChannel(replyChannel);
@@ -448,10 +470,12 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
session, replyDestinationName, this.replyPubSubDomain);
}
@Override
public int getPhase() {
return Integer.MAX_VALUE;
}
@Override
public boolean isAutoStartup() {
return this.autoStartup;
}
@@ -570,6 +594,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
}
}
@Override
public void start() {
synchronized (this.lifeCycleMonitor) {
if (!this.active) {
@@ -584,6 +609,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
}
}
@Override
public void stop() {
synchronized (this.lifeCycleMonitor) {
if (this.replyContainer != null) {
@@ -595,10 +621,12 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
}
}
@Override
public boolean isRunning() {
return this.active;
}
@Override
public void stop(Runnable callback) {
this.stop();
callback.run();
@@ -952,6 +980,9 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
/**
* Create a new JMS Connection for this JMS gateway.
*
* @return The connection.
* @throws JMSException Any JMSException.
*/
protected Connection createConnection() throws JMSException {
return this.connectionFactory.createConnection();
@@ -959,11 +990,16 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
/**
* Create a new JMS Session using the provided Connection.
*
* @param connection The connection.
* @return The session.
* @throws JMSException Any JMSException.
*/
protected Session createSession(Connection connection) throws JMSException {
return connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
}
@Override
public void onMessage(javax.jms.Message message) {
String correlationId = null;
try {
@@ -1112,6 +1148,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
private class LateReplyReaper implements Runnable {
@Override
public void run() {
if (logger.isTraceEnabled()) {
logger.trace("Running late reply reaper");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -82,6 +82,8 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler {
*
* <p>The default value is <code>true</code>. To force passing of the full
* Spring Integration Message instead, set this to <code>false</code>.
*
* @param extractPayload true to extract the payload.
*/
public void setExtractPayload(boolean extractPayload) {
this.extractPayload = extractPayload;
@@ -159,6 +161,7 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler {
this.headerMapper = headerMapper;
}
@Override
public javax.jms.Message postProcessMessage(javax.jms.Message jmsMessage) throws JMSException {
this.headerMapper.fromHeaders(this.integrationMessage.getHeaders(), jmsMessage);
return jmsMessage;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -64,17 +64,19 @@ public class SubscribableJmsChannel extends AbstractJmsChannel implements Subscr
/**
* Specify the maximum number of subscribers supported by the
* channel's dispatcher.
* @param maxSubscribers
* @param maxSubscribers The maximum number of subscribers allowed.
*/
public void setMaxSubscribers(int maxSubscribers) {
this.maxSubscribers = maxSubscribers;
}
@Override
public boolean subscribe(MessageHandler handler) {
Assert.state(this.dispatcher != null, "'MessageDispatcher' must not be null. This channel might not have been initialized");
return this.dispatcher.addHandler(handler);
}
@Override
public boolean unsubscribe(MessageHandler handler) {
Assert.state(this.dispatcher != null, "'MessageDispatcher' must not be null. This channel might not have been initialized");
return this.dispatcher.removeHandler(handler);
@@ -139,6 +141,7 @@ public class SubscribableJmsChannel extends AbstractJmsChannel implements Subscr
}
@Override
public void onMessage(javax.jms.Message message) {
Message<?> messageToSend = null;
try {
@@ -177,36 +180,43 @@ public class SubscribableJmsChannel extends AbstractJmsChannel implements Subscr
* SmartLifecycle implementation (delegates to the MessageListener container)
*/
@Override
public boolean isAutoStartup() {
return (this.container != null) ? this.container.isAutoStartup() : false;
}
@Override
public int getPhase() {
return (this.container != null) ? this.container.getPhase() : 0;
}
@Override
public boolean isRunning() {
return (this.container != null) ? this.container.isRunning() : false;
}
@Override
public void start() {
if (this.container != null) {
this.container.start();
}
}
@Override
public void stop() {
if (this.container != null) {
this.container.stop();
}
}
@Override
public void stop(Runnable callback) {
if (this.container != null) {
this.container.stop(callback);
}
}
@Override
public void destroy() throws Exception {
if (this.container != null) {
this.container.destroy();