Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 71456 invoked from network); 30 Jan 2007 00:36:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jan 2007 00:36:47 -0000 Received: (qmail 99108 invoked by uid 500); 30 Jan 2007 00:36:53 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 99065 invoked by uid 500); 30 Jan 2007 00:36:53 -0000 Mailing-List: contact activemq-commits-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-commits@geronimo.apache.org Received: (qmail 99056 invoked by uid 99); 30 Jan 2007 00:36:53 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 16:36:53 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 16:36:45 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 92F1E1A981D; Mon, 29 Jan 2007 16:36:25 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r501253 - /incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ Date: Tue, 30 Jan 2007 00:36:24 -0000 To: activemq-commits@geronimo.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070130003625.92F1E1A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Mon Jan 29 16:36:23 2007 New Revision: 501253 URL: http://svn.apache.org/viewvc?view=rev&rev=501253 Log: http://issues.apache.org/activemq/browse/AMQCPP-30 Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.cpp incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.cpp incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp?view=diff&rev=501253&r1=501252&r2=501253 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp (original) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp Mon Jan 29 16:36:23 2007 @@ -15,7 +15,6 @@ * limitations under the License. */ #include -#include using namespace std; using namespace activemq; @@ -29,6 +28,7 @@ dataInputStream( &inputStream ), dataOutputStream( &outputStream ) { + clearBody(); } //////////////////////////////////////////////////////////////////////////////// @@ -48,6 +48,11 @@ throw( cms::CMSException ) { try{ + + clearBody(); + for( size_t i = 0; i < numBytes; ++i ) { + getContent().push_back( buffer[i] ); + } } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -57,6 +62,7 @@ const unsigned char* ActiveMQBytesMessage::getBodyBytes(void) const { try{ + return reinterpret_cast( &( getContent()[0] ) ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -66,6 +72,7 @@ std::size_t ActiveMQBytesMessage::getBodyLength(void) const { try{ + return getContent().size(); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -75,6 +82,8 @@ void ActiveMQBytesMessage::reset() throw ( cms::CMSException ) { try{ + readOnly = true; + inputStream.setBuffer( getContent() ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -84,6 +93,8 @@ bool ActiveMQBytesMessage::readBoolean() throw ( cms::CMSException ) { try{ + checkReadOnly(); + return dataInputStream.readBoolean(); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -93,6 +104,8 @@ void ActiveMQBytesMessage::writeBoolean( bool value ) throw ( cms::CMSException ) { try{ + checkWriteOnly(); + dataOutputStream.writeBoolean( value ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -102,6 +115,8 @@ unsigned char ActiveMQBytesMessage::readByte() throw ( cms::CMSException ) { try{ + checkReadOnly(); + return dataInputStream.readByte(); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -111,6 +126,8 @@ void ActiveMQBytesMessage::writeByte( unsigned char value ) throw ( cms::CMSException ) { try{ + checkWriteOnly(); + dataOutputStream.writeByte( value ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -121,6 +138,8 @@ throw ( cms::CMSException ) { try{ + checkReadOnly(); + return dataInputStream.read( value ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -130,6 +149,8 @@ void ActiveMQBytesMessage::writeBytes( const std::vector& value ) throw ( cms::CMSException ) { try{ + checkWriteOnly(); + dataOutputStream.write( value ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -140,6 +161,8 @@ throw ( cms::CMSException ) { try{ + checkReadOnly(); + return dataInputStream.read( buffer, 0, length ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -151,6 +174,8 @@ std::size_t length ) throw ( cms::CMSException ) { try{ + checkWriteOnly(); + dataOutputStream.write( value, offset, length ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -160,6 +185,8 @@ char ActiveMQBytesMessage::readChar() throw ( cms::CMSException ) { try{ + checkReadOnly(); + return dataInputStream.readChar(); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -169,6 +196,8 @@ void ActiveMQBytesMessage::writeChar( char value ) throw ( cms::CMSException ) { try{ + checkWriteOnly(); + dataOutputStream.writeChar( value ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -178,6 +207,8 @@ float ActiveMQBytesMessage::readFloat() throw ( cms::CMSException ) { try{ + checkReadOnly(); + return dataInputStream.readFloat(); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -187,6 +218,8 @@ void ActiveMQBytesMessage::writeFloat( float value ) throw ( cms::CMSException ) { try{ + checkWriteOnly(); + dataOutputStream.writeFloat( value ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -196,6 +229,8 @@ double ActiveMQBytesMessage::readDouble() throw ( cms::CMSException ) { try{ + checkReadOnly(); + return dataInputStream.readDouble(); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -205,6 +240,8 @@ void ActiveMQBytesMessage::writeDouble( double value ) throw ( cms::CMSException ) { try{ + checkWriteOnly(); + dataOutputStream.writeDouble( value ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -214,6 +251,8 @@ short ActiveMQBytesMessage::readShort() throw ( cms::CMSException ) { try{ + checkReadOnly(); + return dataInputStream.readShort(); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -223,6 +262,8 @@ void ActiveMQBytesMessage::writeShort( short value ) throw ( cms::CMSException ) { try{ + checkWriteOnly(); + dataOutputStream.writeShort( value ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -232,6 +273,8 @@ unsigned short ActiveMQBytesMessage::readUnsignedShort() throw ( cms::CMSException ) { try{ + checkReadOnly(); + return dataInputStream.readUnsignedShort(); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -241,6 +284,8 @@ void ActiveMQBytesMessage::writeUnsignedShort( unsigned short value ) throw ( cms::CMSException ) { try{ + checkWriteOnly(); + dataOutputStream.writeUnsignedShort( value ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -250,6 +295,8 @@ int ActiveMQBytesMessage::readInt() throw ( cms::CMSException ) { try{ + checkReadOnly(); + return dataInputStream.readInt(); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -259,6 +306,8 @@ void ActiveMQBytesMessage::writeInt( int value ) throw ( cms::CMSException ) { try{ + checkWriteOnly(); + dataOutputStream.writeInt( value ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -268,6 +317,8 @@ long long ActiveMQBytesMessage::readLong() throw ( cms::CMSException ) { try{ + checkReadOnly(); + return dataInputStream.readLong(); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -277,6 +328,8 @@ void ActiveMQBytesMessage::writeLong( long long value ) throw ( cms::CMSException ) { try{ + checkWriteOnly(); + dataOutputStream.writeLong( value ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -286,6 +339,8 @@ std::string ActiveMQBytesMessage::readString() throw ( cms::CMSException ) { try{ + checkReadOnly(); + return dataInputStream.readString(); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -295,6 +350,8 @@ void ActiveMQBytesMessage::writeString( const std::string& value ) throw ( cms::CMSException ) { try{ + checkWriteOnly(); + dataOutputStream.writeBytes( value ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -304,6 +361,8 @@ std::string ActiveMQBytesMessage::readUTF() throw ( cms::CMSException ) { try{ + checkReadOnly(); + return dataInputStream.readUTF(); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) @@ -313,6 +372,8 @@ void ActiveMQBytesMessage::writeUTF( const std::string& value ) throw ( cms::CMSException ) { try{ + checkWriteOnly(); + dataOutputStream.writeUTF( value ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h?view=diff&rev=501253&r1=501252&r2=501253 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h (original) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h Mon Jan 29 16:36:23 2007 @@ -24,7 +24,6 @@ #endif #include -#include #include #include #include @@ -83,7 +82,22 @@ return dynamic_cast( this->cloneDataStructure() ); } - + + /** + * Clears out the body of the message. This does not clear the + * headers or properties. + */ + virtual void clearBody(){ + + // Invoke base class's version. + ActiveMQMessageBase::clearBody(); + + // Set the stream in write only mode. + readOnly = false; + + outputStream.setBuffer( getContent() ); + } + public: // CMS BytesMessage /** @@ -346,6 +360,30 @@ */ virtual void writeUTF( const std::string& value ) throw ( cms::CMSException ); + protected: + + /** + * Throws an exception if not in write-only mode. + * @throws CMSException. + */ + void checkWriteOnly() throw (cms::CMSException){ + if( readOnly ){ + throw exceptions::IllegalStateException( __FILE__, __LINE__, + "message is in read-only mode and cannot be written to" ); + } + } + + /** + * Throws an exception if not in read-only mode. + * @throws CMSException + */ + void checkReadOnly() throw (cms::CMSException){ + if( !readOnly ){ + throw exceptions::IllegalStateException( __FILE__, __LINE__, + "message is in write-only mode and cannot be read from" ); + } + } + private: /** Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp?view=diff&rev=501253&r1=501252&r2=501253 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp (original) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp Mon Jan 29 16:36:23 2007 @@ -15,7 +15,6 @@ * limitations under the License. */ #include -#include using namespace std; using namespace activemq; @@ -24,7 +23,8 @@ using namespace activemq::connector::openwire::commands; //////////////////////////////////////////////////////////////////////////////// -ActiveMQMapMessage::ActiveMQMapMessage() +ActiveMQMapMessage::ActiveMQMapMessage() : + ActiveMQMessageBase() { } @@ -37,19 +37,4 @@ unsigned char ActiveMQMapMessage::getDataStructureType() const { return ActiveMQMapMessage::ID_ACTIVEMQMAPMESSAGE; -} - -//////////////////////////////////////////////////////////////////////////////// -void ActiveMQMapMessage::acknowledge(void) const throw( cms::CMSException ) { - - try{ - this->getAckHandler()->acknowledgeMessage( this ); - } - AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) - AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) -} - -//////////////////////////////////////////////////////////////////////////////// -std::string ActiveMQMapMessage::getCMSMessageId(void) const { - return marshal::BaseDataStreamMarshaller::toString( this->getMessageId() ); } Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h?view=diff&rev=501253&r1=501252&r2=501253 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h (original) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h Mon Jan 29 16:36:23 2007 @@ -23,8 +23,7 @@ #pragma warning( disable : 4290 ) #endif -#include -#include +#include #include #include #include @@ -34,8 +33,8 @@ namespace openwire{ namespace commands{ - class ActiveMQMapMessage : public ActiveMQMessage, - public cms::MapMessage + class ActiveMQMapMessage : + public ActiveMQMessageBase { public: @@ -65,7 +64,7 @@ * @return src - Source Object */ virtual void copyDataStructure( const DataStructure* src ) { - ActiveMQMessage::copyDataStructure( src ); + ActiveMQMessageBase::copyDataStructure( src ); } public: // CMS Message @@ -75,337 +74,11 @@ * caller is required to delete. * @return new copy of this message */ - virtual cms::Message* clone(void) const { - return dynamic_cast( + virtual cms::MapMessage* clone(void) const { + return dynamic_cast( this->cloneDataStructure() ); } - /** - * Acknowledges all consumed messages of the session - * of this consumed message. - */ - virtual void acknowledge(void) const throw( cms::CMSException ); - - /** - * Clears out the body of the message. This does not clear the - * headers or properties. - */ - virtual void clearBody(); - - /** - * Clears the message properties. Does not clear the body or - * header values. - */ - virtual void clearProperties(); - - /** - * Retrieves the propery names. - * @return The complete set of property names currently in this - * message. - */ - virtual std::vector getPropertyNames() const ; - - /** - * Indicates whether or not a given property exists. - * @param name The name of the property to look up. - * @return True if the property exists in this message. - */ - virtual bool propertyExists( const std::string& name ) const; - - /** - * Gets a boolean property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual bool getBooleanProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a byte property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual unsigned char getByteProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a double property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual double getDoubleProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a float property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual float getFloatProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a int property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual int getIntProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a long property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual long long getLongProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a short property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual short getShortProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a string property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual std::string getStringProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Sets a boolean property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setBooleanProperty( const std::string& name, - bool value ) throw( cms::CMSException ); - - /** - * Sets a byte property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setByteProperty( const std::string& name, - unsigned char value ) throw( cms::CMSException ); - - /** - * Sets a double property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setDoubleProperty( const std::string& name, - double value ) throw( cms::CMSException ); - - /** - * Sets a float property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setFloatProperty( const std::string& name, - float value ) throw( cms::CMSException ); - - /** - * Sets a int property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setIntProperty( const std::string& name, - int value ) throw( cms::CMSException ); - - /** - * Sets a long property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setLongProperty( const std::string& name, - long long value ) throw( cms::CMSException ); - - /** - * Sets a short property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setShortProperty( const std::string& name, - short value ) throw( cms::CMSException ); - - /** - * Sets a string property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setStringProperty( const std::string& name, - const std::string& value ) throw( cms::CMSException ); - - /** - * Get the Correlation Id for this message - * @return string representation of the correlation Id - */ - virtual std::string getCMSCorrelationId(void) const { - return this->getCorrelationId(); - } - - /** - * Sets the Correlation Id used by this message - * @param correlationId - String representing the correlation id. - */ - virtual void setCMSCorrelationId( const std::string& correlationId ) { - this->setCorrelationId( correlationId ); - } - - /** - * Gets the DeliveryMode for this message - * @return DeliveryMode enumerated value. - */ - virtual int getCMSDeliveryMode(void) const { - return this->isPersistent(); - } - - /** - * Sets the DeliveryMode for this message - * @param mode - DeliveryMode enumerated value. - */ - virtual void setCMSDeliveryMode( int mode ) { - this->setPersistent( mode != 0 ); - } - - /** - * Gets the Destination for this Message, returns a - * @return Destination object - */ - virtual const cms::Destination* getCMSDestination(void) const { - return dynamic_cast( - this->getDestination() ); - } - - /** - * Sets the Destination for this message - * @param destination - Destination Object - */ - virtual void setCMSDestination( const cms::Destination* destination AMQCPP_UNUSED ) { -// this->setDestination( destination ); - } - - /** - * Gets the Expiration Time for this Message - * @return time value - */ - virtual long long getCMSExpiration(void) const { - return this->getExpiration(); - } - - /** - * Sets the Expiration Time for this message - * @param expireTime - time value - */ - virtual void setCMSExpiration( long long expireTime ) { - this->setExpiration( expireTime ); - } - - /** - * Gets the CMS Message Id for this Message - * @return time value - */ - virtual std::string getCMSMessageId(void) const; - - /** - * Sets the CMS Message Id for this message - * @param id - time value - */ - virtual void setCMSMessageId( const std::string& id AMQCPP_UNUSED ) {} - - /** - * Gets the Priority Value for this Message - * @return priority value - */ - virtual int getCMSPriority(void) const { - return this->getPriority(); - } - - /** - * Sets the Priority Value for this message - * @param priority - priority value for this message - */ - virtual void setCMSPriority( int priority ) { - this->setPriority( priority ); - } - - /** - * Gets the Redelivered Flag for this Message - * @return redelivered value - */ - virtual bool getCMSRedelivered(void) const { - return this->getRedeliveryCounter() != 0; - } - - /** - * Sets the Redelivered Flag for this message - * @param redelivered - boolean redelivered value - */ - virtual void setCMSRedelivered( bool redelivered AMQCPP_UNUSED ) {} - - /** - * Gets the CMS Reply To Address for this Message - * @return Reply To Value - */ - virtual const cms::Destination* getCMSReplyTo(void) const; - - /** - * Sets the CMS Reply To Address for this message - * @param id - Reply To value - */ - virtual void setCMSReplyTo( const cms::Destination* destination ); - - /** - * Gets the Time Stamp for this Message - * @return time stamp value - */ - virtual long long getCMSTimeStamp(void) const { - return this->getTimestamp(); - } - - /** - * Sets the Time Stamp for this message - * @param timeStamp - integer time stamp value - */ - virtual void setCMSTimeStamp( long long timeStamp ) { - this->setTimestamp( timeStamp ); - } - - /** - * Gets the CMS Message Type for this Message - * @return type value - */ - virtual std::string getCMSMessageType(void) const { - return this->getType(); - } - - /** - * Sets the CMS Message Type for this message - * @param type - message type value string - */ - virtual void setCMSMessageType( const std::string& type ) { - this->setType( type ); - } public: // CMS MapMessage /** @@ -578,22 +251,6 @@ */ virtual void setString( const std::string& name, const std::string& value ); - - public: // ActiveMQMessage - - /** - * Returns if this message has expired, meaning that its - * Expiration time has elapsed. - * @returns true if message is expired. - */ - virtual bool isExpired() const { - long long expireTime = this->getCMSExpiration(); - long long currentTime = util::Date::getCurrentTimeMilliseconds(); - if( expireTime > 0 && currentTime > expireTime ) { - return true; - } - return false; - } }; Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp?view=diff&rev=501253&r1=501252&r2=501253 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp (original) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp Mon Jan 29 16:36:23 2007 @@ -15,9 +15,6 @@ * limitations under the License. */ #include -#include -#include -#include using namespace std; using namespace activemq; @@ -28,7 +25,8 @@ using namespace activemq::connector::openwire::marshal; //////////////////////////////////////////////////////////////////////////////// -ActiveMQMessage::ActiveMQMessage() +ActiveMQMessage::ActiveMQMessage() : + ActiveMQMessageBase() {} //////////////////////////////////////////////////////////////////////////////// @@ -38,15 +36,4 @@ //////////////////////////////////////////////////////////////////////////////// unsigned char ActiveMQMessage::getDataStructureType() const { return ActiveMQMessage::ID_ACTIVEMQMESSAGE; -} - -//////////////////////////////////////////////////////////////////////////////// -void ActiveMQMessage::beforeMarshall( OpenWireFormat* wireFormat AMQCPP_UNUSED ) -{ - marshalledProperties.clear(); - if( !properties.isEmpty() ) - { - PrimitiveMapMarshaller::marshal( - &properties, marshalledProperties ); - } } Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h?view=diff&rev=501253&r1=501252&r2=501253 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h (original) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h Mon Jan 29 16:36:23 2007 @@ -18,12 +18,7 @@ #ifndef _ACTIVEMQ_CONNECTOR_OPENWIRE_COMMANDS_ACTIVEMQMESSAGE_H_ #define _ACTIVEMQ_CONNECTOR_OPENWIRE_COMMANDS_ACTIVEMQMESSAGE_H_ -#include -#include -#include -#include -#include -#include +#include namespace activemq{ namespace connector{ @@ -31,8 +26,7 @@ namespace commands{ class ActiveMQMessage : - public Message, - public core::ActiveMQMessage + public ActiveMQMessageBase { public: @@ -54,75 +48,18 @@ ActiveMQMessage::copyDataStructure( src ); } - /** - * Indicates that this command is aware of Marshalling, and needs - * to have its Marshalling methods invoked. - * @returns boolean indicating desire to be in marshalling stages - */ - virtual bool IsMarshallAware() { - return true; - } - - /** - * Handles the marshalling of the objects properties into the - * internal byte array before the object is marshalled to the - * wire - * @param wireFormat - the wireformatting controller - */ - virtual void beforeMarshall( OpenWireFormat* wireFormat ); - - public: // core::ActiveMQMessage + public: // cms::Message /** - * Sets the Acknowledgement Handler that this Message will use - * when the Acknowledge method is called. - * @param handler ActiveMQAckHandler to call - */ - virtual void setAckHandler( core::ActiveMQAckHandler* handler ) { - this->ackHandler = handler; - } - - /** - * Gets the Acknowledgement Handler that this Message will use - * when the Acknowledge method is called. - * @returns handler ActiveMQAckHandler to call or NULL if not set - */ - virtual core::ActiveMQAckHandler* getAckHandler() const { - return this->ackHandler; + * Clonse this message exactly, returns a new instance that the + * caller is required to delete. + * @return new copy of this message + */ + virtual cms::Message* clone(void) const { + return dynamic_cast( + this->cloneDataStructure() ); } - - /** - * Gets the number of times this message has been redelivered. - * @return redelivery count - */ - virtual int getRedeliveryCount(void) const { - return redeliveryCount; - } - - /** - * Sets the count of the number of times this message has been - * redelivered - * @param count the redelivery count - */ - virtual void setRedeliveryCount( int count ) { - this->redeliveryCount = count; - } - - /** - * Returns if this message has expired, meaning that its - * Expiration time has elapsed. - * @returns true if message is expired. - */ - virtual bool isExpired() const { - return false; - } - - private: - - core::ActiveMQAckHandler* ackHandler; - int redeliveryCount; - util::PrimitiveMap properties; - + }; }}}} Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.cpp URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.cpp?view=diff&rev=501253&r1=501252&r2=501253 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.cpp (original) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.cpp Mon Jan 29 16:36:23 2007 @@ -23,7 +23,8 @@ using namespace activemq::connector::openwire::commands; //////////////////////////////////////////////////////////////////////////////// -ActiveMQObjectMessage::ActiveMQObjectMessage() +ActiveMQObjectMessage::ActiveMQObjectMessage() : + ActiveMQMessageBase() { } Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h?view=diff&rev=501253&r1=501252&r2=501253 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h (original) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h Mon Jan 29 16:36:23 2007 @@ -23,20 +23,17 @@ #pragma warning( disable : 4290 ) #endif -#include -#include -#include +#include +#include namespace activemq{ namespace connector{ namespace openwire{ namespace commands{ - class ActiveMQObjectMessage : public ActiveMQMessage + class ActiveMQObjectMessage : + public ActiveMQMessageBase { - protected: - - public: const static unsigned char ID_ACTIVEMQOBJECTMESSAGE = 26; @@ -65,21 +62,21 @@ * @return src - Source Object */ virtual void copyDataStructure( const DataStructure* src ) { - ActiveMQMessage::copyDataStructure( src ); + ActiveMQMessageBase::copyDataStructure( src ); } - - - public: // ActiveMQMessage - + + public: // cms::Message + /** - * Returns if this message has expired, meaning that its - * Expiration time has elapsed. - * @returns true if message is expired. + * Clonse this message exactly, returns a new instance that the + * caller is required to delete. + * @return new copy of this message */ - virtual bool isExpired() const { - return false; + virtual cms::Message* clone(void) const { + return dynamic_cast( + this->cloneDataStructure() ); } - + }; }}}} Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.cpp URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.cpp?view=diff&rev=501253&r1=501252&r2=501253 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.cpp (original) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.cpp Mon Jan 29 16:36:23 2007 @@ -15,7 +15,6 @@ * limitations under the License. */ #include -#include using namespace std; using namespace activemq; @@ -24,7 +23,8 @@ using namespace activemq::connector::openwire::commands; //////////////////////////////////////////////////////////////////////////////// -ActiveMQTextMessage::ActiveMQTextMessage() +ActiveMQTextMessage::ActiveMQTextMessage() : + ActiveMQMessageBase() { } @@ -40,17 +40,34 @@ } //////////////////////////////////////////////////////////////////////////////// -void ActiveMQTextMessage::acknowledge(void) const throw( cms::CMSException ) { +std::string ActiveMQTextMessage::getText() const throw( cms::CMSException ) { try{ - this->getAckHandler()->acknowledgeMessage( this ); + return std::string( getContent()[0], getContent().size() ); } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) } +//////////////////////////////////////////////////////////////////////////////// +void ActiveMQTextMessage::setText( const char* msg ) throw( cms::CMSException ) { + try{ + int length = strlen( msg ); + for( int i = 0; i < length; ++i ){ + getContent().push_back( msg[i] ); + } + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} //////////////////////////////////////////////////////////////////////////////// -std::string ActiveMQTextMessage::getCMSMessageId(void) const { - return marshal::BaseDataStreamMarshaller::toString( this->getMessageId() ); +void ActiveMQTextMessage::setText( const std::string& msg ) throw( cms::CMSException ) { + try{ + for( size_t i = 0; i < msg.length(); ++i ){ + getContent().push_back( msg[i] ); + } + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) } Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h?view=diff&rev=501253&r1=501252&r2=501253 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h (original) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h Mon Jan 29 16:36:23 2007 @@ -23,8 +23,7 @@ #pragma warning( disable : 4290 ) #endif -#include -#include +#include #include #include #include @@ -34,8 +33,8 @@ namespace openwire{ namespace commands{ - class ActiveMQTextMessage : public ActiveMQMessage, - public cms::TextMessage + class ActiveMQTextMessage : + public ActiveMQMessageBase { public: @@ -65,7 +64,7 @@ * @return src - Source Object */ virtual void copyDataStructure( const DataStructure* src ) { - ActiveMQMessage::copyDataStructure( src ); + ActiveMQMessageBase::copyDataStructure( src ); } public: // CMS Message @@ -80,335 +79,7 @@ this->cloneDataStructure() ); } - /** - * Acknowledges all consumed messages of the session - * of this consumed message. - */ - virtual void acknowledge(void) const throw( cms::CMSException ); - - /** - * Clears out the body of the message. This does not clear the - * headers or properties. - */ - virtual void clearBody(); - - /** - * Clears the message properties. Does not clear the body or - * header values. - */ - virtual void clearProperties(); - - /** - * Retrieves the propery names. - * @return The complete set of property names currently in this - * message. - */ - virtual std::vector getPropertyNames() const ; - - /** - * Indicates whether or not a given property exists. - * @param name The name of the property to look up. - * @return True if the property exists in this message. - */ - virtual bool propertyExists( const std::string& name ) const; - - /** - * Gets a boolean property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual bool getBooleanProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a byte property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual unsigned char getByteProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a double property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual double getDoubleProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a float property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual float getFloatProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a int property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual int getIntProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a long property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual long long getLongProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a short property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual short getShortProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Gets a string property. - * @param name The name of the property to retrieve. - * @return The value for the named property. - * @throws CMSException if the property does not exist. - */ - virtual std::string getStringProperty( const std::string& name ) const - throw( cms::CMSException ); - - /** - * Sets a boolean property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setBooleanProperty( const std::string& name, - bool value ) throw( cms::CMSException ); - - /** - * Sets a byte property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setByteProperty( const std::string& name, - unsigned char value ) throw( cms::CMSException ); - - /** - * Sets a double property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setDoubleProperty( const std::string& name, - double value ) throw( cms::CMSException ); - - /** - * Sets a float property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setFloatProperty( const std::string& name, - float value ) throw( cms::CMSException ); - - /** - * Sets a int property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setIntProperty( const std::string& name, - int value ) throw( cms::CMSException ); - - /** - * Sets a long property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setLongProperty( const std::string& name, - long long value ) throw( cms::CMSException ); - - /** - * Sets a short property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setShortProperty( const std::string& name, - short value ) throw( cms::CMSException ); - - /** - * Sets a string property. - * @param name The name of the property to retrieve. - * @param value The value for the named property. - * @throws CMSException - */ - virtual void setStringProperty( const std::string& name, - const std::string& value ) throw( cms::CMSException ); - - /** - * Get the Correlation Id for this message - * @return string representation of the correlation Id - */ - virtual std::string getCMSCorrelationId(void) const { - return this->getCorrelationId(); - } - - /** - * Sets the Correlation Id used by this message - * @param correlationId - String representing the correlation id. - */ - virtual void setCMSCorrelationId( const std::string& correlationId ) { - this->setCorrelationId( correlationId ); - } - - /** - * Gets the DeliveryMode for this message - * @return DeliveryMode enumerated value. - */ - virtual int getCMSDeliveryMode(void) const { - return this->isPersistent(); - } - - /** - * Sets the DeliveryMode for this message - * @param mode - DeliveryMode enumerated value. - */ - virtual void setCMSDeliveryMode( int mode ) { - this->setPersistent( mode != 0 ); - } - - /** - * Gets the Destination for this Message, returns a - * @return Destination object - */ - virtual const cms::Destination* getCMSDestination(void) const { - return dynamic_cast( - this->getDestination() ); - } - - /** - * Sets the Destination for this message - * @param destination - Destination Object - */ - virtual void setCMSDestination( const cms::Destination* destination AMQCPP_UNUSED ) { -// this->setDestination( -// dynamic_cast( destination ) ); - } - - /** - * Gets the Expiration Time for this Message - * @return time value - */ - virtual long long getCMSExpiration(void) const { - return this->getExpiration(); - } - - /** - * Sets the Expiration Time for this message - * @param expireTime - time value - */ - virtual void setCMSExpiration( long long expireTime ) { - this->setExpiration( expireTime ); - } - - /** - * Gets the CMS Message Id for this Message - * @return time value - */ - virtual std::string getCMSMessageId(void) const; - - /** - * Sets the CMS Message Id for this message - * @param id - time value - */ - virtual void setCMSMessageId( const std::string& id AMQCPP_UNUSED ) {} - - /** - * Gets the Priority Value for this Message - * @return priority value - */ - virtual int getCMSPriority(void) const { - return this->getPriority(); - } - - /** - * Sets the Priority Value for this message - * @param priority - priority value for this message - */ - virtual void setCMSPriority( int priority ) { - this->setPriority( priority ); - } - - /** - * Gets the Redelivered Flag for this Message - * @return redelivered value - */ - virtual bool getCMSRedelivered(void) const { - return this->getRedeliveryCounter() != 0; - } - - /** - * Sets the Redelivered Flag for this message - * @param redelivered - boolean redelivered value - */ - virtual void setCMSRedelivered( bool redelivered AMQCPP_UNUSED ) {} - - /** - * Gets the CMS Reply To Address for this Message - * @return Reply To Value - */ - virtual const cms::Destination* getCMSReplyTo(void) const; - - /** - * Sets the CMS Reply To Address for this message - * @param id - Reply To value - */ - virtual void setCMSReplyTo( const cms::Destination* destination ); - - /** - * Gets the Time Stamp for this Message - * @return time stamp value - */ - virtual long long getCMSTimeStamp(void) const { - return this->getTimestamp(); - } - - /** - * Sets the Time Stamp for this message - * @param timeStamp - integer time stamp value - */ - virtual void setCMSTimeStamp( long long timeStamp ) { - this->setTimestamp( timeStamp ); - } - - /** - * Gets the CMS Message Type for this Message - * @return type value - */ - virtual std::string getCMSMessageType(void) const { - return this->getType(); - } - - /** - * Sets the CMS Message Type for this message - * @param type - message type value string - */ - virtual void setCMSMessageType( const std::string& type ) { - this->setType( type ); - } - - public: // CMS TextMessage + public: // cms::TextMessage /** * Gets the message character buffer. @@ -428,22 +99,6 @@ * @param msg The message buffer. */ virtual void setText( const std::string& msg ) throw( cms::CMSException ); - - public: // ActiveMQMessage - - /** - * Returns if this message has expired, meaning that its - * Expiration time has elapsed. - * @returns true if message is expired. - */ - virtual bool isExpired() const { - long long expireTime = this->getCMSExpiration(); - long long currentTime = util::Date::getCurrentTimeMilliseconds(); - if( expireTime > 0 && currentTime > expireTime ) { - return true; - } - return false; - } };