1 /*** 2 * 3 * Copyright 2005 LogicBlaze, Inc. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 **/ 18 package org.logicblaze.lingo.jms.marshall; 19 20 import org.logicblaze.lingo.LingoInvocation; 21 import org.logicblaze.lingo.jms.Requestor; 22 import org.springframework.remoting.support.RemoteInvocation; 23 import org.springframework.remoting.support.RemoteInvocationResult; 24 25 import javax.jms.JMSException; 26 import javax.jms.Message; 27 28 /*** 29 * @version $Revision: 1.1 $ 30 */ 31 public interface Marshaller { 32 /*** 33 * Creates the request message 34 * 35 * @param requestor 36 * @param invocation the remote invocation to send 37 * @throws javax.jms.JMSException if the message could not be created 38 */ 39 Message createRequestMessage(Requestor requestor, LingoInvocation invocation) throws JMSException; 40 41 /*** 42 * Extracts the invocation result from the response message 43 * 44 * @param message the response message 45 * @return the invocation result 46 * @throws javax.jms.JMSException is thrown if a JMS exception occurs 47 */ 48 RemoteInvocationResult extractInvocationResult(Message message) throws JMSException; 49 50 /*** 51 * Read a RemoteInvocation from the given JMS message 52 * 53 * @param message current JMS message 54 * @return the RemoteInvocation object 55 */ 56 RemoteInvocation readRemoteInvocation(Message message) throws JMSException; 57 }