#include <StateMachine.h>
Public Member Functions | |
void | moveToFailedState (xcept::Exception &exception) const |
void | noFragmentToProcess () const |
Operations () | |
void | processI2OFragment (I2OChain &frag) const |
std::string | stateName () const |
virtual | ~Operations ()=0 |
Protected Member Functions | |
virtual void | do_entryActionWork ()=0 |
virtual void | do_exitActionWork ()=0 |
virtual void | do_moveToFailedState (xcept::Exception &exception) const =0 |
virtual void | do_noFragmentToProcess () const |
virtual void | do_processI2OFragment (I2OChain &frag) const |
virtual std::string | do_stateName () const =0 |
void | safeEntryAction () |
void | safeExitAction () |
Abstract base for state classes
Definition at line 85 of file StateMachine.h.
Operations::Operations | ( | ) |
Definition at line 17 of file Operations.cc.
{ //TransitionRecord tr( stateName(), true ); //outermost_context().updateHistory( tr ); }
Operations::~Operations | ( | ) | [pure virtual] |
Definition at line 23 of file Operations.cc.
{ //TransitionRecord tr( stateName(), false ); //outermost_context().updateHistory( tr ); }
virtual void stor::Operations::do_entryActionWork | ( | ) | [protected, pure virtual] |
virtual void stor::Operations::do_exitActionWork | ( | ) | [protected, pure virtual] |
virtual void stor::Operations::do_moveToFailedState | ( | xcept::Exception & | exception | ) | const [protected, pure virtual] |
void Operations::do_noFragmentToProcess | ( | ) | const [protected, virtual] |
Reimplemented in stor::Starting, stor::Stopping, stor::Halting, stor::Processing, stor::DrainingQueues, and stor::FinishingDQM.
Definition at line 140 of file Operations.cc.
{
//std::cout << stateName() << "::noFragmentToProcess()" << std::endl;
}
void Operations::do_processI2OFragment | ( | I2OChain & | frag | ) | const [protected, virtual] |
Reimplemented in stor::Processing.
Definition at line 55 of file Operations.cc.
{ //std::cout << stateName() << "::processI2OFragment()" << std::endl; // 20-Mar-2009, KAB: if we get a fragment when we are not supposed to get // one, should we still send a discard message to the resource broker? // If we don't, couldn't that cause problems upstream? If we do, though, // we could end up sending duplicate discard messages (one per fragment). // At a minimum, we should make sure that we don't try to use the discard // manager before it is available. // Of course, if we want to do this, we need to implement a way to get // a handle to the discard manager since outermost_context() doesn't // actually work here. // //if ( outermost_context().getSharedResources().get() != 0 && // outermost_context().getSharedResources()->discardManager_.get() != 0) // { // outermost_context().getSharedResources()->discardManager_->sendDiscardMessage(frag); // } }
virtual std::string stor::Operations::do_stateName | ( | ) | const [protected, pure virtual] |
void Operations::moveToFailedState | ( | xcept::Exception & | exception | ) | const |
Definition at line 44 of file Operations.cc.
{ do_moveToFailedState( exception ); }
void Operations::noFragmentToProcess | ( | ) | const |
Definition at line 34 of file Operations.cc.
Referenced by stor::Processing::do_processI2OFragment().
{ do_noFragmentToProcess(); }
void Operations::processI2OFragment | ( | I2OChain & | frag | ) | const |
Definition at line 29 of file Operations.cc.
{ do_processI2OFragment( frag ); }
void Operations::safeEntryAction | ( | ) | [protected] |
Definition at line 77 of file Operations.cc.
References alignCSCRings::e, exception, Exception, lumiQueryAPI::msg, and susybsm::HSCParticleType::unknown.
Referenced by stor::Constructed::Constructed(), stor::DrainingQueues::DrainingQueues(), stor::Enabled::Enabled(), stor::Failed::Failed(), stor::FinishingDQM::FinishingDQM(), stor::Halted::Halted(), stor::Halting::Halting(), stor::Normal::Normal(), stor::Processing::Processing(), stor::Ready::Ready(), stor::Running::Running(), stor::Starting::Starting(), stor::Stopped::Stopped(), and stor::Stopping::Stopping().
{ const std::string unknown = "unknown exception"; std::string msg = "Error going into " + stateName() + " state: "; try { do_entryActionWork(); } catch( xcept::Exception& e ) { XCEPT_DECLARE_NESTED( stor::exception::StateTransition, sentinelException, msg, e ); moveToFailedState( sentinelException ); } catch( std::exception& e ) { msg += e.what(); XCEPT_DECLARE( stor::exception::StateTransition, sentinelException, msg ); moveToFailedState( sentinelException ); } catch(...) { msg += "unknown exception"; XCEPT_DECLARE( stor::exception::StateTransition, sentinelException, msg ); moveToFailedState( sentinelException ); } }
void Operations::safeExitAction | ( | ) | [protected] |
Definition at line 108 of file Operations.cc.
References alignCSCRings::e, exception, Exception, lumiQueryAPI::msg, and susybsm::HSCParticleType::unknown.
Referenced by stor::Constructed::~Constructed(), stor::DrainingQueues::~DrainingQueues(), stor::Enabled::~Enabled(), stor::Failed::~Failed(), stor::FinishingDQM::~FinishingDQM(), stor::Halted::~Halted(), stor::Halting::~Halting(), stor::Normal::~Normal(), stor::Processing::~Processing(), stor::Ready::~Ready(), stor::Running::~Running(), stor::Starting::~Starting(), stor::Stopped::~Stopped(), and stor::Stopping::~Stopping().
{ const std::string unknown = "unknown exception"; std::string msg = "Error leaving " + stateName() + " state: "; try { do_exitActionWork(); } catch( xcept::Exception& e ) { XCEPT_DECLARE_NESTED( stor::exception::StateTransition, sentinelException, msg, e ); moveToFailedState( sentinelException ); } catch( std::exception& e ) { msg += e.what(); XCEPT_DECLARE( stor::exception::StateTransition, sentinelException, msg ); moveToFailedState( sentinelException ); } catch(...) { msg += "unknown exception"; XCEPT_DECLARE( stor::exception::StateTransition, sentinelException, msg ); moveToFailedState( sentinelException ); } }
std::string Operations::stateName | ( | ) | const |
Definition at line 39 of file Operations.cc.
Referenced by stor::FinishingDQM::do_entryActionWork(), stor::Stopped::do_entryActionWork(), stor::Enabled::do_entryActionWork(), stor::Stopping::do_entryActionWork(), stor::Halting::do_entryActionWork(), stor::Running::do_entryActionWork(), stor::Ready::do_entryActionWork(), stor::Processing::do_entryActionWork(), stor::Starting::do_entryActionWork(), stor::DrainingQueues::do_entryActionWork(), stor::Normal::do_exitActionWork(), stor::Enabled::do_exitActionWork(), stor::Halted::do_exitActionWork(), stor::Starting::do_exitActionWork(), stor::DrainingQueues::do_exitActionWork(), stor::Stopping::do_exitActionWork(), stor::Failed::do_exitActionWork(), stor::Constructed::do_exitActionWork(), stor::Ready::do_exitActionWork(), stor::Halting::do_exitActionWork(), stor::Processing::do_exitActionWork(), stor::FinishingDQM::do_exitActionWork(), stor::Running::do_exitActionWork(), stor::Stopped::do_exitActionWork(), and stor::StateMachine::getCurrentStateName().
{ return do_stateName(); }