diff options
| author | Gordon Sim <gsim@apache.org> | 2013-03-14 19:36:26 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2013-03-14 19:36:26 +0000 |
| commit | ed225592063e88536e662f593f70e43cfdd6eea7 (patch) | |
| tree | 0fb48062f982270e5f0ca0cb4cf000ca2d397418 /cpp/src/qpid/broker/ObjectFactory.cpp | |
| parent | db00c352f1ea3a7668a44aa3059e10d50025bef2 (diff) | |
| download | qpid-python-ed225592063e88536e662f593f70e43cfdd6eea7.tar.gz | |
QPID-4586: add ability to have qpidd establish outgoing connections
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1456621 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/ObjectFactory.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/ObjectFactory.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/ObjectFactory.cpp b/cpp/src/qpid/broker/ObjectFactory.cpp new file mode 100644 index 0000000000..5bd516c351 --- /dev/null +++ b/cpp/src/qpid/broker/ObjectFactory.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 "ObjectFactory.h" +#include "Broker.h" + +namespace qpid { +namespace broker { + +bool ObjectFactoryRegistry::createObject(Broker& broker, const std::string& type, const std::string& name, const qpid::types::Variant::Map& properties, + const std::string& userId, const std::string& connectionId) +{ + for (Factories::iterator i = factories.begin(); i != factories.end(); ++i) + { + if ((*i)->createObject(broker, type, name, properties, userId, connectionId)) return true; + } + return false; +} + +bool ObjectFactoryRegistry::deleteObject(Broker& broker, const std::string& type, const std::string& name, const qpid::types::Variant::Map& properties, + const std::string& userId, const std::string& connectionId) +{ + for (Factories::iterator i = factories.begin(); i != factories.end(); ++i) + { + if ((*i)->deleteObject(broker, type, name, properties, userId, connectionId)) return true; + } + return false; +} + +ObjectFactoryRegistry::~ObjectFactoryRegistry() +{ + for (Factories::iterator i = factories.begin(); i != factories.end(); ++i) + { + delete *i; + } + factories.clear(); +} +void ObjectFactoryRegistry::add(ObjectFactory* factory) +{ + factories.push_back(factory); +} + +}} // namespace qpid::broker |
