KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > store > ProxyTopicMessageStore


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.store;
19
20 import java.io.IOException JavaDoc;
21
22 import org.apache.activemq.broker.ConnectionContext;
23 import org.apache.activemq.command.ActiveMQDestination;
24 import org.apache.activemq.command.Message;
25 import org.apache.activemq.command.MessageAck;
26 import org.apache.activemq.command.MessageId;
27 import org.apache.activemq.command.SubscriptionInfo;
28 import org.apache.activemq.memory.UsageManager;
29
30 /**
31  * A simple proxy that delegates to another MessageStore.
32  */

33 public class ProxyTopicMessageStore implements TopicMessageStore {
34
35     final TopicMessageStore delegate;
36     
37     public ProxyTopicMessageStore(TopicMessageStore delegate) {
38         this.delegate = delegate;
39     }
40     
41     public MessageStore getDelegate() {
42         return delegate;
43     }
44     
45     public void addMessage(ConnectionContext context, Message message) throws IOException JavaDoc {
46         delegate.addMessage(context, message);
47     }
48     public Message getMessage(MessageId identity) throws IOException JavaDoc {
49         return delegate.getMessage(identity);
50     }
51     public void recover(MessageRecoveryListener listener) throws Exception JavaDoc {
52         delegate.recover(listener);
53     }
54     public void removeAllMessages(ConnectionContext context) throws IOException JavaDoc {
55         delegate.removeAllMessages(context);
56     }
57     public void removeMessage(ConnectionContext context, MessageAck ack) throws IOException JavaDoc {
58         delegate.removeMessage(context, ack);
59     }
60     public void start() throws Exception JavaDoc {
61         delegate.start();
62     }
63     public void stop() throws Exception JavaDoc {
64         delegate.stop();
65     }
66     
67     public SubscriptionInfo lookupSubscription(String JavaDoc clientId, String JavaDoc subscriptionName) throws IOException JavaDoc {
68         return delegate.lookupSubscription(clientId, subscriptionName);
69     }
70     public void acknowledge(ConnectionContext context, String JavaDoc clientId, String JavaDoc subscriptionName, MessageId messageId)
71             throws IOException JavaDoc {
72         delegate.acknowledge(context, clientId, subscriptionName, messageId);
73     }
74     public void addSubsciption(String JavaDoc clientId, String JavaDoc subscriptionName, String JavaDoc selector, boolean retroactive) throws IOException JavaDoc {
75         delegate.addSubsciption(clientId, subscriptionName, selector, retroactive);
76     }
77     public void deleteSubscription(String JavaDoc clientId, String JavaDoc subscriptionName) throws IOException JavaDoc {
78         delegate.deleteSubscription(clientId, subscriptionName);
79     }
80
81     public void recoverSubscription(String JavaDoc clientId, String JavaDoc subscriptionName, MessageRecoveryListener listener) throws Exception JavaDoc {
82         delegate.recoverSubscription(clientId, subscriptionName, listener);
83     }
84     
85     public void recoverNextMessages(String JavaDoc clientId,String JavaDoc subscriptionName,int maxReturned,MessageRecoveryListener listener) throws Exception JavaDoc{
86         delegate.recoverNextMessages(clientId, subscriptionName, maxReturned,listener);
87     }
88     
89     public void resetBatching(String JavaDoc clientId,String JavaDoc subscriptionName) {
90         delegate.resetBatching(clientId,subscriptionName);
91     }
92     
93        
94     public ActiveMQDestination getDestination() {
95         return delegate.getDestination();
96     }
97
98     public SubscriptionInfo[] getAllSubscriptions() throws IOException JavaDoc {
99         return delegate.getAllSubscriptions();
100     }
101     
102     public void setUsageManager(UsageManager usageManager) {
103         delegate.setUsageManager(usageManager);
104     }
105
106     public int getMessageCount(String JavaDoc clientId,String JavaDoc subscriberName) throws IOException JavaDoc{
107         return delegate.getMessageCount(clientId,subscriberName);
108     }
109     
110    
111     public int getMessageCount() throws IOException JavaDoc{
112         return delegate.getMessageCount();
113     }
114
115     public void recoverNextMessages(int maxReturned,MessageRecoveryListener listener) throws Exception JavaDoc{
116        delegate.recoverNextMessages(maxReturned,listener);
117         
118     }
119
120     public void resetBatching(){
121         delegate.resetBatching();
122         
123     }
124 }
125
Popular Tags