📄 queuepropertybase.cpp
字号:
* @return Get max. message queue size in Bytes */ long QueuePropertyBase::getMaxBytes() const { return maxBytes_; } /** * Max message queue size. * <br /> * @return Set max. message queue size in Bytes */ void QueuePropertyBase::setMaxBytes(long maxBytes) { maxBytes_ = maxBytes; } /** * Max message queue size for the cache of this queue. * <br /> * @return Get max. message queue size in Bytes */ long QueuePropertyBase::getMaxBytesCache() const { return maxBytesCache_; } /** * Gets the storeSwapLevel for the queue (only used on cache queues). * <br /> * @return Get storeSwapLevel in bytes. */ long QueuePropertyBase::getStoreSwapLevel() const { return storeSwapLevel_; } /** * Sets the storeSwapLevel for the queue (only used on cache queues). * <br /> * @param Set storeSwapLevel in bytes. */ void QueuePropertyBase::setStoreSwapLevel(long storeSwapLevel) { storeSwapLevel_ = storeSwapLevel; } /** * Gets the storeSwapBytes for the queue (only used on cache queues). * <br /> * @return Get storeSwapBytes in bytes. */ long QueuePropertyBase::getStoreSwapBytes() const { return storeSwapBytes_; } /** * Sets the storeSwapBytes for the queue (only used on cache queues). * <br /> * @param Set storeSwapBytes in bytes. */ void QueuePropertyBase::setStoreSwapBytes(long storeSwapBytes) { storeSwapBytes_ = storeSwapBytes; } /** * Gets the reloadSwapLevel for the queue (only used on cache queues). * <br /> * @return Get reloadSwapLevel in bytes. */ long QueuePropertyBase::getReloadSwapLevel() const { return reloadSwapLevel_; } /** * Sets the reloadSwapLevel for the queue (only used on cache queues). * <br /> * @param Set reloadSwapLevel in bytes. */ void QueuePropertyBase::setReloadSwapLevel(long reloadSwapLevel) { reloadSwapLevel_ = reloadSwapLevel; } /** * Gets the reloadSwapBytes for the queue (only used on cache queues). * <br /> * @return Get reloadSwapBytes in bytes. */ long QueuePropertyBase::getReloadSwapBytes() const { return reloadSwapBytes_; } /** * Sets the reloadSwapBytes for the queue (only used on cache queues). * <br /> * @param Set reloadSwapBytes in bytes. */ void QueuePropertyBase::setReloadSwapBytes(long reloadSwapBytes) { reloadSwapBytes_ = reloadSwapBytes; } /** * Max message queue size for the cache of this queue. * <br /> * @return Set max. message queue size in Bytes */ void QueuePropertyBase::setMaxBytesCache(long maxBytesCache) { maxBytesCache_ = maxBytesCache; } /** * Set the callback onOverflow, it should fit to the protocol-relating. * * @param onOverflow The callback onOverflow, e.g. "et@mars.univers" */ void QueuePropertyBase::setOnOverflow(const string& onOverflow) { /* if (Constants.ONOVERFLOW_BLOCK.equalsIgnoreCase(onOverflow)) { this.onOverflow = Constants.ONOVERFLOW_BLOCK; } */ if (Constants::ONOVERFLOW_DEADMESSAGE == onOverflow) { onOverflow_ = Constants::ONOVERFLOW_DEADMESSAGE; } else if (Constants::ONOVERFLOW_DISCARDOLDEST == onOverflow) { onOverflow_ = Constants::ONOVERFLOW_DISCARDOLDEST; onOverflow_ = Constants::ONOVERFLOW_DEADMESSAGE; // TODO !!! log_.error(ME, string("queue onOverflow='") + string(Constants::ONOVERFLOW_DISCARDOLDEST) + string("' is not implemented, switching to ") + onOverflow_ + string(" mode")); } else { onOverflow_ = Constants::ONOVERFLOW_DEADMESSAGE; log_.warn(ME, string("The queue onOverflow attribute is invalid '") + onOverflow + string("', setting to '") + onOverflow_ + string("'")); } } /** * Returns the onOverflow. * @return e.g. "IOR:00001100022...." or "et@universe.com" */ string QueuePropertyBase::getOnOverflow() const { return onOverflow_; } /* * The default mode, when queue is full the publisher blocks until * there is space again. public final boolean onOverflowBlock() { if (Constants.ONOVERFLOW_BLOCK.equalsIgnoreCase(getOnOverflow())) return true; return false; } */ /** * Set the callback onFailure, it should fit to the protocol-relating. * * @param onFailure The callback onFailure, e.g. "et@mars.univers" */ void QueuePropertyBase::setOnFailure(const string& onFailure) { if (Constants::ONOVERFLOW_DEADMESSAGE == onFailure) onFailure_ = Constants::ONOVERFLOW_DEADMESSAGE; else { log_.warn(ME, string("The queue onFailure attribute is invalid '") + onFailure + string("', setting to 'deadMessage'")); onFailure_ = Constants::ONOVERFLOW_DEADMESSAGE; } } /** * Returns the onFailure. * @return e.g. "IOR:00001100022...." or "et@universe.com" */ string QueuePropertyBase::getOnFailure() const { return onFailure_; } /** * The default mode is to send a dead letter if callback fails permanently */ bool QueuePropertyBase::onFailureDeadMessage() { if (Constants::ONOVERFLOW_DEADMESSAGE == getOnFailure()) return true; return false; } /** * Access the reference counted addresses. * @return null if none available */ AddressVector QueuePropertyBase::getAddresses() const { return addressArr_; } /** * Dump state of this object into a XML ASCII string. * <br> * @param extraOffset indenting of tags for nice output * @return The xml representation */ string QueuePropertyBase::toXml(const string& extraOffset) const { string offset = Constants::OFFSET + extraOffset; string ret; ret += offset + string("<!-- QueuePropertyBase -->"); ret += offset + string("<queue relating='") + getRelating(); if (DEFAULT_type != getType()) ret += string("' type='") + getType(); if (DEFAULT_version != getVersion()) ret += string("' version='") + getVersion(); if (DEFAULT_maxEntriesDefault != getMaxEntries()) ret += string("' maxEntries='") + lexical_cast<std::string>(getMaxEntries()); if (DEFAULT_maxEntriesCacheDefault != getMaxEntriesCache()) ret += string("' maxEntriesCache='") + lexical_cast<std::string>(getMaxEntriesCache()); if (DEFAULT_bytesDefault != getMaxBytes()) ret += string("' maxBytes='") + lexical_cast<std::string>(getMaxBytes()); if (DEFAULT_bytesCacheDefault != getMaxBytesCache()) ret += string("' maxBytesCache='") + lexical_cast<std::string>(getMaxBytesCache()); ret += string("' storeSwapLevel='") + lexical_cast<std::string>(getStoreSwapLevel()); ret += string("' storeSwapBytes='") + lexical_cast<std::string>(getStoreSwapBytes()); ret += string("' reloadSwapLevel='") + lexical_cast<std::string>(getReloadSwapLevel()); ret += string("' reloadSwapBytes='") + lexical_cast<std::string>(getReloadSwapBytes()); if (DEFAULT_expires != getExpires()) ret += string("' expires='") + lexical_cast<std::string>(getExpires()); if (DEFAULT_onOverflow != getOnOverflow()) ret += string("' onOverflow='") + getOnOverflow(); if (DEFAULT_onFailure != getOnFailure()) ret += string("' onFailure='") + getOnFailure(); if (!addressArr_.empty()) { ret += string("'>"); AddressVector::const_iterator iter = addressArr_.begin(); while (iter != addressArr_.end()) { ret += (*iter)->toXml(extraOffset + Constants::INDENT); iter++; } ret += offset + string("</queue>"); } else ret += string("'/>"); return ret; } /** * returns the global object */ Global& QueuePropertyBase::getGlobal() { return global_; }/* void QueuePropertyBase::cleanupAddresses() { AddressVector::iterator iter = addressArr_.begin(); while (iter != addressArr_.end()) { AddressBase* el = *iter; addressArr_.erase(iter); delete el; iter = addressArr_.begin(); } }*/ string QueuePropertyBase::getPropertyPrefix() const { return propertyPrefix_; } void QueuePropertyBase::setpropertyPrefix(const string& prefix) { propertyPrefix_ = prefix; } /** * The command line prefix to configure the queue or msgUnitStore * @return e.g. "queue/history/" or "persistence/msgUnitStore/" */ string QueuePropertyBase::getPrefix() { return (propertyPrefix_.length() > 0) ? getRootTagName()+"/"+propertyPrefix_+"/" : getRootTagName()+"/"; } /** * Helper for logging output, creates the property key for configuration (the command line property). * @param prop e.g. "maxEntries" * @return e.g. "-queue/history/maxEntries" or "-queue/history/maxEntriesCache" or "-persistence/msgUnitStore/maxEntries" */ string QueuePropertyBase::getPropName(const string& token) { return "-" + getPrefix() + token; } string QueuePropertyBase::getRootTagName() const { return rootTagName_; }}}}}} // namespaces
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -