xrootd
XrdClDefaultEnv.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN)
3 // Author: Lukasz Janyst <ljanyst@cern.ch>
4 //------------------------------------------------------------------------------
5 // XRootD is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // XRootD is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
17 //------------------------------------------------------------------------------
18 
19 #ifndef __XRD_CL_DEFAULT_ENV_HH__
20 #define __XRD_CL_DEFAULT_ENV_HH__
21 
22 #include "XrdSys/XrdSysPthread.hh"
23 #include "XrdCl/XrdClEnv.hh"
24 #include "XrdVersion.hh"
25 
26 class XrdSysPlugin;
27 
28 namespace XrdCl
29 {
30  class PostMaster;
31  class Log;
32  class ForkHandler;
33  class Monitor;
34  class CheckSumManager;
35  class TransportManager;
36  class FileTimer;
37  class PlugInManager;
38  class PlugInFactory;
39 
40  //----------------------------------------------------------------------------
44  //----------------------------------------------------------------------------
45  class DefaultEnv: public Env
46  {
47  public:
48  //------------------------------------------------------------------------
50  //------------------------------------------------------------------------
51  DefaultEnv();
52 
53  //------------------------------------------------------------------------
55  //------------------------------------------------------------------------
56  static Env *GetEnv();
57 
58  //------------------------------------------------------------------------
60  //------------------------------------------------------------------------
61  static PostMaster *GetPostMaster();
62 
63  //------------------------------------------------------------------------
65  //------------------------------------------------------------------------
66  static Log *GetLog();
67 
68  //------------------------------------------------------------------------
72  //------------------------------------------------------------------------
73  static void SetLogLevel( const std::string &level );
74 
75  //------------------------------------------------------------------------
79  //------------------------------------------------------------------------
80  static bool SetLogFile( const std::string &filepath );
81 
82  //------------------------------------------------------------------------
103  //------------------------------------------------------------------------
104  static void SetLogMask( const std::string &level,
105  const std::string &mask );
106 
107  //------------------------------------------------------------------------
109  //------------------------------------------------------------------------
110  static ForkHandler *GetForkHandler();
111 
112  //------------------------------------------------------------------------
114  //------------------------------------------------------------------------
115  static FileTimer *GetFileTimer();
116 
117  //------------------------------------------------------------------------
119  //------------------------------------------------------------------------
120  static Monitor *GetMonitor();
121 
122  //------------------------------------------------------------------------
124  //------------------------------------------------------------------------
125  static CheckSumManager *GetCheckSumManager();
126 
127  //------------------------------------------------------------------------
129  //------------------------------------------------------------------------
131 
132  //------------------------------------------------------------------------
134  //------------------------------------------------------------------------
135  static PlugInManager *GetPlugInManager();
136 
137  //------------------------------------------------------------------------
141  //------------------------------------------------------------------------
142  static PlugInFactory *GetPlugInFactory( const std::string url );
143 
144  //------------------------------------------------------------------------
146  //------------------------------------------------------------------------
147  static void Initialize();
148 
149  //------------------------------------------------------------------------
151  //------------------------------------------------------------------------
152  static void Finalize();
153 
154  //------------------------------------------------------------------------
156  //------------------------------------------------------------------------
157  static void ReInitializeLogging();
158 
159  private:
160  static void SetUpLog();
161 
163  static Env *sEnv;
165  static Log *sLog;
166  static ForkHandler *sForkHandler;
167  static FileTimer *sFileTimer;
168  static Monitor *sMonitor;
170  static bool sMonitorInitialized;
171  static CheckSumManager *sCheckSumManager;
173  static PlugInManager *sPlugInManager;
174  };
175 }
176 
177 #endif // __XRD_CL_DEFAULT_ENV_HH__
static PostMaster * sPostMaster
Definition: XrdClDefaultEnv.hh:164
static TransportManager * sTransportManager
Definition: XrdClDefaultEnv.hh:172
An abstract class to describe the client-side monitoring plugin interface.
Definition: XrdClMonitor.hh:53
static FileTimer * GetFileTimer()
Get file timer task.
Manage transport handler objects.
Definition: XrdClTransportManager.hh:32
static Monitor * sMonitor
Definition: XrdClDefaultEnv.hh:168
static Env * GetEnv()
Get default client environment.
static Monitor * GetMonitor()
Get the monitor object.
static void Finalize()
Finalize the environment.
static void ReInitializeLogging()
Re-initialize the logging.
static void SetLogLevel(const std::string &level)
static Log * GetLog()
Get default log.
Definition: XrdSysPthread.hh:140
static ForkHandler * GetForkHandler()
Get the fork handler.
Definition: XrdSysPlugin.hh:52
static CheckSumManager * GetCheckSumManager()
Get checksum manager.
static XrdSysMutex sInitMutex
Definition: XrdClDefaultEnv.hh:162
static PlugInFactory * GetPlugInFactory(const std::string url)
static Env * sEnv
Definition: XrdClDefaultEnv.hh:163
static void Initialize()
Initialize the environment.
static CheckSumManager * sCheckSumManager
Definition: XrdClDefaultEnv.hh:171
static PlugInManager * sPlugInManager
Definition: XrdClDefaultEnv.hh:173
static FileTimer * sFileTimer
Definition: XrdClDefaultEnv.hh:167
static void SetUpLog()
Definition: XrdClEnv.hh:28
static bool SetLogFile(const std::string &filepath)
static void SetLogMask(const std::string &level, const std::string &mask)
Definition: XrdClDefaultEnv.hh:45
static TransportManager * GetTransportManager()
Get transport manager.
static XrdSysPlugin * sMonitorLibHandle
Definition: XrdClDefaultEnv.hh:169
Definition: XrdClEnv.hh:36
static Log * sLog
Definition: XrdClDefaultEnv.hh:165
DefaultEnv()
Constructor.
A hub for dispatching and receiving messages.
Definition: XrdClPostMaster.hh:42
static PostMaster * GetPostMaster()
Get default post master.
static PlugInManager * GetPlugInManager()
Get plug-in manager.
static ForkHandler * sForkHandler
Definition: XrdClDefaultEnv.hh:166
static bool sMonitorInitialized
Definition: XrdClDefaultEnv.hh:170