UnprocessedMessage.java
01 /*
02  *
03  * Licensed to the Apache Software Foundation (ASF) under one
04  * or more contributor license agreements.  See the NOTICE file
05  * distributed with this work for additional information
06  * regarding copyright ownership.  The ASF licenses this file
07  * to you under the Apache License, Version 2.0 (the
08  * "License"); you may not use this file except in compliance
09  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  */
21 package org.apache.qpid.client.message;
22 
23 import org.apache.qpid.client.AMQSession;
24 import org.apache.qpid.client.BasicMessageConsumer;
25 
26 
27 /**
28  * This class contains everything needed to process a JMS message. It assembles the deliver body, the content header and
29  * the content body/ies.
30  *
31  * Note that the actual work of creating a JMS message for the client code's use is done outside of the MINA dispatcher
32  * thread in order to minimise the amount of work done in the MINA dispatcher thread.
33  */
34 public abstract class UnprocessedMessage implements AMQSession.Dispatchable
35 {
36     private final int _consumerTag;
37 
38 
39     public UnprocessedMessage(int consumerTag)
40     {
41         _consumerTag = consumerTag;
42     }
43 
44 
45     abstract public long getDeliveryTag();
46 
47 
48     public int getConsumerTag()
49     {
50         return _consumerTag;
51     }
52 
53     public void dispatch(AMQSession ssn)
54     {
55         ssn.dispatch(this);
56     }
57 
58 }