Save This Page
Home » activemq-parent-5.3.1-source-release » org.apache » activemq » broker » region » [javadoc | source]
    1   /**
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  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   package org.apache.activemq.broker.region;
   18   
   19   import java.io.IOException;
   20   import java.util.List;
   21   import java.util.Set;
   22   
   23   import org.apache.activemq.broker.Broker;
   24   import org.apache.activemq.broker.ConnectionContext;
   25   import org.apache.activemq.broker.ProducerBrokerExchange;
   26   import org.apache.activemq.broker.region.policy.DeadLetterStrategy;
   27   import org.apache.activemq.command.ActiveMQDestination;
   28   import org.apache.activemq.command.Message;
   29   import org.apache.activemq.command.MessageAck;
   30   import org.apache.activemq.command.MessageDispatchNotification;
   31   import org.apache.activemq.command.ProducerInfo;
   32   import org.apache.activemq.store.MessageStore;
   33   import org.apache.activemq.usage.MemoryUsage;
   34   import org.apache.activemq.usage.Usage;
   35   
   36   /**
   37    * 
   38    * @version $Revision: 888227 $
   39    */
   40   public class DestinationFilter implements Destination {
   41   
   42       private Destination next;
   43   
   44       public DestinationFilter(Destination next) {
   45           this.next = next;
   46       }
   47   
   48       public void acknowledge(ConnectionContext context, Subscription sub, MessageAck ack, MessageReference node) throws IOException {
   49           next.acknowledge(context, sub, ack, node);
   50       }
   51   
   52       public void addSubscription(ConnectionContext context, Subscription sub) throws Exception {
   53           next.addSubscription(context, sub);
   54       }
   55   
   56       public Message[] browse() {
   57           return next.browse();
   58       }
   59   
   60       public void dispose(ConnectionContext context) throws IOException {
   61           next.dispose(context);
   62       }
   63   
   64       public void gc() {
   65           next.gc();
   66       }
   67   
   68       public ActiveMQDestination getActiveMQDestination() {
   69           return next.getActiveMQDestination();
   70       }
   71   
   72       public DeadLetterStrategy getDeadLetterStrategy() {
   73           return next.getDeadLetterStrategy();
   74       }
   75   
   76       public DestinationStatistics getDestinationStatistics() {
   77           return next.getDestinationStatistics();
   78       }
   79   
   80       public String getName() {
   81           return next.getName();
   82       }
   83   
   84       public MemoryUsage getMemoryUsage() {
   85           return next.getMemoryUsage();
   86       }
   87   
   88       public void removeSubscription(ConnectionContext context, Subscription sub, long lastDeliveredSequenceId) throws Exception {
   89           next.removeSubscription(context, sub, lastDeliveredSequenceId);
   90       }
   91   
   92       public void send(ProducerBrokerExchange context, Message messageSend) throws Exception {
   93           next.send(context, messageSend);
   94       }
   95   
   96       public void start() throws Exception {
   97           next.start();
   98       }
   99   
  100       public void stop() throws Exception {
  101           next.stop();
  102       }
  103   
  104       public List<Subscription> getConsumers() {
  105           return next.getConsumers();
  106       }
  107   
  108       /**
  109        * Sends a message to the given destination which may be a wildcard
  110        * 
  111        * @param context broker context
  112        * @param message message to send
  113        * @param destination possibly wildcard destination to send the message to
  114        * @throws Exception on error
  115        */
  116       protected void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination) throws Exception {
  117           Broker broker = context.getConnectionContext().getBroker();
  118           Set<Destination> destinations = broker.getDestinations(destination);
  119   
  120           for (Destination dest : destinations) {
  121               dest.send(context, message.copy());
  122           }
  123       }
  124   
  125       public MessageStore getMessageStore() {
  126           return next.getMessageStore();
  127       }
  128   
  129       public boolean isProducerFlowControl() {
  130           return next.isProducerFlowControl();
  131       }
  132   
  133       public void setProducerFlowControl(boolean value) {
  134           next.setProducerFlowControl(value);
  135       }
  136   
  137       public void setBlockedProducerWarningInterval(long blockedProducerWarningInterval) {
  138           next.setBlockedProducerWarningInterval(blockedProducerWarningInterval);
  139       }
  140       
  141       public long getBlockedProducerWarningInterval() {
  142           return next.getBlockedProducerWarningInterval();
  143       }
  144   
  145       public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception {
  146           next.addProducer(context, info);
  147   
  148       }
  149   
  150       public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception {
  151           next.removeProducer(context, info);
  152       }
  153   
  154       public int getMaxAuditDepth() {
  155           return next.getMaxAuditDepth();
  156       }
  157   
  158       public int getMaxProducersToAudit() {
  159           return next.getMaxProducersToAudit();
  160       }
  161   
  162       public boolean isEnableAudit() {
  163           return next.isEnableAudit();
  164       }
  165   
  166       public void setEnableAudit(boolean enableAudit) {
  167           next.setEnableAudit(enableAudit);
  168       }
  169   
  170       public void setMaxAuditDepth(int maxAuditDepth) {
  171           next.setMaxAuditDepth(maxAuditDepth);
  172       }
  173   
  174       public void setMaxProducersToAudit(int maxProducersToAudit) {
  175           next.setMaxProducersToAudit(maxProducersToAudit);
  176       }
  177   
  178       public boolean isActive() {
  179           return next.isActive();
  180       }
  181   
  182       public int getMaxPageSize() {
  183           return next.getMaxPageSize();
  184       }
  185   
  186       public void setMaxPageSize(int maxPageSize) {
  187           next.setMaxPageSize(maxPageSize);
  188       }
  189   
  190       public boolean isUseCache() {
  191           return next.isUseCache();
  192       }
  193   
  194       public void setUseCache(boolean useCache) {
  195           next.setUseCache(useCache);
  196       }
  197   
  198       public int getMinimumMessageSize() {
  199           return next.getMinimumMessageSize();
  200       }
  201   
  202       public void setMinimumMessageSize(int minimumMessageSize) {
  203           next.setMinimumMessageSize(minimumMessageSize);
  204       }
  205   
  206       public void wakeup() {
  207           next.wakeup();
  208       }
  209   
  210       public boolean isLazyDispatch() {
  211           return next.isLazyDispatch();
  212       }
  213   
  214       public void setLazyDispatch(boolean value) {
  215           next.setLazyDispatch(value);
  216       }
  217   
  218       public void messageExpired(ConnectionContext context, PrefetchSubscription prefetchSubscription, MessageReference node) {
  219           next.messageExpired(context, prefetchSubscription, node);
  220       }
  221   
  222       public boolean iterate() {
  223           return next.iterate();
  224       }
  225   
  226       public void fastProducer(ConnectionContext context, ProducerInfo producerInfo) {
  227           next.fastProducer(context, producerInfo);
  228       }
  229   
  230       public void isFull(ConnectionContext context, Usage usage) {
  231           next.isFull(context, usage);
  232       }
  233   
  234       public void messageConsumed(ConnectionContext context, MessageReference messageReference) {
  235           next.messageConsumed(context, messageReference);
  236       }
  237   
  238       public void messageDelivered(ConnectionContext context, MessageReference messageReference) {
  239           next.messageDelivered(context, messageReference);
  240       }
  241   
  242       public void messageDiscarded(ConnectionContext context, MessageReference messageReference) {
  243           next.messageDiscarded(context, messageReference);
  244       }
  245   
  246       public void slowConsumer(ConnectionContext context, Subscription subs) {
  247           next.slowConsumer(context, subs);
  248       }
  249   
  250       public void messageExpired(ConnectionContext context, Subscription subs, MessageReference node) {
  251           next.messageExpired(context, subs, node);
  252       }
  253   
  254       public int getMaxBrowsePageSize() {
  255           return next.getMaxBrowsePageSize();
  256       }
  257   
  258       public void setMaxBrowsePageSize(int maxPageSize) {
  259           next.setMaxBrowsePageSize(maxPageSize);
  260       }
  261   
  262       public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception {
  263           next.processDispatchNotification(messageDispatchNotification);
  264       }
  265   
  266       public int getCursorMemoryHighWaterMark() {
  267           return next.getCursorMemoryHighWaterMark();
  268       }
  269   
  270       public void setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark) {
  271           next.setCursorMemoryHighWaterMark(cursorMemoryHighWaterMark);
  272       }
  273   }

Save This Page
Home » activemq-parent-5.3.1-source-release » org.apache » activemq » broker » region » [javadoc | source]