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