~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to drizzled/plugin/xa_storage_engine.cc

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
 *
 
4
 *  Copyright (C) 2008 Sun Microsystems
 
5
 *  Copyright (c) 2010 Jay Pipes <jaypipes@gmail.com>
 
6
 *
 
7
 *  This program is free software; you can redistribute it and/or modify
 
8
 *  it under the terms of the GNU General Public License as published by
 
9
 *  the Free Software Foundation; version 2 of the License.
 
10
 *
 
11
 *  This program is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with this program; if not, write to the Free Software
 
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 */
 
20
 
 
21
#include "config.h"
 
22
 
 
23
#include "drizzled/my_hash.h"
 
24
#include "drizzled/cached_directory.h"
 
25
 
 
26
#include <drizzled/definitions.h>
 
27
#include <drizzled/session.h>
 
28
#include <drizzled/error.h>
 
29
#include <drizzled/gettext.h>
 
30
#include <drizzled/plugin/xa_storage_engine.h>
 
31
#include "drizzled/xid.h"
 
32
 
 
33
#include "drizzled/hash.h"
 
34
 
 
35
#include <string>
 
36
#include <vector>
 
37
#include <algorithm>
 
38
#include <functional>
 
39
 
 
40
using namespace std;
 
41
 
 
42
namespace drizzled
 
43
{
 
44
 
 
45
namespace plugin
 
46
{
 
47
 
 
48
static vector<XaStorageEngine *> vector_of_xa_engines;
 
49
 
 
50
XaStorageEngine::XaStorageEngine(const string name_arg,
 
51
                                 const bitset<HTON_BIT_SIZE> &flags_arg) :
 
52
  TransactionalStorageEngine(name_arg, flags_arg)
 
53
{}
 
54
 
 
55
XaStorageEngine::~XaStorageEngine()
 
56
{}
 
57
 
 
58
bool XaStorageEngine::addPlugin(XaStorageEngine *engine)
 
59
{
 
60
  vector_of_xa_engines.push_back(engine);
 
61
 
 
62
  return TransactionalStorageEngine::addPlugin(engine) &&
 
63
         XaResourceManager::addPlugin(engine);
 
64
}
 
65
 
 
66
void XaStorageEngine::removePlugin(XaStorageEngine *engine)
 
67
{
 
68
  vector_of_xa_engines.clear();
 
69
  TransactionalStorageEngine::removePlugin(engine);
 
70
  XaResourceManager::removePlugin(engine);
 
71
}
 
72
 
 
73
} /* namespace plugin */
 
74
} /* namespace drizzled */