KickJava   Java API By Example, From Geeks To Geeks.

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


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.ActiveMQMessage;
23 import org.apache.activemq.command.ConsumerId;
24 import org.apache.activemq.command.Message;
25 import org.apache.activemq.command.MessageId;
26
27 /**
28  * Only used by the {@link QueueMessageReference#NULL_MESSAGE}
29  */

30 final class NullMessageReference implements
31         QueueMessageReference {
32
33     private ActiveMQMessage message = new ActiveMQMessage();
34     private volatile int references;
35     
36     public void drop() {
37         throw new RuntimeException JavaDoc("not implemented");
38     }
39
40     public LockOwner getLockOwner() {
41         throw new RuntimeException JavaDoc("not implemented");
42     }
43
44     public boolean isAcked() {
45         return false;
46     }
47
48     public boolean isDropped() {
49         throw new RuntimeException JavaDoc("not implemented");
50     }
51
52     public boolean lock(LockOwner subscription) {
53         return true;
54     }
55
56     public void setAcked(boolean b) {
57         throw new RuntimeException JavaDoc("not implemented");
58     }
59
60     public void unlock() {
61     }
62
63     public int decrementReferenceCount() {
64         return --references;
65     }
66
67     public long getExpiration() {
68         throw new RuntimeException JavaDoc("not implemented");
69     }
70
71     public String JavaDoc getGroupID() {
72         return null;
73     }
74
75     public int getGroupSequence() {
76         return 0;
77     }
78
79     public Message getMessage() throws IOException JavaDoc {
80         return message;
81     }
82
83     public Message getMessageHardRef() {
84         throw new RuntimeException JavaDoc("not implemented");
85     }
86
87     public MessageId getMessageId() {
88         return message.getMessageId();
89     }
90
91     public int getRedeliveryCounter() {
92         throw new RuntimeException JavaDoc("not implemented");
93     }
94
95     public int getReferenceCount() {
96         return references;
97     }
98
99     public Destination getRegionDestination() {
100         return null;
101     }
102
103     public int getSize() {
104         throw new RuntimeException JavaDoc("not implemented");
105     }
106
107     public ConsumerId getTargetConsumerId() {
108         throw new RuntimeException JavaDoc("not implemented");
109     }
110
111     public void incrementRedeliveryCounter() {
112         throw new RuntimeException JavaDoc("not implemented");
113     }
114
115     public int incrementReferenceCount() {
116         return ++references;
117     }
118
119     public boolean isExpired() {
120         throw new RuntimeException JavaDoc("not implemented");
121     }
122
123     public boolean isPersistent() {
124         throw new RuntimeException JavaDoc("not implemented");
125     }
126
127 }
128
Popular Tags