1 /** 2 * PETALS: PETALS Services Platform 3 * Copyright (C) 2006 EBM WebSourcing 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 * USA. 19 * 20 * Initial developer(s): EBM WebSourcing 21 * -------------------------------------------------------------------------- 22 * $Id: Serializer.java,v 0.3 2005/07/22 10:24:27 alouis Exp $ 23 * -------------------------------------------------------------------------- 24 */ 25 26 package org.objectweb.petals.jbi.transport; 27 28 import javax.jbi.JBIException; 29 import javax.jms.Message; 30 import javax.jms.Session; 31 32 import org.objectweb.petals.jbi.messaging.MessageExchangeImpl; 33 34 /** 35 * A <code>Serializer</code> for the transport ensure the mapping between 36 * <code>MessageExchangeImpl</code> and <code>jms.Message</code>. 37 * 38 * @version $Rev: 477 $ $Date: 2006-05-29 17:18:07 +0200 (lun., 29 mai 2006) $ 39 * @since Petals 1.0 40 * @author alouis 41 */ 42 public interface Serializer { 43 /** 44 * Transform a <code>MessageExchangeImpl</code> into a 45 * <code>jms.Message</code> 46 * 47 * @param jbi 48 * the exchange, must be non null 49 * @param Session 50 * the session used to create jms message, mus be non null 51 * @return a jms message representing the given exchange 52 * @throws TransportException TODO 53 */ 54 Message jbi2jms(MessageExchangeImpl jbi, Session session) 55 throws TransportException; 56 57 /** 58 * Transform a <code>jms.Message</code> into a 59 * <code>MessageExchangeImpl</code> 60 * 61 * @param jms 62 * the message to transform, must be non null 63 * @return a messageExchange retrieved from the jms message 64 * @throws JBIException 65 * error during the transformation 66 */ 67 MessageExchangeImpl jms2jbi(Message jms) throws JBIException; 68 } 69