001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.servicemix.client;
018    
019    import javax.jbi.messaging.Fault;
020    import javax.jbi.messaging.MessageExchange;
021    import javax.jbi.messaging.MessagingException;
022    
023    import org.apache.servicemix.jbi.messaging.PojoMarshaler;
024    
025    /**
026     * An extension of the standard {@link javax.jbi.messaging.NormalizedMessage} which allows you to
027     * work directly with message bodies as POJOs ignoring the XML stuff or passing a binary
028     * message around as a ByteBuffer or byte[]
029     * 
030     * @version $Revision: 359151 $
031     * @deprecated
032     */
033    public interface Message extends org.apache.servicemix.jbi.api.Message {
034    
035        /**
036         * Returns the body as a POJO. Depending on the implementation this could be
037         * a Java POJO, a DOM tree or a byte[]
038         */
039        Object getBody() throws MessagingException;
040    
041        /**
042         * Sets the body as a POJO
043         */
044        void setBody(Object body) throws MessagingException;
045        
046        /**
047         * 
048         */
049        Object getBody(PojoMarshaler marshaler) throws MessagingException;
050    
051        /**
052         * Returns the message exchange
053         */
054        MessageExchange getExchange();
055    
056        /**
057         * Helper method to create a new fault for this message exchange
058         */
059        Fault createFault() throws MessagingException;
060    }