1 /* 2 * Copyright 2002-2018 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 module hunt.stomp.core.AbstractMessagingTemplate; 18 19 import hunt.collection.Map; 20 21 import hunt.stomp.core.AbstractMessageReceivingTemplate; 22 import hunt.stomp.core.MessageRequestReplyOperations; 23 import hunt.stomp.Message; 24 25 /** 26 * An extension of {@link AbstractMessageReceivingTemplate} that adds support for 27 * request-reply style operations as defined by {@link MessageRequestReplyOperations}. 28 * 29 * @author Mark Fisher 30 * @author Rossen Stoyanchev 31 * @author Stephane Nicoll 32 * @since 4.0 33 * @param (T) the destination type 34 */ 35 abstract class AbstractMessagingTemplate(T) : AbstractMessageReceivingTemplate!(T), 36 MessageRequestReplyOperations!(T) { 37 38 // override 39 40 // Message!(T) sendAndReceive(Message!(T) requestMessage) { 41 // return sendAndReceive(getRequiredDefaultDestination(), requestMessage); 42 // } 43 44 // override 45 46 // Message!(T) sendAndReceive(T destination, Message!(T) requestMessage) { 47 // return doSendAndReceive(destination, requestMessage); 48 // } 49 50 51 // protected abstract Message!(T) doSendAndReceive(T destination, Message!(T) requestMessage); 52 53 54 // override 55 56 // <T> T convertSendAndReceive(Object request, Class!(T) targetClass) { 57 // return convertSendAndReceive(getRequiredDefaultDestination(), request, targetClass); 58 // } 59 60 // override 61 62 // <T> T convertSendAndReceive(T destination, Object request, Class!(T) targetClass) { 63 // return convertSendAndReceive(destination, request, null, targetClass); 64 // } 65 66 // override 67 68 // <T> T convertSendAndReceive( 69 // T destination, Object request, Map!(string, Object) headers, Class!(T) targetClass) { 70 71 // return convertSendAndReceive(destination, request, headers, targetClass, null); 72 // } 73 74 // override 75 76 // <T> T convertSendAndReceive( 77 // Object request, Class!(T) targetClass, MessagePostProcessor postProcessor) { 78 79 // return convertSendAndReceive(getRequiredDefaultDestination(), request, targetClass, postProcessor); 80 // } 81 82 // override 83 84 // <T> T convertSendAndReceive(T destination, Object request, Class!(T) targetClass, 85 // MessagePostProcessor postProcessor) { 86 87 // return convertSendAndReceive(destination, request, null, targetClass, postProcessor); 88 // } 89 90 // 91 // override 92 93 // <T> T convertSendAndReceive(T destination, Object request, Map!(string, Object) headers, 94 // Class!(T) targetClass, MessagePostProcessor postProcessor) { 95 96 // Message!(T) requestMessage = doConvert(request, headers, postProcessor); 97 // Message!(T) replyMessage = sendAndReceive(destination, requestMessage); 98 // return (replyMessage !is null ? (T) getMessageConverter().fromMessage(replyMessage, targetClass) : null); 99 // } 100 101 }