KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > broker > region > MessageReference


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

18 package org.apache.activemq.broker.region;
19
20 import java.io.IOException JavaDoc;
21
22 import org.apache.activemq.command.ConsumerId;
23 import org.apache.activemq.command.Message;
24 import org.apache.activemq.command.MessageId;
25
26 /**
27  * Keeps track of a message that is flowing through the Broker. This
28  * object may hold a hard reference to the message or only hold the
29  * id of the message if the message has been persisted on in a MessageStore.
30  *
31  * @version $Revision: 1.15 $
32  */

33 public interface MessageReference {
34     
35     public MessageId getMessageId();
36     public Message getMessageHardRef();
37     public Message getMessage() throws IOException JavaDoc;
38     public boolean isPersistent();
39     
40     public Destination getRegionDestination();
41     
42     public int getRedeliveryCounter();
43     public void incrementRedeliveryCounter();
44     
45     public int getReferenceCount();
46     
47     public int incrementReferenceCount();
48     public int decrementReferenceCount();
49     public ConsumerId getTargetConsumerId();
50     public int getSize();
51     public long getExpiration();
52     public String JavaDoc getGroupID();
53     public int getGroupSequence();
54     
55     /**
56      * Returns true if this message is expired
57      */

58     public boolean isExpired();
59     
60 }
61
Popular Tags