11 using namespace evf::rb_statemachine;
23 LOG4CPLUS_INFO(res->log_,
"--> ResourceBroker: NEW STATE: " << stateName());
24 outermost_context().setExternallyVisibleState(stateName());
25 outermost_context().setInternalStateName(stateName());
35 LOG4CPLUS_INFO(res->log_,
"Start configuring ...");
42 res->configureResources(outermost_context().getApp());
44 if (res->shmInconsistent_) {
45 std::ostringstream ost;
47 <<
"configuring FAILED: Inconsistency in ResourceTable - nbRaw="
48 << res->nbRawCells_.value_ <<
" but nbResources="
49 << res->resourceStructure_->nbResources()
50 <<
" and nbFreeSlots="
51 << res->resourceStructure_->nbFreeSlots();
55 LOG4CPLUS_INFO(res->log_,
"Finished configuring!");
58 res->commands_.enqEvent(configureDone);
82 return string(
"Configuring");
87 res->reasonForFailed_ = exception.what();
88 LOG4CPLUS_FATAL(res->log_,
89 "Moving to FAILED state! Reason: " << exception.what());
91 res->commands_.enqEvent(fail);
99 xdaq::Application* app = outermost_context().getApp();
101 typedef set<xdaq::ApplicationDescriptor*> AppDescSet_t;
102 typedef AppDescSet_t::iterator AppDescIter_t;
107 app->getApplicationContext()->getDefaultZone()-> getApplicationDescriptors(
108 res->buClassName_.toString());
115 for (AppDescIter_t it = setOfBUs.begin(); it != setOfBUs.end(); ++it)
117 if ((*it)->getInstance() == res->buInstance_)
119 res->bu_ =
new BUProxy(app->getApplicationDescriptor(), *it,
120 app->getApplicationContext(), res->i2oPool_);
123 string msg = res->sourceId_ +
" failed to locate input BU!";
130 app->getApplicationContext()->getDefaultZone()-> getApplicationDescriptors(
131 res->smClassName_.toString());
138 for (AppDescIter_t it = setOfSMs.begin(); it != setOfSMs.end(); ++it)
139 if ((*it)->getInstance() == res->smInstance_)
140 res->sm_ =
new SMProxy(app->getApplicationDescriptor(), *it,
141 app->getApplicationContext(), res->i2oPool_);
144 LOG4CPLUS_WARN(res->log_,
145 res->sourceId_ <<
" failed to locate output SM!");
boost::shared_ptr< SharedResources > SharedResourcesPtr_t
boost::shared_ptr< boost::statechart::event_base > EventPtr
void connectToBUandSM() const
virtual void do_entryActionWork()
virtual std::string do_stateName() const
virtual void do_stateNotify()
virtual void do_moveToFailedState(xcept::Exception &exception) const
virtual void do_exitActionWork()
virtual void do_stateAction() const
void set(const std::string &name, int value)
set the flag, with a run-time name