00001 00006 #include "EventFilter/ResourceBroker/interface/SharedResources.h" 00007 #include "EventFilter/ResourceBroker/interface/RBStateMachine.h" 00008 00009 #include <iostream> 00010 00011 using std::string; 00012 using namespace evf::rb_statemachine; 00013 00014 // entry action, state notification 00015 //______________________________________________________________________________ 00016 void Enabled::do_entryActionWork() { 00017 } 00018 00019 void Enabled::do_stateNotify() { 00020 SharedResourcesPtr_t res = outermost_context().getSharedResources(); 00021 LOG4CPLUS_INFO(res->log_, "--> ResourceBroker: NEW STATE: " << stateName()); 00022 outermost_context().setExternallyVisibleState(stateName()); 00023 outermost_context().setInternalStateName(stateName()); 00024 // notify RCMS of the new state 00025 outermost_context().rcmsStateChangeNotify(); 00026 } 00027 00028 // construction / destruction 00029 //______________________________________________________________________________ 00030 Enabled::Enabled(my_context c) : 00031 my_base(c) { 00032 safeEntryAction(); 00033 } 00034 00035 Enabled::~Enabled() { 00036 safeExitAction(); 00037 } 00038 00039 // exit action, state name, move to failed state 00040 //______________________________________________________________________________ 00041 void Enabled::do_exitActionWork() { 00042 } 00043 00044 string Enabled::do_stateName() const { 00045 return string("Enabled"); 00046 } 00047 00048 void Enabled::do_moveToFailedState(xcept::Exception& exception) const { 00049 SharedResourcesPtr_t res = outermost_context().getSharedResources(); 00050 res->reasonForFailed_ = exception.what(); 00051 LOG4CPLUS_ERROR(res->log_, 00052 "Moving to FAILED state! Reason: " << exception.what()); 00053 EventPtr fail(new Fail()); 00054 res->commands_.enqEvent(fail); 00055 }