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