xrootd
XrdClDefaultEnv.hh
Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 // Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN)
00003 // Author: Lukasz Janyst <ljanyst@cern.ch>
00004 //------------------------------------------------------------------------------
00005 // XRootD is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU Lesser General Public License as published by
00007 // the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // XRootD is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public License
00016 // along with XRootD.  If not, see <http://www.gnu.org/licenses/>.
00017 //------------------------------------------------------------------------------
00018 
00019 #ifndef __XRD_CL_DEFAULT_ENV_HH__
00020 #define __XRD_CL_DEFAULT_ENV_HH__
00021 
00022 #include "XrdSys/XrdSysPthread.hh"
00023 #include "XrdCl/XrdClEnv.hh"
00024 #include "XrdVersion.hh"
00025 
00026 class XrdSysPlugin;
00027 
00028 namespace XrdCl
00029 {
00030   class PostMaster;
00031   class Log;
00032   class ForkHandler;
00033   class Monitor;
00034   class CheckSumManager;
00035   class TransportManager;
00036   class FileTimer;
00037 
00038   //----------------------------------------------------------------------------
00042   //----------------------------------------------------------------------------
00043   class DefaultEnv: public Env
00044   {
00045     public:
00046       //------------------------------------------------------------------------
00048       //------------------------------------------------------------------------
00049       DefaultEnv();
00050 
00051       //------------------------------------------------------------------------
00053       //------------------------------------------------------------------------
00054       static Env *GetEnv();
00055 
00056       //------------------------------------------------------------------------
00058       //------------------------------------------------------------------------
00059       static PostMaster *GetPostMaster();
00060 
00061       //------------------------------------------------------------------------
00063       //------------------------------------------------------------------------
00064       static Log *GetLog();
00065 
00066       //------------------------------------------------------------------------
00068       //------------------------------------------------------------------------
00069       static ForkHandler *GetForkHandler();
00070 
00071       //------------------------------------------------------------------------
00073       //------------------------------------------------------------------------
00074       static FileTimer *GetFileTimer();
00075 
00076       //------------------------------------------------------------------------
00078       //------------------------------------------------------------------------
00079       static Monitor *GetMonitor();
00080 
00081       //------------------------------------------------------------------------
00083       //------------------------------------------------------------------------
00084       static CheckSumManager *GetCheckSumManager();
00085 
00086       //------------------------------------------------------------------------
00088       //------------------------------------------------------------------------
00089       static TransportManager *GetTransportManager();
00090 
00091       //------------------------------------------------------------------------
00093       //------------------------------------------------------------------------
00094       static void Initialize();
00095 
00096       //------------------------------------------------------------------------
00098       //------------------------------------------------------------------------
00099       static void Finalize();
00100 
00101       //------------------------------------------------------------------------
00103       //------------------------------------------------------------------------
00104       static void ReInitializeLogging();
00105 
00106     private:
00107       static void SetUpLog();
00108 
00109       static XrdSysMutex        sInitMutex;
00110       static Env               *sEnv;
00111       static PostMaster        *sPostMaster;
00112       static Log               *sLog;
00113       static ForkHandler       *sForkHandler;
00114       static FileTimer         *sFileTimer;
00115       static Monitor           *sMonitor;
00116       static XrdSysPlugin      *sMonitorLibHandle;
00117       static bool               sMonitorInitialized;
00118       static CheckSumManager   *sCheckSumManager;
00119       static TransportManager  *sTransportManager;
00120   };
00121 }
00122 
00123 #endif // __XRD_CL_DEFAULT_ENV_HH__