@SendToUser({"/dest1", "/dest2"}) @SuppressWarnings("unused") String handleAndSendToUser() { return PAYLOAD; }
private DestinationHelper getDestinationHelper(MessageHeaders headers, MethodParameter returnType) { SendToUser m1 = AnnotatedElementUtils.findMergedAnnotation(returnType.getExecutable(), SendToUser.class); SendTo m2 = AnnotatedElementUtils.findMergedAnnotation(returnType.getExecutable(), SendTo.class); if ((m1 != null && !ObjectUtils.isEmpty(m1.value())) || (m2 != null && !ObjectUtils.isEmpty(m2.value()))) { return new DestinationHelper(headers, m1, m2); } SendToUser c1 = AnnotatedElementUtils.findMergedAnnotation(returnType.getDeclaringClass(), SendToUser.class); SendTo c2 = AnnotatedElementUtils.findMergedAnnotation(returnType.getDeclaringClass(), SendTo.class); if ((c1 != null && !ObjectUtils.isEmpty(c1.value())) || (c2 != null && !ObjectUtils.isEmpty(c2.value()))) { return new DestinationHelper(headers, c1, c2); } return (m1 != null || m2 != null ? new DestinationHelper(headers, m1, m2) : new DestinationHelper(headers, c1, c2)); }
boolean broadcast = sendToUser.broadcast(); String user = getUserName(message, headers); if (user == null) {
boolean broadcast = sendToUser.broadcast(); String user = getUserName(message, headers); if (user == null) {
@SendToUser(destinations = { "/dest1", "/dest2" }, broadcast = false) @SuppressWarnings("unused") String handleAndSendToUserInSession() { return PAYLOAD; }
private DestinationHelper getDestinationHelper(MessageHeaders headers, MethodParameter returnType) { SendToUser m1 = AnnotatedElementUtils.findMergedAnnotation(returnType.getExecutable(), SendToUser.class); SendTo m2 = AnnotatedElementUtils.findMergedAnnotation(returnType.getExecutable(), SendTo.class); if ((m1 != null && !ObjectUtils.isEmpty(m1.value())) || (m2 != null && !ObjectUtils.isEmpty(m2.value()))) { return new DestinationHelper(headers, m1, m2); } SendToUser c1 = AnnotatedElementUtils.findMergedAnnotation(returnType.getDeclaringClass(), SendToUser.class); SendTo c2 = AnnotatedElementUtils.findMergedAnnotation(returnType.getDeclaringClass(), SendTo.class); if ((c1 != null && !ObjectUtils.isEmpty(c1.value())) || (c2 != null && !ObjectUtils.isEmpty(c2.value()))) { return new DestinationHelper(headers, c1, c2); } return (m1 != null || m2 != null ? new DestinationHelper(headers, m1, m2) : new DestinationHelper(headers, c1, c2)); }
boolean broadcast = sendToUser.broadcast(); String user = getUserName(message, headers); if (user == null) {
@SendToUser @SuppressWarnings("unused") String handleAndSendToUserDefaultDest() { return PAYLOAD; }
private DestinationHelper getDestinationHelper(MessageHeaders headers, MethodParameter returnType) { SendToUser m1 = AnnotatedElementUtils.findMergedAnnotation(returnType.getExecutable(), SendToUser.class); SendTo m2 = AnnotatedElementUtils.findMergedAnnotation(returnType.getExecutable(), SendTo.class); if ((m1 != null && !ObjectUtils.isEmpty(m1.value())) || (m2 != null && !ObjectUtils.isEmpty(m2.value()))) { return new DestinationHelper(headers, m1, m2); } SendToUser c1 = AnnotatedElementUtils.findMergedAnnotation(returnType.getDeclaringClass(), SendToUser.class); SendTo c2 = AnnotatedElementUtils.findMergedAnnotation(returnType.getDeclaringClass(), SendTo.class); if ((c1 != null && !ObjectUtils.isEmpty(c1.value())) || (c2 != null && !ObjectUtils.isEmpty(c2.value()))) { return new DestinationHelper(headers, c1, c2); } return (m1 != null || m2 != null ? new DestinationHelper(headers, m1, m2) : new DestinationHelper(headers, c1, c2)); }
boolean broadcast = sendToUser.broadcast(); String user = getUserName(message, headers); if (user == null) {
@SendToUser(broadcast = false) @SuppressWarnings("unused") String handleAndSendToUserDefaultDestInSession() { return PAYLOAD; }
private DestinationHelper getDestinationHelper(MessageHeaders headers, MethodParameter returnType) { SendToUser m1 = AnnotatedElementUtils.findMergedAnnotation(returnType.getExecutable(), SendToUser.class); SendTo m2 = AnnotatedElementUtils.findMergedAnnotation(returnType.getExecutable(), SendTo.class); if ((m1 != null && !ObjectUtils.isEmpty(m1.value())) || (m2 != null && !ObjectUtils.isEmpty(m2.value()))) { return new DestinationHelper(headers, m1, m2); } SendToUser c1 = AnnotatedElementUtils.findMergedAnnotation(returnType.getDeclaringClass(), SendToUser.class); SendTo c2 = AnnotatedElementUtils.findMergedAnnotation(returnType.getDeclaringClass(), SendTo.class); if ((c1 != null && !ObjectUtils.isEmpty(c1.value())) || (c2 != null && !ObjectUtils.isEmpty(c2.value()))) { return new DestinationHelper(headers, c1, c2); } return (m1 != null || m2 != null ? new DestinationHelper(headers, m1, m2) : new DestinationHelper(headers, c1, c2)); }
@SendToUser String handleAndSendToDefaultDest() { return PAYLOAD; }
@MessageExceptionHandler @SendToUser("/queue/error") public String handleException(IllegalArgumentException ex) { return "Got error: " + ex.getMessage(); } }
@SendTo({"/dest1", "/dest2"}) @SendToUser({"/dest1", "/dest2"}) @SuppressWarnings("unused") String handleAndSendToAndSendToUser() { return PAYLOAD; }
@SendToUser @Retention(RetentionPolicy.RUNTIME) @interface MySendToUser {
@MessageExceptionHandler @SendToUser("/queue/error") public String handleException(IllegalArgumentException ex) { return "Got error: " + ex.getMessage(); }
@MessageMapping("/greeting") @SendToUser("/queue/answer") @Gateway(requestChannel = "greetingChannel") String greeting(String payload);
@MessageExceptionHandler @SendToUser("/queue/errors") public String handleException(Throwable exception) { return exception.getMessage(); }
@MessageExceptionHandler @SendToUser("/queue/errors") public String handleException(Throwable exception) { return exception.getMessage(); } }