You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2012/10/18 15:11:58 UTC
svn commit: r1399656 [1/2] - in
/activemq/activemq-cpp/trunk/activemq-cpp/src/main: ./ activemq/cmsutil/
Author: tabish
Date: Thu Oct 18 13:11:57 2012
New Revision: 1399656
URL: http://svn.apache.org/viewvc?rev=1399656&view=rev
Log:
Code cleanup and fix some throw clauses so they preserve exception types.
Added:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedConsumer.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedProducer.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DestinationResolver.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/MessageCreator.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/ProducerCallback.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/SessionCallback.cpp (with props)
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedConsumer.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedProducer.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsAccessor.cpp
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsAccessor.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsDestinationAccessor.cpp
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsDestinationAccessor.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsTemplate.cpp
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsTemplate.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DestinationResolver.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DynamicDestinationResolver.cpp
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DynamicDestinationResolver.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/MessageCreator.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/PooledSession.cpp
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/PooledSession.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/ProducerCallback.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/ResourceLifecycleManager.cpp
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/ResourceLifecycleManager.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/SessionCallback.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/SessionPool.cpp
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/SessionPool.h
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am?rev=1399656&r1=1399655&r2=1399656&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am Thu Oct 18 13:11:57 2012
@@ -16,12 +16,18 @@
# ---------------------------------------------------------------------------
cc_sources = \
+ activemq/cmsutil/CachedConsumer.cpp \
+ activemq/cmsutil/CachedProducer.cpp \
activemq/cmsutil/CmsAccessor.cpp \
activemq/cmsutil/CmsDestinationAccessor.cpp \
activemq/cmsutil/CmsTemplate.cpp \
+ activemq/cmsutil/DestinationResolver.cpp \
activemq/cmsutil/DynamicDestinationResolver.cpp \
+ activemq/cmsutil/MessageCreator.cpp \
activemq/cmsutil/PooledSession.cpp \
+ activemq/cmsutil/ProducerCallback.cpp \
activemq/cmsutil/ResourceLifecycleManager.cpp \
+ activemq/cmsutil/SessionCallback.cpp \
activemq/cmsutil/SessionPool.cpp \
activemq/commands/ActiveMQBlobMessage.cpp \
activemq/commands/ActiveMQBytesMessage.cpp \
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedConsumer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedConsumer.cpp?rev=1399656&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedConsumer.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedConsumer.cpp Thu Oct 18 13:11:57 2012
@@ -0,0 +1,34 @@
+/*
+ * 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 "CachedConsumer.h"
+
+using namespace cms;
+using namespace activemq::cmsutil;
+
+////////////////////////////////////////////////////////////////////////////////
+CachedConsumer::CachedConsumer(cms::MessageConsumer* consumer) : consumer(consumer) {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CachedConsumer::~CachedConsumer() {
+
+}
+
+
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedConsumer.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedConsumer.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedConsumer.h?rev=1399656&r1=1399655&r2=1399656&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedConsumer.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedConsumer.h Thu Oct 18 13:11:57 2012
@@ -39,9 +39,9 @@ namespace cmsutil {
public:
- CachedConsumer(cms::MessageConsumer* consumer) : consumer(consumer) {}
+ CachedConsumer(cms::MessageConsumer* consumer);
- virtual ~CachedConsumer() {}
+ virtual ~CachedConsumer();
/**
* Does nothing - the real producer resource will be closed
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedProducer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedProducer.cpp?rev=1399656&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedProducer.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedProducer.cpp Thu Oct 18 13:11:57 2012
@@ -0,0 +1,31 @@
+/*
+ * 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 "CachedProducer.h"
+
+using namespace cms;
+using namespace activemq::cmsutil;
+
+////////////////////////////////////////////////////////////////////////////////
+CachedProducer::CachedProducer(cms::MessageProducer* producer) : producer(producer) {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CachedProducer::~CachedProducer() {
+
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedProducer.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedProducer.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedProducer.h?rev=1399656&r1=1399655&r2=1399656&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedProducer.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CachedProducer.h Thu Oct 18 13:11:57 2012
@@ -15,8 +15,8 @@
* limitations under the License.
*/
-#ifndef ACTIVEMQ_CMSUTIL_CACHEDPRODUCER_H_
-#define ACTIVEMQ_CMSUTIL_CACHEDPRODUCER_H_
+#ifndef _ACTIVEMQ_CMSUTIL_CACHEDPRODUCER_H_
+#define _ACTIVEMQ_CMSUTIL_CACHEDPRODUCER_H_
#include <cms/MessageProducer.h>
#include <activemq/util/Config.h>
@@ -39,12 +39,9 @@ namespace cmsutil {
public:
- CachedProducer(cms::MessageProducer* producer) :
- producer(producer) {
- }
+ CachedProducer(cms::MessageProducer* producer);
- virtual ~CachedProducer() {
- }
+ virtual ~CachedProducer();
/**
* Does nothing - the real producer resource will be closed
@@ -138,4 +135,4 @@ namespace cmsutil {
}}
-#endif /*ACTIVEMQ_CMSUTIL_CACHEDPRODUCER_H_*/
+#endif /*_ACTIVEMQ_CMSUTIL_CACHEDPRODUCER_H_*/
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsAccessor.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsAccessor.cpp?rev=1399656&r1=1399655&r2=1399656&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsAccessor.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsAccessor.cpp Thu Oct 18 13:11:57 2012
@@ -26,18 +26,17 @@ using namespace activemq::cmsutil;
* A catch-all that throws an CMSException.
*/
#define CMSTEMPLATE_CATCHALL() \
- catch( cms::CMSException& ex ){ \
- throw ex; \
- } catch( std::exception& ex ) { \
- throw CMSException( ex.what(), NULL ); \
+ catch(cms::CMSException& ex){ \
+ throw; \
+ } catch(std::exception& ex) { \
+ throw CMSException(ex.what(), NULL); \
} catch( ... ){ \
- throw CMSException( "caught unknown exception", NULL ); \
+ throw CMSException("caught unknown exception", NULL); \
}
////////////////////////////////////////////////////////////////////////////////
-CmsAccessor::CmsAccessor() : resourceLifecycleManager(),
- connectionFactory( NULL ),
- sessionAcknowledgeMode( cms::Session::AUTO_ACKNOWLEDGE ) {
+CmsAccessor::CmsAccessor() :
+ resourceLifecycleManager(), connectionFactory(NULL), sessionAcknowledgeMode(cms::Session::AUTO_ACKNOWLEDGE) {
}
////////////////////////////////////////////////////////////////////////////////
@@ -59,7 +58,7 @@ cms::Connection* CmsAccessor::createConn
cms::Connection* c = getConnectionFactory()->createConnection();
// Manage the lifecycle of this resource.
- getResourceLifecycleManager()->addConnection( c );
+ getResourceLifecycleManager()->addConnection(c);
return c;
}
@@ -67,19 +66,19 @@ cms::Connection* CmsAccessor::createConn
}
////////////////////////////////////////////////////////////////////////////////
-cms::Session* CmsAccessor::createSession( cms::Connection* con ) {
+cms::Session* CmsAccessor::createSession(cms::Connection* con) {
try {
- if( con == NULL ) {
- throw CMSException( "connection object is invalid", NULL );
+ if (con == NULL) {
+ throw CMSException("connection object is invalid", NULL);
}
// Create the session.
- cms::Session* s = con->createSession( getSessionAcknowledgeMode() );
+ cms::Session* s = con->createSession(getSessionAcknowledgeMode());
// Manage the lifecycle of this resource.
- getResourceLifecycleManager()->addSession( s );
+ getResourceLifecycleManager()->addSession(s);
return s;
}
@@ -88,7 +87,7 @@ cms::Session* CmsAccessor::createSession
////////////////////////////////////////////////////////////////////////////////
void CmsAccessor::checkConnectionFactory() {
- if( getConnectionFactory() == NULL ) {
- throw IllegalStateException( "Property 'connectionFactory' is required", NULL );
+ if (getConnectionFactory() == NULL) {
+ throw IllegalStateException("Property 'connectionFactory' is required", NULL);
}
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsAccessor.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsAccessor.h?rev=1399656&r1=1399655&r2=1399656&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsAccessor.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsAccessor.h Thu Oct 18 13:11:57 2012
@@ -47,8 +47,8 @@ namespace cmsutil {
protected:
- CmsAccessor( const CmsAccessor& );
- CmsAccessor& operator= ( const CmsAccessor& );
+ CmsAccessor(const CmsAccessor&);
+ CmsAccessor& operator=(const CmsAccessor&);
public:
@@ -67,7 +67,7 @@ namespace cmsutil {
/**
* Set the ConnectionFactory to use for obtaining CMS Connections.
*/
- virtual void setConnectionFactory( cms::ConnectionFactory* connectionFactory ) {
+ virtual void setConnectionFactory(cms::ConnectionFactory* connectionFactory) {
this->connectionFactory = connectionFactory;
}
@@ -95,8 +95,7 @@ namespace cmsutil {
* @param sessionAcknowledgeMode
* The acknowledgment mode to assign to the Session.
*/
- virtual void setSessionAcknowledgeMode(
- cms::Session::AcknowledgeMode sessionAcknowledgeMode ) {
+ virtual void setSessionAcknowledgeMode(cms::Session::AcknowledgeMode sessionAcknowledgeMode) {
this->sessionAcknowledgeMode = sessionAcknowledgeMode;
}
@@ -151,7 +150,7 @@ namespace cmsutil {
* @throws CMSException if thrown by CMS API methods
* @throws IllegalStateException if this object has not been initialized.
*/
- virtual cms::Session* createSession( cms::Connection* con );
+ virtual cms::Session* createSession(cms::Connection* con);
/**
* Verifies that the connection factory is valid.
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsDestinationAccessor.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsDestinationAccessor.cpp?rev=1399656&r1=1399655&r2=1399656&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsDestinationAccessor.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsDestinationAccessor.cpp Thu Oct 18 13:11:57 2012
@@ -24,9 +24,7 @@ using namespace activemq::cmsutil;
////////////////////////////////////////////////////////////////////////////////
CmsDestinationAccessor::CmsDestinationAccessor() : CmsAccessor(),
- defaultDestinationResolver(),
- destinationResolver( &defaultDestinationResolver ),
- pubSubDomain( false ) {
+ defaultDestinationResolver(), destinationResolver(&defaultDestinationResolver), pubSubDomain(false) {
// Default to using queues, and start with the default destinationResolver.
}
@@ -44,13 +42,13 @@ void CmsDestinationAccessor::init() {
checkDestinationResolver();
// Give the resolver our lifecycle manager.
- destinationResolver->init( getResourceLifecycleManager() );
+ destinationResolver->init(getResourceLifecycleManager());
}
////////////////////////////////////////////////////////////////////////////////
void CmsDestinationAccessor::destroy() {
- if( destinationResolver != NULL ) {
+ if (destinationResolver != NULL) {
destinationResolver->destroy();
}
@@ -58,19 +56,17 @@ void CmsDestinationAccessor::destroy() {
}
////////////////////////////////////////////////////////////////////////////////
-cms::Destination* CmsDestinationAccessor::resolveDestinationName( cms::Session* session,
- const std::string& destName ) {
+cms::Destination* CmsDestinationAccessor::resolveDestinationName(cms::Session* session, const std::string& destName) {
checkDestinationResolver();
- return getDestinationResolver()->resolveDestinationName(
- session, destName, isPubSubDomain() );
+ return getDestinationResolver()->resolveDestinationName(session, destName, isPubSubDomain());
}
////////////////////////////////////////////////////////////////////////////////
void CmsDestinationAccessor::checkDestinationResolver() {
- if( getDestinationResolver() == NULL ) {
- throw IllegalStateException( "Property 'destinationResolver' is required", NULL );
+ if (getDestinationResolver() == NULL) {
+ throw IllegalStateException("Property 'destinationResolver' is required", NULL);
}
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsDestinationAccessor.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsDestinationAccessor.h?rev=1399656&r1=1399655&r2=1399656&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsDestinationAccessor.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsDestinationAccessor.h Thu Oct 18 13:11:57 2012
@@ -52,8 +52,8 @@ namespace cmsutil {
private:
- CmsDestinationAccessor( const CmsDestinationAccessor& );
- CmsDestinationAccessor& operator= ( const CmsDestinationAccessor& );
+ CmsDestinationAccessor(const CmsDestinationAccessor&);
+ CmsDestinationAccessor& operator=(const CmsDestinationAccessor&);
public:
@@ -77,7 +77,7 @@ namespace cmsutil {
return destinationResolver;
}
- virtual void setDestinationResolver( DestinationResolver* destRes ) {
+ virtual void setDestinationResolver(DestinationResolver* destRes) {
this->destinationResolver = destRes;
}
@@ -87,8 +87,7 @@ namespace cmsutil {
virtual void destroy();
- virtual cms::Destination* resolveDestinationName( cms::Session* session,
- const std::string& destName );
+ virtual cms::Destination* resolveDestinationName(cms::Session* session, const std::string& destName);
virtual void checkDestinationResolver();
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsTemplate.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsTemplate.cpp?rev=1399656&r1=1399655&r2=1399656&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsTemplate.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsTemplate.cpp Thu Oct 18 13:11:57 2012
@@ -41,8 +41,8 @@ using namespace std;
ex.setMark(__FILE__, __LINE__); \
try { \
t->destroy(); \
- } catch( ... ) {} \
- throw CMSException( ex.what(), NULL ); \
+ } catch(...) {} \
+ throw CMSException(ex.what(), NULL); \
}
/**
@@ -55,16 +55,16 @@ using namespace std;
try { \
t->destroy(); \
} catch( ... ) {} \
- throw ex; \
- } catch( ... ){ \
+ throw; \
+ } catch(...){ \
try { \
t->destroy(); \
} catch( ... ) {} \
- throw CMSException( "caught unknown exception", NULL ); \
+ throw CMSException("caught unknown exception", NULL); \
}
#define CMSTEMPLATE_CATCHALL_NOTHROW( ) \
- catch( ... ){ \
+ catch(...){ \
}
////////////////////////////////////////////////////////////////////////////////
@@ -152,10 +152,8 @@ void CmsTemplate::createSessionPools() {
/**
* Create the session pools.
*/
- for( int ix=0; ix<NUM_SESSION_POOLS; ++ix ) {
- sessionPools[ix] = new SessionPool( connection,
- ( cms::Session::AcknowledgeMode )ix,
- getResourceLifecycleManager() );
+ for (int ix = 0; ix < NUM_SESSION_POOLS; ++ix) {
+ sessionPools[ix] = new SessionPool(connection, (cms::Session::AcknowledgeMode) ix, getResourceLifecycleManager());
}
}
@@ -165,8 +163,8 @@ void CmsTemplate::destroySessionPools()
/**
* Destroy the session pools.
*/
- for( int ix=0; ix<NUM_SESSION_POOLS; ++ix ) {
- if( sessionPools[ix] != NULL ) {
+ for (int ix = 0; ix < NUM_SESSION_POOLS; ++ix) {
+ if (sessionPools[ix] != NULL) {
delete sessionPools[ix];
sessionPools[ix] = NULL;
}
@@ -178,7 +176,7 @@ void CmsTemplate::init() {
try {
- if( !initialized ) {
+ if (!initialized) {
// Invoke the base class.
CmsDestinationAccessor::init();
@@ -186,8 +184,8 @@ void CmsTemplate::init() {
initialized = true;
}
}
- CMSTEMPLATE_CATCH( IllegalStateException, this )
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCH(IllegalStateException, this)
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
@@ -210,21 +208,20 @@ void CmsTemplate::destroy() {
// Call the base class.
CmsDestinationAccessor::destroy();
}
- CMSTEMPLATE_CATCH( IllegalStateException, this )
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCH(IllegalStateException, this)
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
void CmsTemplate::checkDefaultDestination() {
- if( this->defaultDestination == NULL && this->defaultDestinationName.size()==0 ) {
- throw IllegalStateException(
- "No defaultDestination or defaultDestinationName specified."
- "Check configuration of CmsTemplate.", NULL );
+ if (this->defaultDestination == NULL && this->defaultDestinationName.size() == 0) {
+ throw IllegalStateException("No defaultDestination or defaultDestinationName specified."
+ "Check configuration of CmsTemplate.", NULL);
}
}
////////////////////////////////////////////////////////////////////////////////
-cms::Destination* CmsTemplate::resolveDefaultDestination( cms::Session* session ) {
+cms::Destination* CmsTemplate::resolveDefaultDestination(cms::Session* session) {
try {
@@ -237,15 +234,15 @@ cms::Destination* CmsTemplate::resolveDe
// If no default object was provided, the name was provided. Resolve
// the name and then set the destination object so we don't have to
// do this next time.
- if( dest == NULL ) {
- dest = resolveDestinationName( session, getDefaultDestinationName() );
- setDefaultDestination( dest );
+ if (dest == NULL) {
+ dest = resolveDestinationName(session, getDefaultDestinationName());
+ setDefaultDestination(dest);
}
return dest;
}
- CMSTEMPLATE_CATCH( IllegalStateException, this )
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCH(IllegalStateException, this)
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
@@ -254,7 +251,7 @@ cms::Connection* CmsTemplate::getConnect
try {
// If we don't have a connection, create one.
- if( connection == NULL ) {
+ if (connection == NULL) {
// Invoke the base class to create the connection and add it
// to the resource lifecycle manager.
@@ -269,8 +266,8 @@ cms::Connection* CmsTemplate::getConnect
return connection;
}
- CMSTEMPLATE_CATCH( IllegalStateException, this )
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCH(IllegalStateException, this)
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
@@ -285,15 +282,15 @@ PooledSession* CmsTemplate::takeSession(
// Take a session from the pool.
return sessionPools[getSessionAcknowledgeMode()]->takeSession();
}
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::returnSession( PooledSession*& session ) {
+void CmsTemplate::returnSession(PooledSession*& session) {
try {
- if( session == NULL ) {
+ if (session == NULL) {
return;
}
@@ -301,86 +298,83 @@ void CmsTemplate::returnSession( PooledS
session->close();
session = NULL;
}
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-cms::MessageProducer* CmsTemplate::createProducer(
- cms::Session* session, cms::Destination* dest ) {
+cms::MessageProducer* CmsTemplate::createProducer(cms::Session* session, cms::Destination* dest) {
try {
// If no destination was provided, resolve the default.
- if( dest == NULL ) {
- dest = resolveDefaultDestination( session );
+ if (dest == NULL) {
+ dest = resolveDefaultDestination(session);
}
cms::MessageProducer* producer = NULL;
// Try to use a cached producer - requires that we're using a
// PooledSession
- PooledSession* pooledSession = dynamic_cast<PooledSession*>( session );
- if( pooledSession != NULL ) {
- producer = pooledSession->createCachedProducer( dest );
+ PooledSession* pooledSession = dynamic_cast<PooledSession*>(session);
+ if (pooledSession != NULL) {
+ producer = pooledSession->createCachedProducer(dest);
} else {
- producer = session->createProducer( dest );
+ producer = session->createProducer(dest);
}
// Set the default values on the producer.
- producer->setDisableMessageID( !isMessageIdEnabled() );
- producer->setDisableMessageTimeStamp( !isMessageTimestampEnabled() );
+ producer->setDisableMessageID(!isMessageIdEnabled());
+ producer->setDisableMessageTimeStamp(!isMessageTimestampEnabled());
return producer;
}
- CMSTEMPLATE_CATCH( IllegalStateException, this )
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCH(IllegalStateException, this)
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-cms::MessageConsumer* CmsTemplate::createConsumer(
- cms::Session* session, cms::Destination* dest, const std::string& selector, bool noLocal ) {
+cms::MessageConsumer* CmsTemplate::createConsumer(cms::Session* session, cms::Destination* dest, const std::string& selector, bool noLocal) {
try {
// If no destination was provided, resolve the default.
- if( dest == NULL ) {
- dest = resolveDefaultDestination( session );
+ if (dest == NULL) {
+ dest = resolveDefaultDestination(session);
}
cms::MessageConsumer* consumer = NULL;
// Try to use a cached consumer - requires that we're using a
// PooledSession
- PooledSession* pooledSession = dynamic_cast<PooledSession*>( session );
- if( pooledSession != NULL ) {
- consumer = pooledSession->createCachedConsumer( dest, selector, noLocal );
+ PooledSession* pooledSession = dynamic_cast<PooledSession*>(session);
+ if (pooledSession != NULL) {
+ consumer = pooledSession->createCachedConsumer(dest, selector, noLocal);
} else {
- consumer = session->createConsumer( dest, selector, noLocal );
+ consumer = session->createConsumer(dest, selector, noLocal);
}
return consumer;
}
- CMSTEMPLATE_CATCH( IllegalStateException, this )
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCH(IllegalStateException, this)
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::destroyProducer( cms::MessageProducer*& producer ) {
+void CmsTemplate::destroyProducer(cms::MessageProducer*& producer) {
- if( producer == NULL ) {
+ if (producer == NULL) {
return;
}
try {
-
// Close the producer, then destroy it.
producer->close();
}
CMSTEMPLATE_CATCHALL_NOTHROW()
// Destroy if it's not a cached producer.
- CachedProducer* cachedProducer = dynamic_cast<CachedProducer*>( producer );
- if( cachedProducer == NULL ) {
+ CachedProducer* cachedProducer = dynamic_cast<CachedProducer*>(producer);
+ if (cachedProducer == NULL) {
delete producer;
}
@@ -388,22 +382,21 @@ void CmsTemplate::destroyProducer( cms::
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::destroyConsumer( cms::MessageConsumer*& consumer ) {
+void CmsTemplate::destroyConsumer(cms::MessageConsumer*& consumer) {
- if( consumer == NULL ) {
+ if (consumer == NULL) {
return;
}
try {
-
// Close the producer, then destroy it.
consumer->close();
}
CMSTEMPLATE_CATCHALL_NOTHROW()
// Destroy if it's not a cached consumer.
- CachedConsumer* cachedConsumer = dynamic_cast<CachedConsumer*>( consumer );
- if( cachedConsumer == NULL ) {
+ CachedConsumer* cachedConsumer = dynamic_cast<CachedConsumer*>(consumer);
+ if (cachedConsumer == NULL) {
delete consumer;
}
@@ -411,9 +404,9 @@ void CmsTemplate::destroyConsumer( cms::
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::destroyMessage( cms::Message*& message ) {
+void CmsTemplate::destroyMessage(cms::Message*& message) {
- if( message == NULL ) {
+ if (message == NULL) {
return;
}
@@ -423,13 +416,13 @@ void CmsTemplate::destroyMessage( cms::M
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::execute( SessionCallback* action ) {
+void CmsTemplate::execute(SessionCallback* action) {
PooledSession* pooledSession = NULL;
try {
- if( action == NULL ) {
+ if (action == NULL) {
return;
}
@@ -440,17 +433,17 @@ void CmsTemplate::execute( SessionCallba
pooledSession = takeSession();
// Execute the action with the given session.
- action->doInCms( pooledSession );
+ action->doInCms(pooledSession);
// Return the session to the pool.
- returnSession( pooledSession );
+ returnSession(pooledSession);
}
- CMSTEMPLATE_CATCH( IllegalStateException, this )
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCH(IllegalStateException, this)
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::execute( ProducerCallback* action ) {
+void CmsTemplate::execute(ProducerCallback* action) {
try {
@@ -458,17 +451,17 @@ void CmsTemplate::execute( ProducerCallb
init();
// Create the callback with using default destination.
- ProducerExecutor cb( action, this, NULL );
+ ProducerExecutor cb(action, this, NULL);
// Execute the action in a session.
- execute( &cb );
+ execute(&cb);
}
- CMSTEMPLATE_CATCH( IllegalStateException, this )
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCH(IllegalStateException, this)
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::execute( cms::Destination* dest, ProducerCallback* action ) {
+void CmsTemplate::execute(cms::Destination* dest, ProducerCallback* action) {
try {
@@ -476,17 +469,17 @@ void CmsTemplate::execute( cms::Destinat
init();
// Create the callback.
- ProducerExecutor cb( action, this, dest );
+ ProducerExecutor cb(action, this, dest);
// Execute the action in a session.
- execute( &cb );
+ execute(&cb);
}
- CMSTEMPLATE_CATCH( IllegalStateException, this )
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCH(IllegalStateException, this)
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::execute( const std::string& destinationName, ProducerCallback* action ) {
+void CmsTemplate::execute(const std::string& destinationName, ProducerCallback* action) {
try {
@@ -494,146 +487,143 @@ void CmsTemplate::execute( const std::st
init();
// Create the callback.
- ResolveProducerExecutor cb( action, this, destinationName );
+ ResolveProducerExecutor cb(action, this, destinationName);
// Execute the action in a session.
- execute( &cb );
+ execute(&cb);
}
- CMSTEMPLATE_CATCH( IllegalStateException, this )
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCH(IllegalStateException, this)
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::ProducerExecutor::doInCms( cms::Session* session ) {
+void CmsTemplate::ProducerExecutor::doInCms(cms::Session* session) {
cms::MessageProducer* producer = NULL;
try {
- if( session == NULL ) {
+ if (session == NULL) {
return;
}
// Create the producer.
- producer = parent->createProducer( session, getDestination( session ) );
+ producer = parent->createProducer(session, getDestination(session));
// Execute the action.
- action->doInCms( session, producer );
+ action->doInCms(session, producer);
// Destroy the producer.
- parent->destroyProducer( producer );
+ parent->destroyProducer(producer);
}
- CMSTEMPLATE_CATCHALL( parent )
+ CMSTEMPLATE_CATCHALL(parent)
}
////////////////////////////////////////////////////////////////////////////////
-cms::Destination* CmsTemplate::ResolveProducerExecutor::getDestination( cms::Session* session ) {
+cms::Destination* CmsTemplate::ResolveProducerExecutor::getDestination(cms::Session* session) {
try {
- return parent->resolveDestinationName( session, destinationName );
+ return parent->resolveDestinationName(session, destinationName);
}
- CMSTEMPLATE_CATCH( IllegalStateException, parent )
- CMSTEMPLATE_CATCHALL( parent )
+ CMSTEMPLATE_CATCH(IllegalStateException, parent)
+ CMSTEMPLATE_CATCHALL(parent)
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::send( MessageCreator* messageCreator ) {
+void CmsTemplate::send(MessageCreator* messageCreator) {
try {
- SendExecutor senderExecutor( messageCreator, this );
- execute( &senderExecutor );
+ SendExecutor senderExecutor(messageCreator, this);
+ execute(&senderExecutor);
}
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::send( cms::Destination* dest, MessageCreator* messageCreator ) {
+void CmsTemplate::send(cms::Destination* dest, MessageCreator* messageCreator) {
try {
- SendExecutor senderExecutor( messageCreator, this );
- execute( dest, &senderExecutor );
+ SendExecutor senderExecutor(messageCreator, this);
+ execute(dest, &senderExecutor);
}
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::send( const std::string& destinationName,
- MessageCreator* messageCreator ) {
+void CmsTemplate::send(const std::string& destinationName, MessageCreator* messageCreator) {
try {
- SendExecutor senderExecutor( messageCreator, this );
- execute( destinationName, &senderExecutor );
+ SendExecutor senderExecutor(messageCreator, this);
+ execute(destinationName, &senderExecutor);
}
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::doSend( cms::Session* session,
- cms::MessageProducer* producer,
- MessageCreator* messageCreator) {
+void CmsTemplate::doSend(cms::Session* session, cms::MessageProducer* producer, MessageCreator* messageCreator) {
cms::Message* message = NULL;
try {
- if( producer == NULL ) {
+ if (producer == NULL) {
return;
}
// Create the message.
- message = messageCreator->createMessage( session );
+ message = messageCreator->createMessage(session);
// Send the message.
- if( isExplicitQosEnabled() ) {
- producer->send( message, getDeliveryMode(), getPriority(), getTimeToLive() );
+ if (isExplicitQosEnabled()) {
+ producer->send(message, getDeliveryMode(), getPriority(), getTimeToLive());
} else {
- producer->send( message );
+ producer->send(message);
}
// Destroy the resources.
- destroyMessage( message );
+ destroyMessage(message);
- } catch( CMSException& e ) {
+ } catch (CMSException& e) {
- e.setMark(__FILE__, __LINE__ );
+ e.setMark(__FILE__, __LINE__);
// Destroy the resources.
- destroyMessage( message );
+ destroyMessage(message);
- throw e;
+ throw;
}
}
////////////////////////////////////////////////////////////////////////////////
-cms::Message* CmsTemplate::doReceive( cms::MessageConsumer* consumer ) {
+cms::Message* CmsTemplate::doReceive(cms::MessageConsumer* consumer) {
try {
- if( consumer == NULL ) {
- throw CMSException( "consumer is NULL", NULL );
+ if (consumer == NULL) {
+ throw CMSException("consumer is NULL", NULL);
}
long long receiveTime = getReceiveTimeout();
- switch( receiveTime ) {
- case RECEIVE_TIMEOUT_NO_WAIT: {
- return consumer->receiveNoWait();
- }
- case RECEIVE_TIMEOUT_INDEFINITE_WAIT: {
- return consumer->receive();
- }
- default: {
- return consumer->receive( (int)receiveTime );
- }
+ switch (receiveTime) {
+ case RECEIVE_TIMEOUT_NO_WAIT: {
+ return consumer->receiveNoWait();
+ }
+ case RECEIVE_TIMEOUT_INDEFINITE_WAIT: {
+ return consumer->receive();
+ }
+ default: {
+ return consumer->receive((int) receiveTime);
+ }
}
}
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-void CmsTemplate::ReceiveExecutor::doInCms( cms::Session* session ) {
+void CmsTemplate::ReceiveExecutor::doInCms(cms::Session* session) {
cms::MessageConsumer* consumer = NULL;
message = NULL;
@@ -641,34 +631,33 @@ void CmsTemplate::ReceiveExecutor::doInC
try {
// Create the consumer resource.
- consumer = parent->createConsumer( session, getDestination( session ), selector, noLocal );
+ consumer = parent->createConsumer(session, getDestination(session), selector, noLocal);
// Receive the message.
- message = parent->doReceive( consumer );
+ message = parent->doReceive(consumer);
// Destroy the consumer resource.
- parent->destroyConsumer( consumer );
+ parent->destroyConsumer(consumer);
- } catch( CMSException& e ) {
+ } catch (CMSException& e) {
- e.setMark( __FILE__, __LINE__ );
+ e.setMark(__FILE__, __LINE__);
// Destroy the message resource.
- parent->destroyMessage( message );
+ parent->destroyMessage(message);
- throw e;
+ throw;
}
}
////////////////////////////////////////////////////////////////////////////////
-cms::Destination* CmsTemplate::ResolveReceiveExecutor::getDestination(
- cms::Session* session ) {
+cms::Destination* CmsTemplate::ResolveReceiveExecutor::getDestination(cms::Session* session) {
try {
- return parent->resolveDestinationName( session, destinationName );
+ return parent->resolveDestinationName(session, destinationName);
}
- CMSTEMPLATE_CATCH( IllegalStateException, parent )
- CMSTEMPLATE_CATCHALL( parent )
+ CMSTEMPLATE_CATCH(IllegalStateException, parent)
+ CMSTEMPLATE_CATCHALL(parent)
}
////////////////////////////////////////////////////////////////////////////////
@@ -676,81 +665,75 @@ cms::Message* CmsTemplate::receive() {
try {
- ReceiveExecutor receiveExecutor( this, NULL, "", isNoLocal() );
- execute( &receiveExecutor );
+ ReceiveExecutor receiveExecutor(this, NULL, "", isNoLocal());
+ execute(&receiveExecutor);
return receiveExecutor.getMessage();
}
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-cms::Message* CmsTemplate::receive( cms::Destination* destination ) {
+cms::Message* CmsTemplate::receive(cms::Destination* destination) {
try {
- ReceiveExecutor receiveExecutor( this, destination, "", isNoLocal() );
- execute( &receiveExecutor );
+ ReceiveExecutor receiveExecutor(this, destination, "", isNoLocal());
+ execute(&receiveExecutor);
return receiveExecutor.getMessage();
}
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-cms::Message* CmsTemplate::receive( const std::string& destinationName ) {
+cms::Message* CmsTemplate::receive(const std::string& destinationName) {
try {
- ResolveReceiveExecutor receiveExecutor(
- this, "", isNoLocal(), destinationName );
- execute( &receiveExecutor );
+ ResolveReceiveExecutor receiveExecutor(this, "", isNoLocal(), destinationName);
+ execute(&receiveExecutor);
return receiveExecutor.getMessage();
}
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-cms::Message* CmsTemplate::receiveSelected( const std::string& selector ) {
+cms::Message* CmsTemplate::receiveSelected(const std::string& selector) {
try {
- ReceiveExecutor receiveExecutor(
- this, NULL, selector, isNoLocal() );
- execute( &receiveExecutor );
+ ReceiveExecutor receiveExecutor(this, NULL, selector, isNoLocal());
+ execute(&receiveExecutor);
return receiveExecutor.getMessage();
}
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-cms::Message* CmsTemplate::receiveSelected( cms::Destination* destination,
- const std::string& selector ) {
+cms::Message* CmsTemplate::receiveSelected(cms::Destination* destination, const std::string& selector) {
try {
- ReceiveExecutor receiveExecutor(
- this, destination, selector, isNoLocal() );
- execute( &receiveExecutor );
+ ReceiveExecutor receiveExecutor(this, destination, selector, isNoLocal());
+ execute(&receiveExecutor);
return receiveExecutor.getMessage();
}
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCHALL(this)
}
////////////////////////////////////////////////////////////////////////////////
-cms::Message* CmsTemplate::receiveSelected( const std::string& destinationName,
- const std::string& selector ) {
+cms::Message* CmsTemplate::receiveSelected(const std::string& destinationName, const std::string& selector) {
try {
- ResolveReceiveExecutor receiveExecutor(
- this, selector, isNoLocal(), destinationName );
- execute( &receiveExecutor );
+ ResolveReceiveExecutor receiveExecutor(this, selector, isNoLocal(), destinationName);
+ execute(&receiveExecutor);
return receiveExecutor.getMessage();
}
- CMSTEMPLATE_CATCHALL( this )
+ CMSTEMPLATE_CATCHALL(this)
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsTemplate.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsTemplate.h?rev=1399656&r1=1399655&r2=1399656&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsTemplate.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/CmsTemplate.h Thu Oct 18 13:11:57 2012
@@ -15,8 +15,8 @@
* limitations under the License.
*/
-#ifndef ACTIVEMQ_CMSUTIL_CMSTEMPLATE_H_
-#define ACTIVEMQ_CMSUTIL_CMSTEMPLATE_H_
+#ifndef _ACTIVEMQ_CMSUTIL_CMSTEMPLATE_H_
+#define _ACTIVEMQ_CMSUTIL_CMSTEMPLATE_H_
#include <activemq/util/Config.h>
#include <activemq/cmsutil/CmsDestinationAccessor.h>
@@ -97,22 +97,22 @@ namespace cmsutil {
private:
- ProducerExecutor( const ProducerExecutor& );
- ProducerExecutor& operator= ( const ProducerExecutor& );
+ ProducerExecutor(const ProducerExecutor&);
+ ProducerExecutor& operator=(const ProducerExecutor&);
public:
- ProducerExecutor( ProducerCallback* action,
- CmsTemplate* parent,
- cms::Destination* destination )
- : SessionCallback(), action( action ), parent( parent ), destination( destination ) {
+ ProducerExecutor(ProducerCallback* action,
+ CmsTemplate* parent,
+ cms::Destination* destination)
+ : SessionCallback(), action(action), parent(parent), destination(destination) {
}
virtual ~ProducerExecutor() {}
- virtual void doInCms( cms::Session* session );
+ virtual void doInCms(cms::Session* session);
- virtual cms::Destination* getDestination( cms::Session* session AMQCPP_UNUSED ) {
+ virtual cms::Destination* getDestination(cms::Session* session AMQCPP_UNUSED) {
return destination;
}
};
@@ -129,20 +129,20 @@ namespace cmsutil {
private:
- ResolveProducerExecutor( const ResolveProducerExecutor& );
- ResolveProducerExecutor& operator= ( const ResolveProducerExecutor& );
+ ResolveProducerExecutor(const ResolveProducerExecutor&);
+ ResolveProducerExecutor& operator=(const ResolveProducerExecutor&);
public:
- ResolveProducerExecutor( ProducerCallback* action,
- CmsTemplate* parent,
- const std::string& destinationName )
- : ProducerExecutor( action, parent, NULL ), destinationName( destinationName ) {
+ ResolveProducerExecutor(ProducerCallback* action,
+ CmsTemplate* parent,
+ const std::string& destinationName)
+ : ProducerExecutor(action, parent, NULL), destinationName(destinationName) {
}
virtual ~ResolveProducerExecutor() {}
- virtual cms::Destination* getDestination( cms::Session* session );
+ virtual cms::Destination* getDestination(cms::Session* session);
};
/**
@@ -158,21 +158,20 @@ namespace cmsutil {
private:
- SendExecutor( const SendExecutor& );
- SendExecutor& operator= ( const SendExecutor& );
+ SendExecutor(const SendExecutor&);
+ SendExecutor& operator=(const SendExecutor&);
public:
- SendExecutor( MessageCreator* messageCreator,
- CmsTemplate* parent )
- : ProducerCallback(), messageCreator( messageCreator ), parent( parent ) {
+ SendExecutor(MessageCreator* messageCreator, CmsTemplate* parent) :
+ ProducerCallback(), messageCreator(messageCreator), parent(parent) {
}
- virtual ~SendExecutor() {}
+ virtual ~SendExecutor() {
+ }
- virtual void doInCms( cms::Session* session,
- cms::MessageProducer* producer ) {
- parent->doSend( session, producer, messageCreator );
+ virtual void doInCms(cms::Session* session, cms::MessageProducer* producer) {
+ parent->doSend(session, producer, messageCreator);
}
};
@@ -192,28 +191,21 @@ namespace cmsutil {
private:
- ReceiveExecutor( const ReceiveExecutor& );
- ReceiveExecutor& operator= ( const ReceiveExecutor& );
+ ReceiveExecutor(const ReceiveExecutor&);
+ ReceiveExecutor& operator=(const ReceiveExecutor&);
public:
- ReceiveExecutor( CmsTemplate* parent,
- cms::Destination* destination,
- const std::string& selector,
- bool noLocal )
- : SessionCallback(),
- destination( destination ),
- selector( selector ),
- noLocal( noLocal ),
- message( NULL ),
- parent( parent ) {
+ ReceiveExecutor(CmsTemplate* parent, cms::Destination* destination,
+ const std::string& selector, bool noLocal) :
+ SessionCallback(), destination(destination), selector(selector), noLocal(noLocal), message(NULL), parent(parent) {
}
virtual ~ReceiveExecutor() {}
- virtual void doInCms( cms::Session* session );
+ virtual void doInCms(cms::Session* session);
- virtual cms::Destination* getDestination( cms::Session* session AMQCPP_UNUSED ) {
+ virtual cms::Destination* getDestination(cms::Session* session AMQCPP_UNUSED) {
return destination;
}
@@ -234,22 +226,19 @@ namespace cmsutil {
private:
- ResolveReceiveExecutor( const ResolveReceiveExecutor& );
- ResolveReceiveExecutor& operator= ( const ResolveReceiveExecutor& );
+ ResolveReceiveExecutor(const ResolveReceiveExecutor&);
+ ResolveReceiveExecutor& operator=(const ResolveReceiveExecutor&);
public:
- ResolveReceiveExecutor( CmsTemplate* parent,
- const std::string& selector,
- bool noLocal,
- const std::string& destinationName )
- : ReceiveExecutor( parent, NULL, selector, noLocal ), destinationName( destinationName ) {
-
+ ResolveReceiveExecutor(CmsTemplate* parent, const std::string& selector,
+ bool noLocal, const std::string& destinationName) :
+ ReceiveExecutor(parent, NULL, selector, noLocal), destinationName(destinationName) {
}
virtual ~ResolveReceiveExecutor() {}
- virtual cms::Destination* getDestination( cms::Session* session );
+ virtual cms::Destination* getDestination(cms::Session* session);
};
private:
@@ -284,13 +273,13 @@ namespace cmsutil {
private:
- CmsTemplate( const CmsTemplate& );
- CmsTemplate& operator= ( const CmsTemplate& );
+ CmsTemplate(const CmsTemplate&);
+ CmsTemplate& operator=(const CmsTemplate&);
public:
CmsTemplate();
- CmsTemplate( cms::ConnectionFactory* connectionFactory );
+ CmsTemplate(cms::ConnectionFactory* connectionFactory);
virtual ~CmsTemplate();
@@ -303,7 +292,7 @@ namespace cmsutil {
* @param defaultDestination
* the default destination
*/
- virtual void setDefaultDestination( cms::Destination* defaultDestination ) {
+ virtual void setDefaultDestination(cms::Destination* defaultDestination) {
this->defaultDestination = defaultDestination;
}
@@ -332,8 +321,8 @@ namespace cmsutil {
* @param defaultDestinationName
* the name of the destination for send/receive to by default.
*/
- virtual void setDefaultDestinationName( const std::string& defaultDestinationName ) {
- if( defaultDestinationName != this->defaultDestinationName ) {
+ virtual void setDefaultDestinationName(const std::string& defaultDestinationName) {
+ if (defaultDestinationName != this->defaultDestinationName) {
this->defaultDestination = NULL;
this->defaultDestinationName = defaultDestinationName;
}
@@ -357,14 +346,14 @@ namespace cmsutil {
* @param pubSubDomain
* indicates whether to use pub-sub messaging (topics).
*/
- virtual void setPubSubDomain( bool pubSubDomain ) {
- if( pubSubDomain != isPubSubDomain() ) {
+ virtual void setPubSubDomain(bool pubSubDomain) {
+ if (pubSubDomain != isPubSubDomain()) {
this->defaultDestination = NULL;
- CmsDestinationAccessor::setPubSubDomain( pubSubDomain );
+ CmsDestinationAccessor::setPubSubDomain(pubSubDomain);
}
}
- virtual void setMessageIdEnabled( bool messageIdEnabled ) {
+ virtual void setMessageIdEnabled(bool messageIdEnabled) {
this->messageIdEnabled = messageIdEnabled;
}
@@ -372,7 +361,7 @@ namespace cmsutil {
return this->messageIdEnabled;
}
- virtual void setMessageTimestampEnabled( bool messageTimestampEnabled ) {
+ virtual void setMessageTimestampEnabled(bool messageTimestampEnabled) {
this->messageTimestampEnabled = messageTimestampEnabled;
}
@@ -380,7 +369,7 @@ namespace cmsutil {
return this->messageTimestampEnabled;
}
- virtual void setNoLocal( bool noLocal ) {
+ virtual void setNoLocal(bool noLocal) {
this->noLocal = noLocal;
}
@@ -388,7 +377,7 @@ namespace cmsutil {
return this->noLocal;
}
- virtual void setReceiveTimeout( long long receiveTimeout ) {
+ virtual void setReceiveTimeout(long long receiveTimeout) {
this->receiveTimeout = receiveTimeout;
}
@@ -404,7 +393,7 @@ namespace cmsutil {
* @see #setPriority
* @see #setTimeToLive
*/
- virtual void setExplicitQosEnabled( bool explicitQosEnabled ) {
+ virtual void setExplicitQosEnabled(bool explicitQosEnabled) {
this->explicitQosEnabled = explicitQosEnabled;
}
@@ -432,8 +421,8 @@ namespace cmsutil {
*
* @see #setDeliveryMode(int)
*/
- virtual void setDeliveryPersistent( bool deliveryPersistent ) {
- this->deliveryMode = (deliveryPersistent ? 0 : 1 );
+ virtual void setDeliveryPersistent(bool deliveryPersistent) {
+ this->deliveryMode = (deliveryPersistent ? 0 : 1);
}
/**
@@ -444,7 +433,7 @@ namespace cmsutil {
* @param deliveryMode the delivery mode to use
* @see #isExplicitQosEnabled
*/
- virtual void setDeliveryMode( int deliveryMode ) {
+ virtual void setDeliveryMode(int deliveryMode) {
this->deliveryMode = deliveryMode;
}
@@ -462,7 +451,7 @@ namespace cmsutil {
*
* @see #isExplicitQosEnabled
*/
- virtual void setPriority( int priority ) {
+ virtual void setPriority(int priority) {
this->priority = priority;
}
@@ -481,7 +470,7 @@ namespace cmsutil {
*
* @see #isExplicitQosEnabled
*/
- virtual void setTimeToLive( long long timeToLive ) {
+ virtual void setTimeToLive(long long timeToLive) {
this->timeToLive = timeToLive;
}
@@ -498,7 +487,7 @@ namespace cmsutil {
* the action to perform within a CMS Session
* @throws cms::CMSException thrown if an error occurs.
*/
- virtual void execute( SessionCallback* action );
+ virtual void execute(SessionCallback* action);
/**
* Executes the given action and provides it with a CMS Session and
@@ -508,7 +497,7 @@ namespace cmsutil {
* the action to perform
* @throws cms::CMSException thrown if an error occurs.
*/
- virtual void execute( ProducerCallback* action );
+ virtual void execute(ProducerCallback* action);
/**
* Executes the given action and provides it with a CMS Session and
@@ -520,7 +509,7 @@ namespace cmsutil {
* the action to perform
* @throws cms::CMSException thrown if an error occurs.
*/
- virtual void execute( cms::Destination* dest, ProducerCallback* action );
+ virtual void execute(cms::Destination* dest, ProducerCallback* action);
/**
* Executes the given action and provides it with a CMS Session and
@@ -534,8 +523,7 @@ namespace cmsutil {
*
* @throws cms::CMSException thrown if an error occurs.
*/
- virtual void execute( const std::string& destinationName,
- ProducerCallback* action );
+ virtual void execute(const std::string& destinationName, ProducerCallback* action);
/**
* Convenience method for sending a message to the default destination.
@@ -544,7 +532,7 @@ namespace cmsutil {
* Responsible for creating the message to be sent
* @throws cms::CMSException thrown if an error occurs.
*/
- virtual void send( MessageCreator* messageCreator );
+ virtual void send(MessageCreator* messageCreator);
/**
* Convenience method for sending a message to the specified destination.
@@ -555,7 +543,7 @@ namespace cmsutil {
* Responsible for creating the message to be sent
* @throws cms::CMSException thrown if an error occurs.
*/
- virtual void send( cms::Destination* dest, MessageCreator* messageCreator );
+ virtual void send(cms::Destination* dest, MessageCreator* messageCreator);
/**
* Convenience method for sending a message to the specified destination.
@@ -566,8 +554,7 @@ namespace cmsutil {
* Responsible for creating the message to be sent
* @throws cms::CMSException thrown if an error occurs.
*/
- virtual void send( const std::string& destinationName,
- MessageCreator* messageCreator );
+ virtual void send(const std::string& destinationName, MessageCreator* messageCreator);
/**
* Performs a synchronous read from the default destination.
@@ -583,7 +570,7 @@ namespace cmsutil {
* @return the message
* @throws cms::CMSException thrown if an error occurs
*/
- virtual cms::Message* receive( cms::Destination* destination );
+ virtual cms::Message* receive(cms::Destination* destination);
/**
* Performs a synchronous read from the specified destination.
@@ -593,7 +580,7 @@ namespace cmsutil {
* @return the message
* @throws cms::CMSException thrown if an error occurs
*/
- virtual cms::Message* receive( const std::string& destinationName );
+ virtual cms::Message* receive(const std::string& destinationName);
/**
* Performs a synchronous read consuming only messages identified by the
@@ -604,7 +591,7 @@ namespace cmsutil {
* @return the message
* @throws cms::CMSException thrown if an error occurs
*/
- virtual cms::Message* receiveSelected( const std::string& selector );
+ virtual cms::Message* receiveSelected(const std::string& selector);
/**
* Performs a synchronous read from the specified destination, consuming
@@ -617,8 +604,7 @@ namespace cmsutil {
* @return the message
* @throws cms::CMSException thrown if an error occurs
*/
- virtual cms::Message* receiveSelected( cms::Destination* destination,
- const std::string& selector );
+ virtual cms::Message* receiveSelected(cms::Destination* destination, const std::string& selector);
/**
* Performs a synchronous read from the specified destination, consuming
@@ -632,8 +618,7 @@ namespace cmsutil {
* @return the message
* @throws cms::CMSException thrown if an error occurs
*/
- virtual cms::Message* receiveSelected( const std::string& destinationName,
- const std::string& selector );
+ virtual cms::Message* receiveSelected(const std::string& destinationName, const std::string& selector);
protected:
@@ -688,7 +673,7 @@ namespace cmsutil {
* a pooled session resource
* @throws cms::CMSException thrown if the CMS methods throw.
*/
- void returnSession( PooledSession*& session );
+ void returnSession(PooledSession*& session);
/**
* Allocates a producer initialized with the proper values.
@@ -701,7 +686,7 @@ namespace cmsutil {
* @return the producer
* @throws cms::CMSException thrown by the CMS API
*/
- cms::MessageProducer* createProducer( cms::Session* session, cms::Destination* dest );
+ cms::MessageProducer* createProducer(cms::Session* session, cms::Destination* dest);
/**
* Closes and destroys a producer resource
@@ -709,7 +694,7 @@ namespace cmsutil {
* a producer to destroy
* @throws cms::CMSException thrown if the CMS methods throw.
*/
- void destroyProducer( cms::MessageProducer*& producer );
+ void destroyProducer(cms::MessageProducer*& producer);
/**
* Allocates a consumer initialized with the proper values.
@@ -722,10 +707,8 @@ namespace cmsutil {
* @return the consumer
* @throws cms::CMSException thrown by the CMS API
*/
- cms::MessageConsumer* createConsumer( cms::Session* session,
- cms::Destination* dest,
- const std::string& selector,
- bool noLocal );
+ cms::MessageConsumer* createConsumer(cms::Session* session, cms::Destination* dest,
+ const std::string& selector, bool noLocal);
/**
* Closes and destroys a consumer resource
@@ -733,14 +716,14 @@ namespace cmsutil {
* a consumer to destroy
* @throws cms::CMSException thrown if the CMS methods throw.
*/
- void destroyConsumer( cms::MessageConsumer*& consumer );
+ void destroyConsumer(cms::MessageConsumer*& consumer);
/**
* Destroys the given message
* @param message
* the message to destroy
*/
- void destroyMessage( cms::Message*& message );
+ void destroyMessage(cms::Message*& message);
/**
* Sends a message to a destination.
@@ -752,9 +735,7 @@ namespace cmsutil {
* creates the message to be sent
* @throws cms::CMSException thrown if the CMS API throws.
*/
- void doSend( cms::Session* session,
- cms::MessageProducer* producer,
- MessageCreator* messageCreator );
+ void doSend(cms::Session* session, cms::MessageProducer* producer, MessageCreator* messageCreator);
/**
* Receives a message from a destination.
@@ -763,7 +744,7 @@ namespace cmsutil {
* @return the message that was read
* @throws cms::CMSException thrown if the CMS API throws.
*/
- cms::Message* doReceive( cms::MessageConsumer* consumer );
+ cms::Message* doReceive(cms::MessageConsumer* consumer);
/**
* Resolves the default destination and returns it.
@@ -772,10 +753,10 @@ namespace cmsutil {
* @return the default destination
* @throws cms::CMSException if an error occurs
*/
- cms::Destination* resolveDefaultDestination( cms::Session* session );
+ cms::Destination* resolveDefaultDestination(cms::Session* session);
};
}}
-#endif /*ACTIVEMQ_CMSUTIL_CMSTEMPLATE_H_*/
+#endif /*_ACTIVEMQ_CMSUTIL_CMSTEMPLATE_H_*/
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DestinationResolver.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DestinationResolver.cpp?rev=1399656&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DestinationResolver.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DestinationResolver.cpp Thu Oct 18 13:11:57 2012
@@ -0,0 +1,26 @@
+/*
+ * 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 "DestinationResolver.h"
+
+using namespace cms;
+using namespace activemq::cmsutil;
+
+////////////////////////////////////////////////////////////////////////////////
+DestinationResolver::~DestinationResolver() {
+
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DestinationResolver.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DestinationResolver.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DestinationResolver.h?rev=1399656&r1=1399655&r2=1399656&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DestinationResolver.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DestinationResolver.h Thu Oct 18 13:11:57 2012
@@ -32,7 +32,7 @@ namespace cmsutil {
class AMQCPP_API DestinationResolver {
public:
- virtual ~DestinationResolver() {}
+ virtual ~DestinationResolver();
/**
* Initializes this destination resolver for use. Ensures that any
@@ -42,7 +42,7 @@ namespace cmsutil {
* @param mgr
* the resource lifecycle manager.
*/
- virtual void init( ResourceLifecycleManager* mgr ) = 0;
+ virtual void init(ResourceLifecycleManager* mgr) = 0;
/**
* Destroys any allocated resources.
@@ -67,9 +67,9 @@ namespace cmsutil {
*
* @throws cms::CMSException if resolution failed.
*/
- virtual cms::Destination* resolveDestinationName( cms::Session* session,
- const std::string& destName,
- bool pubSubDomain ) = 0;
+ virtual cms::Destination* resolveDestinationName(cms::Session* session,
+ const std::string& destName,
+ bool pubSubDomain) = 0;
};
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DynamicDestinationResolver.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DynamicDestinationResolver.cpp?rev=1399656&r1=1399655&r2=1399656&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DynamicDestinationResolver.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DynamicDestinationResolver.cpp Thu Oct 18 13:11:57 2012
@@ -25,54 +25,54 @@ using namespace cms;
using namespace std;
////////////////////////////////////////////////////////////////////////////////
-cms::Topic* DynamicDestinationResolver::SessionResolver::getTopic( const std::string& topicName ) {
+cms::Topic* DynamicDestinationResolver::SessionResolver::getTopic(const std::string& topicName) {
cms::Topic* topic = NULL;
try {
// See if we already have a topic with this name.
- topic = topicMap.get( topicName );
+ topic = topicMap.get(topicName);
- } catch ( decaf::util::NoSuchElementException& ex ) {
+ } catch (decaf::util::NoSuchElementException& ex) {
// Create a new topic.
- topic = session->createTopic( topicName );
+ topic = session->createTopic(topicName);
// Add the topic to the lifecycle manager.
- resourceLifecycleManager->addDestination( topic );
+ resourceLifecycleManager->addDestination(topic);
// Add the topic to the map.
- topicMap.put( topicName, topic );
+ topicMap.put(topicName, topic);
}
return topic;
}
////////////////////////////////////////////////////////////////////////////////
-cms::Queue* DynamicDestinationResolver::SessionResolver::getQueue( const std::string& queueName ) {
+cms::Queue* DynamicDestinationResolver::SessionResolver::getQueue(const std::string& queueName) {
cms::Queue* queue = NULL;
try {
// See if we already have a queue with this name.
- queue = queueMap.get( queueName );
+ queue = queueMap.get(queueName);
- } catch ( decaf::util::NoSuchElementException& ex ) {
+ } catch (decaf::util::NoSuchElementException& ex) {
// Create a new queue.
- queue = session->createQueue( queueName );
+ queue = session->createQueue(queueName);
// Add the queue to the lifecycle manager.
- resourceLifecycleManager->addDestination( queue );
+ resourceLifecycleManager->addDestination(queue);
// Add the queue to the map.
- queueMap.put( queueName, queue );
+ queueMap.put(queueName, queue);
}
return queue;
}
////////////////////////////////////////////////////////////////////////////////
-DynamicDestinationResolver::DynamicDestinationResolver()
- : DestinationResolver(), sessionResolverMap(), resourceLifecycleManager( NULL ) {
+DynamicDestinationResolver::DynamicDestinationResolver() :
+ DestinationResolver(), sessionResolverMap(), resourceLifecycleManager(NULL) {
}
////////////////////////////////////////////////////////////////////////////////
@@ -84,7 +84,7 @@ DynamicDestinationResolver::~DynamicDest
void DynamicDestinationResolver::destroy() {
// Destroy the session resolvers.
- std::auto_ptr< Iterator<SessionResolver*> > sessionResolvers(sessionResolverMap.values().iterator());
+ std::auto_ptr<Iterator<SessionResolver*> > sessionResolvers(sessionResolverMap.values().iterator());
while (sessionResolvers->hasNext()) {
delete sessionResolvers->next();
}
@@ -93,26 +93,25 @@ void DynamicDestinationResolver::destroy
}
////////////////////////////////////////////////////////////////////////////////
-cms::Destination* DynamicDestinationResolver::resolveDestinationName(
- cms::Session* session, const std::string& destName, bool pubSubDomain ) {
+cms::Destination* DynamicDestinationResolver::resolveDestinationName(cms::Session* session, const std::string& destName, bool pubSubDomain) {
- if( destName == "" ) {
- throw CMSException( "destination name is invalid", NULL );
+ if (destName == "") {
+ throw CMSException("destination name is invalid", NULL);
}
// Get the resolver for this session.
SessionResolver* resolver = NULL;
try {
- resolver = sessionResolverMap.get( session );
- } catch ( decaf::util::NoSuchElementException& ex ) {
- resolver = new SessionResolver( session, resourceLifecycleManager );
- sessionResolverMap.put( session, resolver );
+ resolver = sessionResolverMap.get(session);
+ } catch (decaf::util::NoSuchElementException& ex) {
+ resolver = new SessionResolver(session, resourceLifecycleManager);
+ sessionResolverMap.put(session, resolver);
}
// Return the appropriate destination.
- if( pubSubDomain ) {
- return resolver->getTopic( destName );
+ if (pubSubDomain) {
+ return resolver->getTopic(destName);
} else {
- return resolver->getQueue( destName );
+ return resolver->getQueue(destName);
}
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DynamicDestinationResolver.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DynamicDestinationResolver.h?rev=1399656&r1=1399655&r2=1399656&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DynamicDestinationResolver.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/DynamicDestinationResolver.h Thu Oct 18 13:11:57 2012
@@ -44,13 +44,12 @@ namespace cmsutil {
private:
- SessionResolver( const SessionResolver& );
- SessionResolver& operator= ( const SessionResolver& );
+ SessionResolver(const SessionResolver&);
+ SessionResolver& operator=(const SessionResolver&);
public:
- SessionResolver( cms::Session* session,
- ResourceLifecycleManager* resourceLifecycleManager )
+ SessionResolver(cms::Session* session, ResourceLifecycleManager* resourceLifecycleManager )
: resourceLifecycleManager( resourceLifecycleManager ),
session( session ),
topicMap(),
@@ -59,9 +58,9 @@ namespace cmsutil {
virtual ~SessionResolver() {}
- cms::Topic* getTopic(const std::string& topicName );
+ cms::Topic* getTopic(const std::string& topicName);
- cms::Queue* getQueue(const std::string& queueName );
+ cms::Queue* getQueue(const std::string& queueName);
};
@@ -77,8 +76,8 @@ namespace cmsutil {
private:
- DynamicDestinationResolver( const DynamicDestinationResolver& );
- DynamicDestinationResolver& operator= ( const DynamicDestinationResolver& );
+ DynamicDestinationResolver(const DynamicDestinationResolver&);
+ DynamicDestinationResolver& operator=(const DynamicDestinationResolver&);
public:
@@ -86,7 +85,7 @@ namespace cmsutil {
virtual ~DynamicDestinationResolver();
- virtual void init( ResourceLifecycleManager* mgr ) {
+ virtual void init(ResourceLifecycleManager* mgr) {
// since we're changing the lifecycle manager, clear out references
// to old resources.
@@ -110,12 +109,14 @@ namespace cmsutil {
* @param pubSubDomain
* If true, the name will be resolved to a Topic,
* otherwise a Queue.
+ *
* @return the resolved destination
+ *
* @throws cms::CMSException if resolution failed.
*/
- virtual cms::Destination* resolveDestinationName( cms::Session* session,
- const std::string& destName,
- bool pubSubDomain );
+ virtual cms::Destination* resolveDestinationName(cms::Session* session,
+ const std::string& destName,
+ bool pubSubDomain);
};
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/MessageCreator.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/MessageCreator.cpp?rev=1399656&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/MessageCreator.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/MessageCreator.cpp Thu Oct 18 13:11:57 2012
@@ -0,0 +1,26 @@
+/*
+ * 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 "MessageCreator.h"
+
+using namespace cms;
+using namespace activemq::cmsutil;
+
+////////////////////////////////////////////////////////////////////////////////
+MessageCreator::~MessageCreator() {
+
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/MessageCreator.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/MessageCreator.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/MessageCreator.h?rev=1399656&r1=1399655&r2=1399656&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/MessageCreator.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/MessageCreator.h Thu Oct 18 13:11:57 2012
@@ -15,8 +15,8 @@
* limitations under the License.
*/
-#ifndef ACTIVEMQ_CMSUTIL_MESSAGECREATOR_H
-#define ACTIVEMQ_CMSUTIL_MESSAGECREATOR_H
+#ifndef _ACTIVEMQ_CMSUTIL_MESSAGECREATOR_H_
+#define _ACTIVEMQ_CMSUTIL_MESSAGECREATOR_H_
#include <cms/Session.h>
#include <cms/Message.h>
@@ -32,7 +32,7 @@ namespace cmsutil {
class AMQCPP_API MessageCreator {
public:
- virtual ~MessageCreator() {}
+ virtual ~MessageCreator();
/**
* Creates a message from the given session.
@@ -42,10 +42,10 @@ namespace cmsutil {
*
* @throws cms::CMSException if thrown by CMS API methods
*/
- virtual cms::Message* createMessage( cms::Session* session ) = 0;
+ virtual cms::Message* createMessage(cms::Session* session) = 0;
};
}}
-#endif /*ACTIVEMQ_CMSUTIL_MESSAGECREATOR_H*/
+#endif /*_ACTIVEMQ_CMSUTIL_MESSAGECREATOR_H_*/