/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.activemq.jamqp;

import org.apache.qpid.proton.engine.Delivery;
import org.apache.qpid.proton.message.Message;

public class AmqpMessage {

    private Message message;
    private Delivery delivery;

    /**
     * Accepts the message marking it as consumed on the remote peer.
     *
     * @throws Exception if an error occurs during the accept.
     */
    public void accept() throws Exception {

    }

    /**
     * Rejects the message.
     *
     * @throws Exception if an error occurs during the reject.
     */
    public void reject() throws Exception {

    }

    /**
     * @return the AMQP Delivery object linked to a received message.
     */
    public Delivery getWrappedDelivery() {
        return delivery;
    }

    /**
     * @return the AMQP Message that is wrapped by this object.
     */
    public Message getWrappedMessage() {
        return message;
    }
}

@@ -952,24 +952,59 @@
 pMessage %7B%0A%0A
+    private AmqpReceiver receiver;%0A
     private 
@@ -1016,24 +1016,24 @@
 ge message;%0A
-
     private 
@@ -1244,33 +1244,157 @@
 ows Exception %7B%0A
+        if (receiver == null) %7B%0A            throw new IllegalStateException(%22Can't accept non-received message.%22);%0A        %7D
 %0A
-
     %7D%0A%0A    /**%0A 
@@ -1542,17 +1542,141 @@
 ption %7B%0A
+        if (receiver == null) %7B%0A            throw new IllegalStateException(%22Can't reject non-received message.%22);%0A        %7D
 %0A
-
     %7D%0A%0A 
@@ -1952,24 +1952,24 @@
 Message() %7B%0A
-
         retu
@@ -1985,11 +1985,163 @@
 e;%0A    %7D
+%0A%0A    /**%0A     * @return the AmqpReceiver that consumed this message.%0A     */%0A    public AmqpReceiver getAmqpReceiver() %7B%0A        return receiver;%0A    %7D
 %0A%7D%0A

Add a bit more to the implementation of the Message Wrapper