~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/scheduler.h

  • Committer: Monty Taylor
  • Date: 2008-08-05 19:01:20 UTC
  • mto: (266.1.1 codestyle)
  • mto: This revision was merged to the branch mainline in revision 266.
  • Revision ID: monty@inaugust.com-20080805190120-tsuziqz2mfqcw7pe
Removed libmysyslt.la, made mysys a noinst_ and made everything use it. It's
not a standalone lib, there's no reason to pretend otherwise.

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
 
 *  Definitions required for Configuration Variables plugin
5
 
 *
6
 
 *  Copyright (C) 2008 Sun Microsystems
7
 
 *
8
 
 *  This program is free software; you can redistribute it and/or modify
9
 
 *  it under the terms of the GNU General Public License as published by
10
 
 *  the Free Software Foundation; version 2 of the License.
11
 
 *
12
 
 *  This program is distributed in the hope that it will be useful,
13
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 *  GNU General Public License for more details.
16
 
 *
17
 
 *  You should have received a copy of the GNU General Public License
18
 
 *  along with this program; if not, write to the Free Software
19
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
 
 */
21
 
 
22
 
#ifndef DRIZZLED_PLUGIN_SCHEDULER_H
23
 
#define DRIZZLED_PLUGIN_SCHEDULER_H
24
 
 
25
 
#include "drizzled/plugin/plugin.h"
26
 
 
27
 
#include <string>
28
 
#include <vector>
29
 
 
30
 
namespace drizzled
31
 
{
32
 
class Session;
33
 
 
34
 
namespace plugin
35
 
{
36
 
 
37
 
/**
38
 
 * This class should be used by scheduler plugins to implement custom session
39
 
 * schedulers.
40
 
 */
41
 
class Scheduler : public Plugin
42
 
{
43
 
  /* Disable default constructors */
44
 
  Scheduler();
45
 
  Scheduler(const Scheduler &);
46
 
  Scheduler& operator=(const Scheduler &);
47
 
public:
48
 
  explicit Scheduler(std::string name_arg)
49
 
    : Plugin(name_arg, "Scheduler")
50
 
  {}
51
 
  virtual ~Scheduler() {}
52
 
 
53
 
  /**
54
 
   * Add a session to the scheduler. When the scheduler is ready to run the
55
 
   * session, it should call session->run().
56
 
   */
57
 
  virtual bool addSession(Session *session)= 0;
58
 
 
59
 
  /**
60
 
   * Notify the scheduler that it should be killed gracefully.
61
 
   */
62
 
  virtual void killSession(Session *) {}
63
 
 
64
 
  /**
65
 
   * This is called when a scheduler should kill the session immedaitely.
66
 
   */
67
 
  virtual void killSessionNow(Session *) {}
68
 
 
69
 
  static bool addPlugin(plugin::Scheduler *sced);
70
 
  static void removePlugin(plugin::Scheduler *sced);
71
 
  static bool setPlugin(const std::string& name);
72
 
  static Scheduler *getScheduler();
73
 
};
74
 
 
75
 
} /* namespace plugin */
76
 
} /* namespace drizzled */
77
 
 
78
 
#endif /* DRIZZLED_PLUGIN_SCHEDULER_H */