Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4WatchRunnable.cxx

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TGo4WatchRunnable.h"
00017 
00018 #include "TGo4Log.h"
00019 #include "TGo4Thread.h"
00020 #include "TGo4ClientStatus.h"
00021 
00022 const UInt_t TGo4WatchRunnable::fguWATCHINTERVAL=5000;
00023 
00024 TGo4WatchRunnable::TGo4WatchRunnable(const char* name, TGo4ExampleClient* cli)
00025 : TGo4Runnable(name,cli)
00026 {
00027    TRACE((15,"TGo4WatchRunnable::TGo4WatchRunnable(Text_t*,TGo4ExampleClient*) constructor",__LINE__, __FILE__));
00028    fxApplication=cli->GetApplication();
00029 }
00030 
00031 TGo4WatchRunnable::~TGo4WatchRunnable()
00032 {
00033   TRACE((15,"TGo4WatchRunnable::~TGo4WatchRunnable() destructor",__LINE__, __FILE__));
00034 
00035 }
00036 
00037 Int_t TGo4WatchRunnable::Run(void*)
00038 {
00039    TRACE((12,"TGo4WatchRunnable::Run()",__LINE__, __FILE__));
00040    TGo4ClientTask* cli= dynamic_cast<TGo4ClientTask*> (fxManager);
00041    if(cli)
00042    {
00043       cli->UpdateStatusBuffer(); // will create status object and stream it into TBuffer
00044       cli->SendStatusBuffer();   // send TBuffer with most recent client status
00045        // note: updating and sending of status buffer may be separated
00046        // into different threads. Updating aquires main mutex, sending usually
00047        // works without main mutex.
00048    if(fxApplication)
00049       {
00050          cli->SendStatusMessage(1,kTRUE,"Application %s of client %s has been watched",
00051                               fxApplication->GetName(),
00052                               cli->GetName());
00053          // method to pass text messages of priorities 0,1,2
00054          // (info, warning, error) to the server. kTRUE means additional local printout
00055       }
00056    }
00057    TGo4Thread::Sleep(fguWATCHINTERVAL); // wait for the next update
00058    return 0;
00059 }
00060 
00061 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:31 2008 for Go4-v3.04-1 by  doxygen 1.4.2