Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 83227 invoked from network); 2 Oct 2006 14:31:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Oct 2006 14:31:35 -0000 Received: (qmail 70227 invoked by uid 500); 2 Oct 2006 14:31:35 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 70174 invoked by uid 500); 2 Oct 2006 14:31:35 -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 70111 invoked by uid 99); 2 Oct 2006 14:31:35 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 07:31:35 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [140.211.166.113] ([140.211.166.113:62141] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 98/6B-16499-0B221254 for ; Mon, 02 Oct 2006 07:31:15 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id E3B451A981D; Mon, 2 Oct 2006 07:30:37 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r452053 [2/17] - in /incubator/activemq/activemq-cpp/trunk/activemq-cpp/src: main/activemq/connector/openwire/ main/activemq/connector/openwire/commands/ main/activemq/connector/openwire/marshal/ main/activemq/connector/openwire/marshal/V2/... Date: Mon, 02 Oct 2006 14:30:22 -0000 To: activemq-commits@geronimo.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061002143037.E3B451A981D@eris.apache.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Added: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandReader.h URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandReader.h?view=auto&rev=452053 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandReader.h (added) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandReader.h Mon Oct 2 07:30:10 2006 @@ -0,0 +1,99 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECOMMANDREADER_H_ +#define _ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECOMMANDREADER_H_ + +#include +#include +#include +#include + +namespace activemq{ +namespace connector{ +namespace openwire{ + + class OpenwireCommandReader : public transport::CommandReader + { + private: + + /** + * The target input stream. + */ + io::InputStream* inputStream; + + public: + + /** + * Deafult Constructor + */ + OpenwireCommandReader( void ); + + /** + * Constructor. + * @param is the target input stream. + */ + OpenwireCommandReader( io::InputStream* is ); + + virtual ~OpenwireCommandReader(void) {} + + /** + * Reads a command from the given input stream. + * @return The next command available on the stream. + * @throws CommandIOException if a problem occurs during the read. + */ + virtual transport::Command* readCommand(void) + throw ( transport::CommandIOException ); + + /** + * Sets the target input stream. + * @param Target Input Stream + */ + virtual void setInputStream( io::InputStream* is ){ + inputStream = is; + } + + /** + * Gets the target input stream. + * @return Target Input Stream + */ + virtual io::InputStream* getInputStream(void){ + return inputStream; + } + + /** + * Attempts to read an array of bytes from the stream. + * @param buffer The target byte buffer. + * @param count The number of bytes to read. + * @return The number of bytes read. + * @throws IOException thrown if an error occurs. + */ + virtual int read( unsigned char* buffer, int count ) + throw( io::IOException ); + + /** + * Attempts to read a byte from the input stream + * @return The byte. + * @throws IOException thrown if an error occurs. + */ + virtual unsigned char readByte(void) throw( io::IOException ); + + }; + +}}} + +#endif /*_ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECOMMANDREADER_H_*/ Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandReader.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandWriter.cpp URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandWriter.cpp?view=auto&rev=452053 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandWriter.cpp (added) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandWriter.cpp Mon Oct 2 07:30:10 2006 @@ -0,0 +1,93 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "OpenwireCommandWriter.h" + +using namespace std; +using namespace activemq; +using namespace activemq::connector; +using namespace activemq::connector::openwire; +using namespace activemq::transport; +using namespace activemq::io; +using namespace activemq::exceptions; + +//////////////////////////////////////////////////////////////////////////////// +OpenwireCommandWriter::OpenwireCommandWriter(void) +{ + outputStream = NULL; +} + +//////////////////////////////////////////////////////////////////////////////// +OpenwireCommandWriter::OpenwireCommandWriter( OutputStream* os ) +{ + outputStream = os; +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireCommandWriter::writeCommand( const Command* command ) + throw ( transport::CommandIOException ) +{ + try + { + if( outputStream == NULL ) + { + throw CommandIOException( + __FILE__, __LINE__, + "OpenwireCommandWriter::writeCommand - " + "output stream is NULL" ); + } + + // TODO + } + AMQ_CATCH_RETHROW( CommandIOException ) + AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, CommandIOException ) + AMQ_CATCHALL_THROW( CommandIOException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireCommandWriter::write( const unsigned char* buffer, int count ) + throw( IOException ) +{ + if( outputStream == NULL ) + { + throw IOException( + __FILE__, __LINE__, + "OpenwireCommandWriter::write(char*,int) - input stream is NULL" ); + } + + outputStream->write( buffer, count ); +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireCommandWriter::writeByte( unsigned char v ) throw( IOException ) +{ + if( outputStream == NULL ) + { + throw IOException( + __FILE__, __LINE__, + "OpenwireCommandWriter::write(char) - input stream is NULL" ); + } + + outputStream->write( v ); +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireCommandWriter::write( const char* buffer, int count ) + throw( io::IOException ) +{ + write( reinterpret_cast( buffer ), count ); +} Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandWriter.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandWriter.h URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandWriter.h?view=auto&rev=452053 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandWriter.h (added) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandWriter.h Mon Oct 2 07:30:10 2006 @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECOMMANDWRITER_H_ +#define _ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECOMMANDWRITER_H_ + +#include +#include +#include +#include +#include + +using namespace activemq{ +using namespace connector{ +using namespace openwire{ + + class OpenwireCommandWriter : public transport::CommandWriter + { + private: + + /** + * Target output stream. + */ + io::OutputStream* outputStream; + + /** + * Marshaler of Stomp Commands + */ + marshal::Marshaler marshaler; + + public: + + /** + * Default Constructor + */ + OpenwireCommandWriter(void); + + /** + * Constructor. + * @param os the target output stream. + */ + OpenwireCommandWriter( io::OutputStream* os ); + + virtual ~OpenwireCommandWriter(void) {} + + /** + * Sets the target output stream. + */ + virtual void setOutputStream( io::OutputStream* os ){ + outputStream = os; + } + + /** + * Gets the target output stream. + */ + virtual io::OutputStream* getOutputStream(void){ + return outputStream; + } + + /** + * Writes a command to the given output stream. + * @param command the command to write. + * @param os the target stream for the write. + * @throws CommandIOException if a problem occurs during the write. + */ + virtual void writeCommand( const transport::Command* command ) + throw ( transport::CommandIOException ); + + /** + * Writes a byte array to the output stream. + * @param buffer a byte array + * @param count the number of bytes in the array to write. + * @throws IOException thrown if an error occurs. + */ + virtual void write( const unsigned char* buffer, int count ) + throw( io::IOException ); + + /** + * Writes a byte to the output stream. + * @param v The value to be written. + * @throws IOException thrown if an error occurs. + */ + virtual void writeByte( unsigned char v ) throw( io::IOException ); + + }; + +}}} + +#endif /*_ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECOMMANDWRITER_H_*/ Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireCommandWriter.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.cpp URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.cpp?view=auto&rev=452053 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.cpp (added) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.cpp Mon Oct 2 07:30:10 2006 @@ -0,0 +1,567 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include +#include +#include +#include + +using namespace std; +using namespace activemq; +using namespace activemq::connector; +using namespace activemq::util; +using namespace activemq::transport; +using namespace activemq::exceptions; +using namespace activemq::connector::openwire; + +//////////////////////////////////////////////////////////////////////////////// +OpenwireConnector::OpenwireConnector( Transport* transport, + const util::Properties& properties ) + throw ( IllegalArgumentException ) +{ + if( transport == NULL ) + { + throw IllegalArgumentException( + __FILE__, __LINE__, + "OpenwireConnector::OpenwireConnector - Transport cannot be NULL"); + } + + this->transport = transport; + this->state = DISCONNECTED; + this->exceptionListener = NULL; + this->messageListener = NULL; + this->nextProducerId = 1; + this->nextTransactionId = 1; + this->properties.copy( &properties ); + + // Observe the transport for events. + this->transport->setCommandListener( this ); + this->transport->setTransportExceptionListener( this ); + + // Setup the reader and writer in the transport. + this->transport->setCommandReader( &reader ); + this->transport->setCommandWriter( &writer ); +} + +//////////////////////////////////////////////////////////////////////////////// +OpenwireConnector::~OpenwireConnector(void) +{ + try + { + close(); + + // TODO - Add any cleanup code here + } + AMQ_CATCH_NOTHROW( ActiveMQException ) + AMQ_CATCHALL_NOTHROW( ) +} + +//////////////////////////////////////////////////////////////////////////////// +unsigned int OpenwireConnector::getNextProducerId(void) +{ + synchronized( &mutex ) + { + return nextProducerId++; + } + + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// +unsigned int OpenwireConnector::getNextTransactionId(void) +{ + synchronized( &mutex ) + { + return nextTransactionId++; + } + + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::enforceConnected( void ) throw ( ConnectorException ) +{ + if( state != CONNECTED ) + { + throw OpenwireConnectorException( + __FILE__, __LINE__, + "OpenwireConnector::enforceConnected - Not Connected!" ); + } +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::start(void) throw( cms::CMSException ) +{ + try + { + synchronized( &mutex ) + { + if( state == CONNECTED ) + { + throw ActiveMQException( + __FILE__, __LINE__, + "OpenwireConnector::start - already started" ); + } + + // Start the transport - this establishes the socket. + transport->start(); + + // Send the connect message to the broker. + connect(); + } + } + AMQ_CATCH_RETHROW( ActiveMQException ) + AMQ_CATCHALL_THROW( ActiveMQException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::close(void) throw( cms::CMSException ){ + + try + { + synchronized( &mutex ) + { + if( state == this->CONNECTED ) + { + // Send the disconnect message to the broker. + disconnect(); + + // Close the transport. + transport->close(); + } + } + } + AMQ_CATCH_RETHROW( ActiveMQException ) + AMQ_CATCHALL_THROW( ActiveMQException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::connect(void) +{ + try + { + // Mark this connector as started. + state = this->CONNECTING; + + // TODO - Create a Connect Command + + // Encode User Name and Password and Client ID + string login = getUsername(); + if( login.length() > 0 ){ + cmd.setLogin( login ); + } + string password = getPassword(); + if( password.length() > 0 ){ + cmd.setPassword( password ); + } + string clientId = getClientId(); + if( clientId.length() > 0 ){ + cmd.setClientId( clientId ); + } + +// Response* response = transport->request( &cmd ); +// +// if( dynamic_cast< ExceptionResponse* >( response ) != NULL ) +// { +// delete response; +// +// throw OpenwireConnectorException( +// __FILE__, __LINE__, +// "OpenwireConnector::connect - Failed on Connect Request" ); +// } + +// ConnectedCommand* connected = +// dynamic_cast< ConnectedCommand* >( response ); +// +// if( connected == NULL ) +// { +// delete response; +// +// throw OpenwireConnectorException( +// __FILE__, __LINE__, +// "OpenwireConnector::connect - " +// "Response not a connected response" ); +// } + + // TODO + + // Tag us in the Connected State now. + state = CONNECTED; + + // Clean up + delete response; + } + AMQ_CATCH_RETHROW( BrokerError ) + AMQ_CATCH_RETHROW( ActiveMQException ) + AMQ_CATCHALL_THROW( ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::disconnect(void) +{ + try + { + // Mark state as no longer connected. + state = this->DISCONNECTED; + + // TODO + } + AMQ_CATCH_RETHROW( ActiveMQException ) + AMQ_CATCHALL_THROW( ActiveMQException ); +} + +//////////////////////////////////////////////////////////////////////////////// +SessionInfo* OpenwireConnector::createSession( + cms::Session::AcknowledgeMode ackMode ) + throw( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +ConsumerInfo* OpenwireConnector::createConsumer( + const cms::Destination* destination, + SessionInfo* session, + const std::string& selector ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +ConsumerInfo* OpenwireConnector::createDurableConsumer( + const cms::Topic* topic, + SessionInfo* session, + const std::string& name, + const std::string& selector, + bool noLocal ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +ProducerInfo* OpenwireConnector::createProducer( + const cms::Destination* destination, + SessionInfo* session ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +cms::Topic* OpenwireConnector::createTopic( const std::string& name, + SessionInfo* session ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +cms::Queue* OpenwireConnector::createQueue( const std::string& name, + SessionInfo* session ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +cms::TemporaryTopic* OpenwireConnector::createTemporaryTopic( + SessionInfo* session ) + throw ( ConnectorException ) +{ + try + { + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +cms::TemporaryQueue* OpenwireConnector::createTemporaryQueue( + SessionInfo* session ) + throw ( ConnectorException ) +{ + try + { + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::send( cms::Message* message, + ProducerInfo* producerInfo ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::send( std::list& messages, + ProducerInfo* producerInfo ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + list< cms::Message* >::const_iterator itr = messages.begin(); + + for( ; itr != messages.end(); ++itr ) + { + this->send( *itr, producerInfo ); + } + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::acknowledge( const SessionInfo* session, + const cms::Message* message, + AckType ackType = ConsumedAck ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +TransactionInfo* OpenwireConnector::startTransaction( + SessionInfo* session ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::commit( TransactionInfo* transaction, + SessionInfo* session ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::rollback( TransactionInfo* transaction, + SessionInfo* session ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +cms::Message* OpenwireConnector::createMessage( + SessionInfo* session, + TransactionInfo* transaction ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +cms::BytesMessage* OpenwireConnector::createBytesMessage( + SessionInfo* session, + TransactionInfo* transaction ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +cms::TextMessage* OpenwireConnector::createTextMessage( + SessionInfo* session, + TransactionInfo* transaction ) + throw ( ConnectorException ) +{ + try + { + enforceConnected(); + + // TODO + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +cms::MapMessage* OpenwireConnector::createMapMessage( + SessionInfo* session, + TransactionInfo* transaction ) + throw ( ConnectorException ) +{ + try + { + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::unsubscribe( const std::string& name ) + throw ( ConnectorException ) +{ + try + { + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::destroyResource( ConnectorResource* resource ) + throw ( ConnectorException ) +{ + try + { + ConsumerInfo* consumer = + dynamic_cast(resource); + SessionInfo* session = + dynamic_cast(resource); + + // TODO + + // No matter what we end it here. + delete resource; + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::onCommand( transport::Command* command ) +{ + try + { + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void OpenwireConnector::onTransportException( + transport::Transport* source, + const exceptions::ActiveMQException& ex ) +{ + try + { + // Inform the user. + fire( ex ); + + // Close down. + close(); + } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCHALL_THROW( ConnectorException ); +} Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.h URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.h?view=auto&rev=452053 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.h (added) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.h Mon Oct 2 07:30:10 2006 @@ -0,0 +1,512 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECONNECTOR_H_ +#define _ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECONNECTOR_H_ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace activemq{ +namespace connector{ +namespace openwire{ + + class OpenwireConnector : + public Connector + public transport::CommandListener, + public transport::TransportExceptionListener + { + private: + + // Flags the state we are in for connection to broker. + enum connectionState + { + DISCONNECTED, + CONNECTING, + CONNECTED + }; + + private: + + /** + * The transport for sending/receiving commands on the wire. + */ + transport::Transport* transport; + + /** + * Flag to indicate the start state of the connector. + */ + connectionState state; + + /** + * Sync object. + */ + concurrent::Mutex mutex; + + /** + * Observer of messages directed at a particular + * consumer. + */ + ConsumerMessageListener* messageListener; + + /** + * Observer of connector exceptions. + */ + cms::ExceptionListener* exceptionListener; + + /** + * This Connector's Command Reader + */ + OpenwireCommandReader reader; + + /** + * This Connector's Command Writer + */ + OpenwireCommandWriter writer; + + /** + * Next avaliable Producer Id + */ + unsigned int nextProducerId; + + /** + * Next avaliable Transaction Id + */ + unsigned int nextTransactionId; + + /** + * Properties for the connector. + */ + util::SimpleProperties properties; + + private: + + /** + * Sends the connect message to the broker and + * waits for the response. + */ + void connect(void); + + /** + * Sends a oneway disconnect message to the broker. + */ + void disconnect(void); + + /** + * Fires a consumer message to the observer. + * @param msg - the message to file + */ + void fire( ConsumerInfo* consumer, core::ActiveMQMessage* msg ){ + try{ + if( messageListener != NULL ){ + messageListener->onConsumerMessage( + consumer, + msg ); + } + }catch( ... ){/* do nothing*/} + } + + /** + * Fires an exception event to the observing object. + * @param ex - the exception to fire. + */ + void fire( const exceptions::ActiveMQException& ex ){ + try{ + if( exceptionListener != NULL ){ + exceptionListener->onException( ex ); + } + }catch( ... ){/* do nothing*/} + } + + public: + + /** + * Constructor for the openwire connector. + * @param transport - the transport object for sending/receiving + * commands on the wire. + * @param properties - properties for configuring the connector. + */ + OpenwireConnector( transport::Transport* transport, + const util::Properties& properties ) + throw ( exceptions::IllegalArgumentException ); + + virtual ~OpenwireConnector(); + + /** + * Starts the service. + * @throws CMSException + */ + virtual void start(void) throw( cms::CMSException ); + + /** + * Closes this object and deallocates the appropriate resources. + * @throws CMSException + */ + virtual void close(void) throw( cms::CMSException ); + + /** + * Gets the Client Id for this connection, if this + * connection has been closed, then this method returns "" + * @return Client Id String + */ + virtual std::string getClientId(void) const { + return properties.getProperty( + core::ActiveMQConstants::toString( + core::ActiveMQConstants::PARAM_CLIENTID ), "" ); + } + + /** + * Gets the Username for this connection, if this + * connection has been closed, then this method returns "" + * @return Username String + */ + virtual std::string getUsername(void) const { + return properties.getProperty( + core::ActiveMQConstants::toString( + core::ActiveMQConstants::PARAM_USERNAME ), "" ); + } + + /** + * Gets the Password for this connection, if this + * connection has been closed, then this method returns "" + * @return Password String + */ + virtual std::string getPassword(void) const { + return properties.getProperty( + core::ActiveMQConstants::toString( + core::ActiveMQConstants::PARAM_PASSWORD ), "" ); + } + + /** + * Gets a reference to the Transport that this connection + * is using. + * @param reference to a transport + * @throws InvalidStateException if the Transport is not set + */ + virtual transport::Transport& getTransport(void) const + throw ( exceptions::InvalidStateException ) { + + if( transport == NULL ) { + throw exceptions::InvalidStateException( + __FILE__, __LINE__, + "OpenwireConnector::getTransport - " + "Invalid State, No Transport."); + } + + return *transport; + } + + /** + * Creates a Session Info object for this connector + * @param Acknowledgement Mode of the Session + * @returns Session Info Object + * @throws ConnectorException + */ + virtual SessionInfo* createSession( + cms::Session::AcknowledgeMode ackMode ) + throw( ConnectorException ); + + /** + * Create a Consumer for the given Session + * @param Destination to Subscribe to. + * @param Session Information. + * @return Consumer Information + * @throws ConnectorException + */ + virtual ConsumerInfo* createConsumer( + const cms::Destination* destination, + SessionInfo* session, + const std::string& selector = "" ) + throw ( ConnectorException ); + + /** + * Create a Durable Consumer for the given Session + * @param Topic to Subscribe to. + * @param Session Information. + * @param name of the Durable Topic + * @param Selector + * @param if set, inhibits the delivery of messages + * published by its own connection + * @return Consumer Information + * @throws ConnectorException + */ + virtual ConsumerInfo* createDurableConsumer( + const cms::Topic* topic, + SessionInfo* session, + const std::string& name, + const std::string& selector = "", + bool noLocal = false ) + throw ( ConnectorException ); + + /** + * Create a Consumer for the given Session + * @param Destination to Subscribe to. + * @param Session Information. + * @return Producer Information + * @throws ConnectorException + */ + virtual ProducerInfo* createProducer( + const cms::Destination* destination, + SessionInfo* session) + throw ( ConnectorException ); + + /** + * Creates a Topic given a name and session info + * @param Topic Name + * @param Session Information + * @return a newly created Topic Object + * @throws ConnectorException + */ + virtual cms::Topic* createTopic( const std::string& name, + SessionInfo* session ) + throw ( ConnectorException ); + + /** + * Creates a Queue given a name and session info + * @param Queue Name + * @param Session Information + * @return a newly created Queue Object + * @throws ConnectorException + */ + virtual cms::Queue* createQueue( const std::string& name, + SessionInfo* session ) + throw ( ConnectorException ); + + /** + * Creates a Temporary Topic given a name and session info + * @param Temporary Topic Name + * @param Session Information + * @return a newly created Temporary Topic Object + * @throws ConnectorException + */ + virtual cms::TemporaryTopic* createTemporaryTopic( + SessionInfo* session ) + throw ( ConnectorException ); + + /** + * Creates a Temporary Queue given a name and session info + * @param Temporary Queue Name + * @param Session Information + * @return a newly created Temporary Queue Object + * @throws ConnectorException + */ + virtual cms::TemporaryQueue* createTemporaryQueue( + SessionInfo* session ) + throw ( ConnectorException ); + + /** + * Sends a Message + * @param The Message to send. + * @param Producer Info for the sender of this message + * @throws ConnectorException + */ + virtual void send( cms::Message* message, ProducerInfo* producerInfo ) + throw ( ConnectorException ); + + /** + * Sends a set of Messages + * @param List of Messages to send. + * @param Producer Info for the sender of this message + * @throws ConnectorException + */ + virtual void send( std::list& messages, + ProducerInfo* producerInfo ) + throw ( ConnectorException ); + + /** + * Acknowledges a Message + * @param An ActiveMQMessage to Ack. + * @throws ConnectorException + */ + virtual void acknowledge( const SessionInfo* session, + const cms::Message* message, + AckType ackType ) + throw ( ConnectorException ); + + /** + * Starts a new Transaction. + * @param Session Information + * @throws ConnectorException + */ + virtual TransactionInfo* startTransaction( + SessionInfo* session ) + throw ( ConnectorException ); + + /** + * Commits a Transaction. + * @param The Transaction information + * @param Session Information + * @throws ConnectorException + */ + virtual void commit( TransactionInfo* transaction, + SessionInfo* session ) + throw ( ConnectorException ); + + /** + * Rolls back a Transaction. + * @param The Transaction information + * @param Session Information + * @throws ConnectorException + */ + virtual void rollback( TransactionInfo* transaction, + SessionInfo* session ) + throw ( ConnectorException ); + + /** + * Creates a new Message. + * @param Session Information + * @param Transaction Info for this Message + * @throws ConnectorException + */ + virtual cms::Message* createMessage( + SessionInfo* session, + TransactionInfo* transaction ) + throw ( ConnectorException ); + + /** + * Creates a new BytesMessage. + * @param Session Information + * @param Transaction Info for this Message + * @throws ConnectorException + */ + virtual cms::BytesMessage* createBytesMessage( + SessionInfo* session, + TransactionInfo* transaction ) + throw ( ConnectorException ); + + /** + * Creates a new TextMessage. + * @param Session Information + * @param Transaction Info for this Message + * @throws ConnectorException + */ + virtual cms::TextMessage* createTextMessage( + SessionInfo* session, + TransactionInfo* transaction ) + throw ( ConnectorException ); + + /** + * Creates a new MapMessage. + * @param Session Information + * @param Transaction Info for this Message + * @throws ConnectorException + */ + virtual cms::MapMessage* createMapMessage( + SessionInfo* session, + TransactionInfo* transaction ) + throw ( ConnectorException ); + + /** + * Unsubscribe from a givenDurable Subscription + * @param name of the Subscription + * @throws ConnectorException + */ + virtual void unsubscribe( const std::string& name ) + throw ( ConnectorException ); + + /** + * Destroys the given connector resource. + * @param resource the resource to be destroyed. + * @throws ConnectorException + */ + virtual void destroyResource( ConnectorResource* resource ) + throw ( ConnectorException ); + + /** + * Sets the listener of consumer messages. + * @param listener the observer. + */ + virtual void setConsumerMessageListener( + ConsumerMessageListener* listener ) + { + this->messageListener = listener; + } + + /** + * Sets the Listner of exceptions for this connector + * @param ExceptionListener the observer. + */ + virtual void setExceptionListener( + cms::ExceptionListener* listener ) + { + this->exceptionListener = listener; + } + + public: // transport::CommandListener + + /** + * Event handler for the receipt of a non-response command from the + * transport. + * @param command the received command object. + */ + virtual void onCommand( transport::Command* command ); + + public: // TransportExceptionListener + + /** + * Event handler for an exception from a command transport. + * @param source The source of the exception + * @param ex The exception. + */ + virtual void onTransportException( + transport::Transport* source, + const exceptions::ActiveMQException& ex ); + + private: + + unsigned int getNextProducerId(void); + unsigned int getNextTransactionId(void); + + // Check for Connected State and Throw an exception if not. + void enforceConnected( void ) throw ( ConnectorException ); + + }; + +}}} + +#endif /*_ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECONNECTOR_H_*/ Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnectorException.h URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnectorException.h?view=auto&rev=452053 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnectorException.h (added) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnectorException.h Mon Oct 2 07:30:10 2006 @@ -0,0 +1,68 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECONNECTOREXCEPTION_H_ +#define ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECONNECTOREXCEPTION_H_ + +#include + +namespace activemq{ +namespace connector{ +namespace openwire{ + + /* + * Signals that an Connector exception of some sort has occurred. + */ + class OpenwireConnectorException : public connector::ConnectorException + { + public: + + OpenwireConnectorException() {} + OpenwireConnectorException( const exceptions::ActiveMQException& ex ){ + *( exceptions::ActiveMQException* )this = ex; + } + OpenwireConnectorException( const OpenwireConnectorException& ex ){ + *( exceptions::ActiveMQException* )this = ex; + } + OpenwireConnectorException( const char* file, + const int lineNumber, + const char* msg, ... ) + { + va_list vargs; + va_start( vargs, msg ); + buildMessage( msg, vargs ); + + // Set the first mark for this exception. + setMark( file, lineNumber ); + } + + /** + * Clones this exception. This is useful for cases where you need + * to preserve the type of the original exception as well as the message. + * All subclasses should override. + */ + virtual exceptions::ActiveMQException* clone() const{ + return new OpenwireConnectorException( *this ); + } + + virtual ~OpenwireConnectorException() {} + + }; + +}}} + +#endif /*ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECONNECTOREXCEPTION_H_*/ Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnectorException.h ------------------------------------------------------------------------------ svn:eol-style = native Added: 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=auto&rev=452053 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp (added) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp Mon Oct 2 07:30:10 2006 @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +using namespace std; +using namespace activemq; +using namespace activemq::connector; +using namespace activemq::connector::openwire; +using namespace activemq::connector::openwire::commands; + +/* + * + * Command and marshalling code for OpenWire format for ActiveMQBytesMessage + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Java Classes in the + * activemq-core module + * + */ +//////////////////////////////////////////////////////////////////////////////// +ActiveMQBytesMessage::ActiveMQBytesMessage() +{ +} + +//////////////////////////////////////////////////////////////////////////////// +ActiveMQBytesMessage::~ActiveMQBytesMessage() +{ +} + +//////////////////////////////////////////////////////////////////////////////// +unsigned char ActiveMQBytesMessage::getDataStructureType() const +{ + return ActiveMQBytesMessage::ID_ACTIVEMQBYTESMESSAGE; +} + Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: 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=auto&rev=452053 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h (added) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h Mon Oct 2 07:30:10 2006 @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _ACTIVEMQ_CONNECTOR_OPENWIRE_COMMANDS_ACTIVEMQBYTESMESSAGE_H_ +#define _ACTIVEMQ_CONNECTOR_OPENWIRE_COMMANDS_ACTIVEMQBYTESMESSAGE_H_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include +#include + +namespace activemq{ +namespace connector{ +namespace openwire{ +namespace commands{ + + /* + * + * Command and marshalling code for OpenWire format for ${className} + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Java Classes + * in the activemq-openwire-generator module + * + */ + class ActiveMQBytesMessage : public ActiveMQMessage + { + protected: + + + public: + + const static unsigned char ID_ACTIVEMQBYTESMESSAGE = 24; + + public: + + ActiveMQBytesMessage(); + virtual ~ActiveMQBytesMessage(); + + virtual unsigned char getDataStructureType() const; + }; + +}}}} + +#endif /*_ACTIVEMQ_CONNECTOR_OPENWIRE_COMMANDS_ACTIVEMQBYTESMESSAGE_H_*/ + Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.cpp URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.cpp?view=auto&rev=452053 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.cpp (added) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.cpp Mon Oct 2 07:30:10 2006 @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +using namespace std; +using namespace activemq; +using namespace activemq::connector; +using namespace activemq::connector::openwire; +using namespace activemq::connector::openwire::commands; + +/* + * + * Command and marshalling code for OpenWire format for ActiveMQDestination + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Java Classes in the + * activemq-core module + * + */ +//////////////////////////////////////////////////////////////////////////////// +ActiveMQDestination::ActiveMQDestination() +{ + this->physicalName = ""; +} + +//////////////////////////////////////////////////////////////////////////////// +ActiveMQDestination::~ActiveMQDestination() +{ +} + +//////////////////////////////////////////////////////////////////////////////// +unsigned char ActiveMQDestination::getDataStructureType() const +{ + return ActiveMQDestination::ID_ACTIVEMQDESTINATION; +} + +//////////////////////////////////////////////////////////////////////////////// +const std::string& ActiveMQDestination::getPhysicalName() const { + return physicalName; +} + +//////////////////////////////////////////////////////////////////////////////// +std::string& ActiveMQDestination::getPhysicalName() { + return physicalName; +} + +//////////////////////////////////////////////////////////////////////////////// +void ActiveMQDestination::setPhysicalName(const std::string& physicalName ) { + this->physicalName = physicalName; +} + Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.h URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.h?view=auto&rev=452053 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.h (added) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.h Mon Oct 2 07:30:10 2006 @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _ACTIVEMQ_CONNECTOR_OPENWIRE_COMMANDS_ACTIVEMQDESTINATION_H_ +#define _ACTIVEMQ_CONNECTOR_OPENWIRE_COMMANDS_ACTIVEMQDESTINATION_H_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include + +namespace activemq{ +namespace connector{ +namespace openwire{ +namespace commands{ + + /* + * + * Command and marshalling code for OpenWire format for ${className} + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Java Classes + * in the activemq-openwire-generator module + * + */ + class ActiveMQDestination + { + protected: + + std::string physicalName; + + public: + + const static unsigned char ID_ACTIVEMQDESTINATION = 0; + + public: + + ActiveMQDestination(); + virtual ~ActiveMQDestination(); + + virtual unsigned char getDataStructureType() const; + virtual const std::string& getPhysicalName() const; + virtual std::string& getPhysicalName(); + virtual void setPhysicalName( const std::string& physicalName ); + + }; + +}}}} + +#endif /*_ACTIVEMQ_CONNECTOR_OPENWIRE_COMMANDS_ACTIVEMQDESTINATION_H_*/ + Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.h ------------------------------------------------------------------------------ svn:eol-style = native Added: 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=auto&rev=452053 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp (added) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp Mon Oct 2 07:30:10 2006 @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +using namespace std; +using namespace activemq; +using namespace activemq::connector; +using namespace activemq::connector::openwire; +using namespace activemq::connector::openwire::commands; + +/* + * + * Command and marshalling code for OpenWire format for ActiveMQMapMessage + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Java Classes in the + * activemq-core module + * + */ +//////////////////////////////////////////////////////////////////////////////// +ActiveMQMapMessage::ActiveMQMapMessage() +{ +} + +//////////////////////////////////////////////////////////////////////////////// +ActiveMQMapMessage::~ActiveMQMapMessage() +{ +} + +//////////////////////////////////////////////////////////////////////////////// +unsigned char ActiveMQMapMessage::getDataStructureType() const +{ + return ActiveMQMapMessage::ID_ACTIVEMQMAPMESSAGE; +} + Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: 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=auto&rev=452053 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h (added) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h Mon Oct 2 07:30:10 2006 @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _ACTIVEMQ_CONNECTOR_OPENWIRE_COMMANDS_ACTIVEMQMAPMESSAGE_H_ +#define _ACTIVEMQ_CONNECTOR_OPENWIRE_COMMANDS_ACTIVEMQMAPMESSAGE_H_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include +#include + +namespace activemq{ +namespace connector{ +namespace openwire{ +namespace commands{ + + /* + * + * Command and marshalling code for OpenWire format for ${className} + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Java Classes + * in the activemq-openwire-generator module + * + */ + class ActiveMQMapMessage : public ActiveMQMessage + { + protected: + + + public: + + const static unsigned char ID_ACTIVEMQMAPMESSAGE = 25; + + public: + + ActiveMQMapMessage(); + virtual ~ActiveMQMapMessage(); + + virtual unsigned char getDataStructureType() const; + }; + +}}}} + +#endif /*_ACTIVEMQ_CONNECTOR_OPENWIRE_COMMANDS_ACTIVEMQMAPMESSAGE_H_*/ + Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h ------------------------------------------------------------------------------ svn:eol-style = native Added: 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=auto&rev=452053 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp (added) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp Mon Oct 2 07:30:10 2006 @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +using namespace std; +using namespace activemq; +using namespace activemq::connector; +using namespace activemq::connector::openwire; +using namespace activemq::connector::openwire::commands; + +/* + * + * Command and marshalling code for OpenWire format for ActiveMQMessage + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Java Classes in the + * activemq-core module + * + */ +//////////////////////////////////////////////////////////////////////////////// +ActiveMQMessage::ActiveMQMessage() +{ +} + +//////////////////////////////////////////////////////////////////////////////// +ActiveMQMessage::~ActiveMQMessage() +{ +} + +//////////////////////////////////////////////////////////////////////////////// +unsigned char ActiveMQMessage::getDataStructureType() const +{ + return ActiveMQMessage::ID_ACTIVEMQMESSAGE; +} + Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp ------------------------------------------------------------------------------ svn:eol-style = native