CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/EventFilter/StorageManager/src/Failed.cc

Go to the documentation of this file.
00001 // $Id: Failed.cc,v 1.16 2011/03/07 15:31:32 mommsen Exp $
00003 
00004 #include "EventFilter/StorageManager/interface/Exception.h"
00005 #include "EventFilter/StorageManager/interface/DiskWriterResources.h"
00006 #include "EventFilter/StorageManager/interface/Notifier.h"
00007 #include "EventFilter/StorageManager/interface/StateMachine.h"
00008 #include "EventFilter/StorageManager/interface/StatisticsReporter.h"
00009 #include "EventFilter/StorageManager/interface/TransitionRecord.h"
00010 
00011 #include <iostream>
00012 
00013 using namespace std;
00014 using namespace stor;
00015 
00016 void Failed::do_entryActionWork()
00017 {
00018   TransitionRecord tr( stateName(), true );
00019   outermost_context().updateHistory( tr );
00020   outermost_context().setExternallyVisibleState( "Failed" );
00021   outermost_context().getNotifier()->reportNewState( "Failed" );
00022 
00023   // request that the streams that are currently configured in the disk
00024   // writer be destroyed (this has the side effect of closing files).
00025   // This should have been done by the Halting/Stopping entry actions,
00026   // but if we Fail, we need to do it here. No harm if we do it twice.
00027   outermost_context().getSharedResources()->
00028     diskWriterResources_->requestStreamDestruction();
00029 }
00030 
00031 Failed::Failed( my_context c ): my_base(c)
00032 {
00033   safeEntryAction();
00034 }
00035 
00036 void Failed::do_exitActionWork()
00037 {
00038   TransitionRecord tr( stateName(), false );
00039   outermost_context().updateHistory( tr );
00040 
00041   outermost_context().getSharedResources()->
00042     statisticsReporter_->getStateMachineMonitorCollection().clearStatusMessage();
00043 }
00044 
00045 Failed::~Failed()
00046 {
00047   safeExitAction();
00048 }
00049 
00050 string Failed::do_stateName() const
00051 {
00052   return std::string( "Failed" );
00053 }
00054 
00055 void Failed::do_moveToFailedState( xcept::Exception& exception ) const
00056 {
00057   // nothing can be done here
00058 }
00059 
00060