00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4RemoveException.h"
00017
00018 #include "TThread.h"
00019
00020 #include "TGo4Log.h"
00021 #include "TGo4Thread.h"
00022 #include "TGo4ThreadManager.h"
00023 #include "TGo4ThreadHandler.h"
00024 #include "TGo4Runnable.h"
00025
00026 TGo4RemoveException::TGo4RemoveException(const TGo4RemoveException &right)
00027 :TGo4ThreadException(right)
00028 {
00029 TRACE((14,"TGo4RemoveException::TGo4RemoveException() copy constructor",__LINE__, __FILE__));
00030 }
00031
00032 TGo4RemoveException::TGo4RemoveException (TGo4Runnable* runnable, const Text_t* threadname)
00033 : TGo4ThreadException(runnable, threadname)
00034 {
00035 TRACE((14,"TGo4RemoveException::TGo4RemoveException(TGo4Runnable*, const Text_t*) constructor",__LINE__, __FILE__));
00036 fxDescription= "!!!-- Go4 Remove Exception --!!!";
00037 }
00038
00039
00040 TGo4RemoveException::~TGo4RemoveException()
00041 {
00042 TRACE((14,"TGo4RemoveException::~TGo4RemoveException() destructor",__LINE__, __FILE__));
00043 }
00044
00045
00046 TGo4RemoveException & TGo4RemoveException::operator=(const TGo4RemoveException &right)
00047 {
00048 TRACE((14,"TGo4RemoveException::operator=",__LINE__, __FILE__));
00049 if (&right!=this)
00050 {
00051 TRACE((13,"TGo4RemoveException::operator= processing copy",__LINE__, __FILE__));
00052 TGo4ThreadException::operator=(right);
00053
00054 return *this;
00055 }
00056 else
00057 {
00058
00059 TRACE((13,"TGo4RemoveException::operator= source and destination objects are identical",__LINE__, __FILE__));
00060 return *this;
00061 }
00062 }
00063
00064 Int_t TGo4RemoveException::Handle ()
00065 {
00066 TRACE((14,"TGo4RemoveException::Handle()",__LINE__, __FILE__));
00067 TString name;
00068 if(GetThreadName()==0)
00069
00070 {
00071 TRACE((13,"TGo4RemoveException::Handle() -- removing thread associated with runnable",__LINE__, __FILE__));
00072 name = fxRunnable->GetThread()->GetName();
00073 }
00074 else
00075
00076 {
00077 TRACE((13,"TGo4CancelException::Handle() -- removing thread by specified name",__LINE__, __FILE__));
00078 name = GetThreadName();
00079 }
00080 fxThreadHandler->RemoveThread(name.Data());
00081 TThread::CancelPoint();
00082 return 0;
00083 }
00084
00085