1 /***
2 *
3 * Copyright 2004 Protique Ltd
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 **/
18 package org.codehaus.activemq.service.impl;
19
20 import org.codehaus.activemq.broker.BrokerClient;
21 import org.codehaus.activemq.message.ActiveMQMessage;
22 import org.codehaus.activemq.message.ConsumerInfo;
23 import org.codehaus.activemq.message.MessageAck;
24 import org.codehaus.activemq.service.MessageContainer;
25 import org.codehaus.activemq.service.MessageContainerManager;
26
27 import javax.jms.JMSException;
28 import java.util.Map;
29
30 /***
31 * A Proxy implementation of {@link MessageContainerManager} which
32 * delegates to some other implementation which is useful for writing
33 * Facade implementations
34 *
35 * @version $Revision: 1.5 $
36 */
37 public abstract class ProxyMessageContainerManager implements MessageContainerManager {
38 private MessageContainerManager delegate;
39
40 public ProxyMessageContainerManager() {
41 }
42
43 public ProxyMessageContainerManager(MessageContainerManager delegate) {
44 this.delegate = delegate;
45 }
46
47 public Map getDestinations() {
48 return getDelegate().getDestinations();
49
50 }
51
52 public void acknowledgeMessage(BrokerClient client, MessageAck ack) throws JMSException {
53 getDelegate().acknowledgeMessage(client, ack);
54 }
55
56 public void acknowledgeTransactedMessage(BrokerClient client, String transactionId, MessageAck ack) throws JMSException {
57 getDelegate().acknowledgeTransactedMessage(client, transactionId, ack);
58 }
59
60 public void redeliverMessage(BrokerClient client, MessageAck ack) throws JMSException {
61 getDelegate().redeliverMessage(client, ack);
62 }
63
64 public void addMessageConsumer(BrokerClient client, ConsumerInfo info) throws JMSException {
65 getDelegate().addMessageConsumer(client, info);
66 }
67
68 public void commitTransaction(BrokerClient client, String transactionId) throws JMSException {
69 getDelegate().commitTransaction(client, transactionId);
70 }
71
72 public void deleteSubscription(String clientId, String subscriberName) throws JMSException {
73 getDelegate().deleteSubscription(clientId, subscriberName);
74 }
75
76 public void poll() throws JMSException {
77 getDelegate().poll();
78 }
79
80 public void removeMessageConsumer(BrokerClient client, ConsumerInfo info) throws JMSException {
81 getDelegate().removeMessageConsumer(client, info);
82 }
83
84 public void rollbackTransaction(BrokerClient client, String transactionId) {
85 getDelegate().rollbackTransaction(client, transactionId);
86 }
87
88 public void sendMessage(BrokerClient client, ActiveMQMessage message) throws JMSException {
89 getDelegate().sendMessage(client, message);
90 }
91
92 public MessageContainer getContainer(String physicalName) throws JMSException {
93 return getDelegate().getContainer(physicalName);
94 }
95
96 public void start() throws JMSException {
97 getDelegate().start();
98 }
99
100 public void stop() throws JMSException {
101 getDelegate().stop();
102 }
103
104
105
106 protected MessageContainerManager getDelegate() {
107 return delegate;
108 }
109
110 protected void setDelegate(MessageContainerManager delegate) {
111 this.delegate = delegate;
112 }
113 }