summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorRobert Greig <rgreig@apache.org>2006-12-18 18:20:41 +0000
committerRobert Greig <rgreig@apache.org>2006-12-18 18:20:41 +0000
commit53d03c43b4e00ce525d5e30c4cbe64c05a1b0222 (patch)
treea6e4d9de842ef6d5a49a8599ac3c3879b4126cc6 /qpid/cpp/src
parente5021e250fed784435d5d00ad5120f94fe33df5b (diff)
downloadqpid-python-53d03c43b4e00ce525d5e30c4cbe64c05a1b0222.tar.gz
Copied remotely
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/perftesting@488382 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/Makefile.am17
-rw-r--r--qpid/cpp/src/qpidd.cpp60
2 files changed, 77 insertions, 0 deletions
diff --git a/qpid/cpp/src/Makefile.am b/qpid/cpp/src/Makefile.am
new file mode 100644
index 0000000000..40398eb2c9
--- /dev/null
+++ b/qpid/cpp/src/Makefile.am
@@ -0,0 +1,17 @@
+AM_CXXFLAGS = $(WARNING_CFLAGS)
+INCLUDES = \
+ -I$(top_srcdir)/gen \
+ -I$(top_srcdir)/lib/broker \
+ -I$(top_srcdir)/lib/common \
+ -I$(top_srcdir)/lib/common/framing \
+ -I$(top_srcdir)/lib/common/sys
+
+LDADD = \
+ ../lib/broker/libqpidbroker.la \
+ ../lib/common/libqpidcommon.la
+
+sbin_PROGRAMS = qpidd
+qpidd_SOURCES = qpidd.cpp
+
+# Force build of qpidd during dist phase so help2man will work.
+dist-hook: $(sbin_PROGRAMS)
diff --git a/qpid/cpp/src/qpidd.cpp b/qpid/cpp/src/qpidd.cpp
new file mode 100644
index 0000000000..8285f1aefb
--- /dev/null
+++ b/qpid/cpp/src/qpidd.cpp
@@ -0,0 +1,60 @@
+/*
+ *
+ * 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 <Broker.h>
+#include <Configuration.h>
+#include <signal.h>
+#include <iostream>
+#include <memory>
+#include <config.h>
+
+static char const* programName = "qpidd";
+
+using namespace qpid::broker;
+using namespace qpid::sys;
+
+Broker::shared_ptr broker;
+
+void handle_signal(int /*signal*/){
+ std::cerr << "Shutting down..." << std::endl;
+ broker->shutdown();
+}
+
+int main(int argc, char** argv)
+{
+ Configuration config;
+ try {
+ config.parse(programName, argc, argv);
+ if(config.isHelp()){
+ config.usage();
+ }else if(config.isVersion()){
+ std::cout << programName << " (" << PACKAGE_NAME << ") version "
+ << PACKAGE_VERSION << std::endl;
+ }else{
+ broker = Broker::create(config);
+ signal(SIGINT, handle_signal);
+ broker->run();
+ }
+ return 0;
+ } catch(const std::exception& e) {
+ std::cerr << e.what() << std::endl;
+ }
+ return 1;
+}