Go to the documentation of this file.00001
00003
00004 #include "EventFilter/StorageManager/interface/ErrorStreamConfigurationInfo.h"
00005 #include "EventFilter/StorageManager/interface/EventStreamConfigurationInfo.h"
00006 #include "EventFilter/StorageManager/interface/EventDistributor.h"
00007 #include "EventFilter/StorageManager/interface/FragmentStore.h"
00008 #include "EventFilter/StorageManager/interface/RegistrationCollection.h"
00009 #include "EventFilter/StorageManager/interface/SharedResources.h"
00010 #include "EventFilter/StorageManager/interface/StateMachine.h"
00011 #include "EventFilter/StorageManager/interface/TransitionRecord.h"
00012
00013 #include <iostream>
00014 #include <unistd.h>
00015
00016 using namespace std;
00017 using namespace stor;
00018
00019 Running::Running( my_context c ): my_base(c)
00020 {
00021 safeEntryAction();
00022 }
00023
00024 void Running::do_entryActionWork()
00025 {
00026
00027 TransitionRecord tr( stateName(), true );
00028 outermost_context().updateHistory( tr );
00029
00030 SharedResourcesPtr sharedResources =
00031 outermost_context().getSharedResources();
00032
00033
00034 EventDistributor* ed = outermost_context().getEventDistributor();
00035 EvtStrConfigListPtr evtCfgList = sharedResources->configuration_->
00036 getCurrentEventStreamConfig();
00037 ErrStrConfigListPtr errCfgList = sharedResources->configuration_->
00038 getCurrentErrorStreamConfig();
00039 ed->registerEventStreams(evtCfgList);
00040 ed->registerErrorStreams(errCfgList);
00041
00042
00043 sharedResources->registrationCollection_->clearRegistrations();
00044 ed->clearConsumers();
00045 sharedResources->eventQueueCollection_->removeQueues();
00046 sharedResources->dqmEventQueueCollection_->removeQueues();
00047
00048
00049 sharedResources->registrationCollection_->enableConsumerRegistration();
00050 }
00051
00052 Running::~Running()
00053 {
00054 safeExitAction();
00055 }
00056
00057 void Running::do_exitActionWork()
00058 {
00059
00060 TransitionRecord tr( stateName(), false );
00061 outermost_context().updateHistory( tr );
00062
00063 SharedResourcesPtr sharedResources =
00064 outermost_context().getSharedResources();
00065
00066
00067 sharedResources->registrationCollection_->disableConsumerRegistration();
00068
00069
00070 sharedResources->eventQueueCollection_->clearQueues();
00071 sharedResources->dqmEventQueueCollection_->clearQueues();
00072
00073
00074 sharedResources->fragmentQueue_->clear();
00075 sharedResources->streamQueue_->clear();
00076 sharedResources->dqmEventQueue_->clear();
00077 sharedResources->registrationQueue_->clear();
00078
00079
00080 outermost_context().getFragmentStore()->clear();
00081
00082 }
00083
00084 string Running::do_stateName() const
00085 {
00086 return std::string( "Running" );
00087 }
00088
00089 void Running::do_moveToFailedState( xcept::Exception& exception ) const
00090 {
00091 outermost_context().getSharedResources()->moveToFailedState( exception );
00092 }
00093
00094 void Running::logStopDoneRequest( const StopDone& request )
00095 {
00096 outermost_context().unconsumed_event( request );
00097 }
00098
00099 void Running::logHaltDoneRequest( const HaltDone& request )
00100 {
00101 outermost_context().unconsumed_event( request );
00102 }
00103
00104