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