Package org.springframework.messaging.handler.annotation

Examples of org.springframework.messaging.handler.annotation.SendTo


  protected MessagingMessageListenerAdapter createMessageListenerInstance() {
    return new MessagingMessageListenerAdapter();
  }

  private String getDefaultResponseDestination() {
    SendTo ann = AnnotationUtils.getAnnotation(getMethod(), SendTo.class);
    if (ann != null) {
      Object[] destinations = ann.value();
      if (destinations.length != 1) {
        throw new IllegalStateException("Invalid @" + SendTo.class.getSimpleName() + " annotation on '"
            + getMethod() + "' one destination must be set (got " + Arrays.toString(destinations) + ")");
      }
      return (String) destinations[0];
View Full Code Here


          this.messagingTemplate.convertAndSendToUser(user, destination, returnValue, createHeaders(sessionId));
        }
      }
    }
    else {
      SendTo sendTo = returnType.getMethodAnnotation(SendTo.class);
      String[] destinations = getTargetDestinations(sendTo, message, this.defaultDestinationPrefix);
      for (String destination : destinations) {
        this.messagingTemplate.convertAndSend(destination, returnValue, createHeaders(sessionId));
      }
    }
View Full Code Here

  protected MessagingMessageListenerAdapter createMessageListenerInstance() {
    return new MessagingMessageListenerAdapter();
  }

  private Address getDefaultReplyToAddress() {
    SendTo ann = AnnotationUtils.getAnnotation(getMethod(), SendTo.class);
    if (ann != null) {
      String[] destinations = ann.value();
      if (destinations.length > 1) {
        throw new IllegalStateException("Invalid @" + SendTo.class.getSimpleName() + " annotation on '"
            + getMethod() + "' one destination must be set (got " + Arrays.toString(destinations) + ")");
      }
      return destinations.length == 1 ? new Address(destinations[0]) : new Address(null);
View Full Code Here

TOP

Related Classes of org.springframework.messaging.handler.annotation.SendTo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.