Fixed javadoc links
This commit is contained in:
@@ -18,6 +18,7 @@ package org.springframework.messaging.simp.annotation.support;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHeaders;
|
||||
@@ -56,20 +57,19 @@ public class SubscriptionMethodReturnValueHandler implements HandlerMethodReturn
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param messagingTemplate a messaging template to send messages to, most
|
||||
* likely the "clientOutboundChannel", must not be {@link null}.
|
||||
* Construct a new SubscriptionMethodReturnValueHandler.
|
||||
* @param messagingTemplate a messaging template to send messages to,
|
||||
* most likely the "clientOutboundChannel" (must not be {@code null})
|
||||
*/
|
||||
public SubscriptionMethodReturnValueHandler(MessageSendingOperations<String> messagingTemplate) {
|
||||
Assert.notNull(messagingTemplate, "messagingTemplate must not be null");
|
||||
this.messagingTemplate = messagingTemplate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Configure a {@link MessageHeaderInitializer} to apply to the headers of all
|
||||
* messages sent to the client outbound channel.
|
||||
*
|
||||
* <p>By default this property is not set.
|
||||
*/
|
||||
public void setHeaderInitializer(MessageHeaderInitializer headerInitializer) {
|
||||
@@ -77,7 +77,7 @@ public class SubscriptionMethodReturnValueHandler implements HandlerMethodReturn
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the configured header initializer.
|
||||
* Return the configured header initializer.
|
||||
*/
|
||||
public MessageHeaderInitializer getHeaderInitializer() {
|
||||
return this.headerInitializer;
|
||||
@@ -86,9 +86,9 @@ public class SubscriptionMethodReturnValueHandler implements HandlerMethodReturn
|
||||
|
||||
@Override
|
||||
public boolean supportsReturnType(MethodParameter returnType) {
|
||||
return ((returnType.getMethodAnnotation(SubscribeMapping.class) != null)
|
||||
&& (returnType.getMethodAnnotation(SendTo.class) == null)
|
||||
&& (returnType.getMethodAnnotation(SendToUser.class) == null));
|
||||
return (returnType.getMethodAnnotation(SubscribeMapping.class) != null &&
|
||||
returnType.getMethodAnnotation(SendTo.class) == null &&
|
||||
returnType.getMethodAnnotation(SendToUser.class) == null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -96,6 +96,7 @@ public class SubscriptionMethodReturnValueHandler implements HandlerMethodReturn
|
||||
if (returnValue == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
MessageHeaders headers = message.getHeaders();
|
||||
String destination = SimpMessageHeaderAccessor.getDestination(headers);
|
||||
String sessionId = SimpMessageHeaderAccessor.getSessionId(headers);
|
||||
|
||||
@@ -39,7 +39,7 @@ import org.springframework.util.CollectionUtils;
|
||||
* @since 4.0
|
||||
*/
|
||||
public abstract class AbstractBrokerMessageHandler
|
||||
implements MessageHandler, SmartLifecycle, ApplicationEventPublisherAware {
|
||||
implements MessageHandler, ApplicationEventPublisherAware, SmartLifecycle {
|
||||
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
@@ -56,10 +56,10 @@ public abstract class AbstractBrokerMessageHandler
|
||||
|
||||
private boolean autoStartup = true;
|
||||
|
||||
private Object lifecycleMonitor = new Object();
|
||||
|
||||
private volatile boolean running = false;
|
||||
|
||||
private final Object lifecycleMonitor = new Object();
|
||||
|
||||
|
||||
public AbstractBrokerMessageHandler() {
|
||||
this(Collections.<String>emptyList());
|
||||
@@ -100,7 +100,6 @@ public abstract class AbstractBrokerMessageHandler
|
||||
|
||||
/**
|
||||
* Check whether this message handler is currently running.
|
||||
*
|
||||
* <p>Note that even when this message handler is running the
|
||||
* {@link #isBrokerAvailable()} flag may still independently alternate between
|
||||
* being on and off depending on the concrete sub-class implementation.
|
||||
@@ -112,23 +111,6 @@ public abstract class AbstractBrokerMessageHandler
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the message broker is currently available and able to process messages.
|
||||
*
|
||||
* <p>Note that this is in addition to the {@link #isRunning()} flag, which
|
||||
* indicates whether this message handler is running. In other words the message
|
||||
* handler must first be running and then the {@link #isBrokerAvailable()} flag
|
||||
* may still independently alternate between being on and off depending on the
|
||||
* concrete sub-class implementation.
|
||||
*
|
||||
* <p>Application components may implement
|
||||
* {@link org.springframework.context.ApplicationListener<BrokerAvailabilityEvent>>}
|
||||
* to receive notifications when broker becomes available and unavailable.
|
||||
*/
|
||||
public boolean isBrokerAvailable() {
|
||||
return this.brokerAvailable.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
synchronized (this.lifecycleMonitor) {
|
||||
@@ -171,6 +153,22 @@ public abstract class AbstractBrokerMessageHandler
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the message broker is currently available and able to process messages.
|
||||
* <p>Note that this is in addition to the {@link #isRunning()} flag, which
|
||||
* indicates whether this message handler is running. In other words the message
|
||||
* handler must first be running and then the {@code #isBrokerAvailable()} flag
|
||||
* may still independently alternate between being on and off depending on the
|
||||
* concrete sub-class implementation.
|
||||
* <p>Application components may implement
|
||||
* {@code org.springframework.context.ApplicationListener<BrokerAvailabilityEvent>}
|
||||
* to receive notifications when broker becomes available and unavailable.
|
||||
*/
|
||||
public boolean isBrokerAvailable() {
|
||||
return this.brokerAvailable.get();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void handleMessage(Message<?> message) {
|
||||
if (!this.running) {
|
||||
|
||||
@@ -40,7 +40,7 @@ public class IdTimestampMessageHeaderInitializer implements MessageHeaderInitial
|
||||
* instances with.
|
||||
* <p>By default this property is set to {@code null} in which case the default
|
||||
* IdGenerator of {@link org.springframework.messaging.MessageHeaders} is used.
|
||||
* <p>To have no id's generated at all, see {@@link #setDisableIdGeneration()}.
|
||||
* <p>To have no id's generated at all, see {@link #setDisableIdGeneration()}.
|
||||
*/
|
||||
public void setIdGenerator(IdGenerator idGenerator) {
|
||||
this.idGenerator = idGenerator;
|
||||
|
||||
Reference in New Issue
Block a user