activemq-cpp-3.3.0

src/main/activemq/core/RedeliveryPolicy.h

Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef _ACTIVEMQ_CORE_REDELIVERYPOLICY_H_
00019 #define _ACTIVEMQ_CORE_REDELIVERYPOLICY_H_
00020 
00021 #include <activemq/util/Config.h>
00022 
00023 #include <decaf/util/Properties.h>
00024 
00025 namespace activemq {
00026 namespace core {
00027 
00034     class AMQCPP_API RedeliveryPolicy {
00035     public:
00036 
00037         static const long long NO_MAXIMUM_REDELIVERIES;
00038 
00039     private:
00040 
00041         RedeliveryPolicy( const RedeliveryPolicy& );
00042         RedeliveryPolicy& operator= ( const RedeliveryPolicy& );
00043 
00044     protected:
00045 
00046         RedeliveryPolicy();
00047 
00048     public:
00049 
00050         virtual ~RedeliveryPolicy();
00051 
00055         virtual double getBackOffMultiplier() const = 0;
00056 
00063         virtual void setBackOffMultiplier( double value ) = 0;
00064 
00068         virtual short getCollisionAvoidancePercent() const = 0;
00069 
00074         virtual void setCollisionAvoidancePercent( short value ) = 0;
00075 
00081         virtual long long getInitialRedeliveryDelay() const = 0;
00082 
00089         virtual void setInitialRedeliveryDelay( long long value ) = 0;
00090 
00096         virtual long long getRedeliveryDelay() const = 0;
00097 
00104         virtual void setRedeliveryDelay( long long value ) = 0;
00105 
00112         virtual int getMaximumRedeliveries() const = 0;
00113 
00120         virtual void setMaximumRedeliveries( int maximumRedeliveries ) = 0;
00121 
00131         virtual long long getNextRedeliveryDelay( long long previousDelay ) = 0;
00132 
00136         virtual bool isUseCollisionAvoidance() const = 0;
00137 
00142         virtual void setUseCollisionAvoidance( bool value ) = 0;
00143 
00147         virtual bool isUseExponentialBackOff() const = 0;
00148 
00153         virtual void setUseExponentialBackOff( bool value ) = 0;
00154 
00160         virtual RedeliveryPolicy* clone() const = 0;
00161 
00178         virtual void configure( const decaf::util::Properties& properties );
00179 
00180     };
00181 
00182 }}
00183 
00184 #endif /* _ACTIVEMQ_CORE_REDELIVERYPOLICY_H_ */