You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2010/04/28 00:20:25 UTC
svn commit: r938701 - in /qpid/trunk/qpid/cpp/src/qpid/client:
ConnectionImpl.cpp LoadPlugins.cpp LoadPlugins.h
Author: astitcher
Date: Tue Apr 27 22:20:25 2010
New Revision: 938701
URL: http://svn.apache.org/viewvc?rev=938701&view=rev
Log:
Load client side plugins just before creating the first Connection.
Added:
qpid/trunk/qpid/cpp/src/qpid/client/LoadPlugins.h
Modified:
qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp
qpid/trunk/qpid/cpp/src/qpid/client/LoadPlugins.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp?rev=938701&r1=938700&r2=938701&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp Tue Apr 27 22:20:25 2010
@@ -21,6 +21,7 @@
#include "qpid/client/ConnectionImpl.h"
+#include "qpid/client/LoadPlugins.h"
#include "qpid/client/Connector.h"
#include "qpid/client/ConnectionSettings.h"
#include "qpid/client/SessionImpl.h"
@@ -162,10 +163,14 @@ public:
}
-// Ensure the IO threads exist:
-// This needs to be called in the Connection constructor
-// so that they will still exist at last connection destruction
void ConnectionImpl::init() {
+ // Ensure that the plugin modules have been loaded
+ // This will make sure that any plugin protocols are available
+ theModuleLoader();
+
+ // Ensure the IO threads exist:
+ // This needs to be called in the Connection constructor
+ // so that they will still exist at last connection destruction
(void) theIO();
}
Modified: qpid/trunk/qpid/cpp/src/qpid/client/LoadPlugins.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/LoadPlugins.cpp?rev=938701&r1=938700&r2=938701&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/LoadPlugins.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/LoadPlugins.cpp Tue Apr 27 22:20:25 2010
@@ -19,6 +19,8 @@
*
*/
+#include "LoadPlugins.h"
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
@@ -26,9 +28,13 @@
#include "qpid/sys/Shlib.h"
#include <string>
#include <vector>
+
using std::vector;
using std::string;
+namespace qpid {
+namespace client {
+
namespace {
struct LoadtimeInitialise {
@@ -47,6 +53,12 @@ struct LoadtimeInitialise {
qpid::loadModuleDir (moduleOptions.loadDir, isDefault);
}
}
-} init;
+};
} // namespace
+
+void theModuleLoader() {
+ static LoadtimeInitialise l;
+}
+
+}} // namespace qpid::client
Added: qpid/trunk/qpid/cpp/src/qpid/client/LoadPlugins.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/LoadPlugins.h?rev=938701&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/LoadPlugins.h (added)
+++ qpid/trunk/qpid/cpp/src/qpid/client/LoadPlugins.h Tue Apr 27 22:20:25 2010
@@ -0,0 +1,33 @@
+/*
+ *
+ * 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 _LoadPlugins_
+#define _LoadPlugins_
+
+namespace qpid {
+namespace client {
+
+void theModuleLoader();
+
+}}
+
+
+#endif
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org