![]() |
ATLAS Offline Software
|
#include <JiveXMLServer.h>
Public Member Functions | |
| JiveXMLServer (int port=0) | |
| Constructor. | |
| virtual | ~JiveXMLServer () |
| Destructor. | |
IEventReceiver methods | |
| virtual StatusCode | UpdateEventForStream (const EventStreamID &evtStreamID, const std::string &event) override |
| Put this event as new current event for stream given by name. | |
IEventServer methods | |
| virtual std::vector< std::string > | GetStreamNames () const override |
| get the names of all the streams | |
| virtual const EventStreamID | GetEventStreamID (const std::string &streamName) const override |
| get the current EventStreamID for a particular stream | |
| virtual const std::string | GetEvent (const EventStreamID &evtStreamID) const override |
| get the current event for a particular stream | |
| virtual int | GetState () const override |
| get the Status of the application | |
| virtual void | Message (const MSG::Level level, const std::string &msg) const override |
| This function is exposed to allow using ERS messaging service from other threads. | |
| virtual MSG::Level | LogLevel () const override |
| Get the logging level. | |
Event serving thread control | |
| static std::promise< int > m_receivedSignal | ATLAS_THREAD_SAFE |
| int | m_portNumber |
| EventStreamMap | m_eventStreamMap |
| std::timed_mutex m_accessLock | ATLAS_THREAD_SAFE |
| pthread_t | m_ServerThreadHandle |
| bool | m_runServerThread |
| StatusCode | StartServingThread () |
| Start the serving thread. | |
| StatusCode | StopServingThread () |
| Stop the serving thread. | |
| virtual bool | GetRunServerFlag () const override |
| The server thread will stop once this flag is set to false. | |
| virtual void | ServerThreadStopped () override |
| Callback whenever the server thread is stopped. | |
| void | Wait () |
| Wait for the server finish. | |
| static void | signalHandler (int signum) |
| When the signal handler is called, switch the lock to the post condition. | |
Definition at line 37 of file JiveXMLServer.h.
| JiveXMLServer::JiveXMLServer | ( | int | port = 0 | ) |
Constructor.
Definition at line 35 of file JiveXMLServer.cxx.
|
virtual |
Destructor.
Definition at line 52 of file JiveXMLServer.cxx.
|
overridevirtual |
get the current event for a particular stream
Return the event for a given stream.
Implements JiveXML::IEventServer.
Definition at line 281 of file JiveXMLServer.cxx.
|
overridevirtual |
get the current EventStreamID for a particular stream
Return the EventStreamID for the last event of a given stream.
Implements JiveXML::IEventServer.
Definition at line 265 of file JiveXMLServer.cxx.
|
inlineoverridevirtual |
The server thread will stop once this flag is set to false.
Implements JiveXML::IEventServer.
Definition at line 79 of file JiveXMLServer.h.
|
overridevirtual |
get the Status of the application
Return the current athena state.
at the moement return a fixed value - will change this to some timeout condition soon.
Implements JiveXML::IEventServer.
Definition at line 240 of file JiveXMLServer.cxx.
|
overridevirtual |
get the names of all the streams
Return an array with all the stream names.
Implements JiveXML::IEventServer.
Definition at line 251 of file JiveXMLServer.cxx.
|
overridevirtual |
Get the logging level.
Currently only used to suppress client hostname lookup if not in debug mode.
Implements JiveXML::IMessage.
Definition at line 309 of file JiveXMLServer.cxx.
|
overridevirtual |
This function is exposed to allow using ERS messaging service from other threads.
Deliver a message - possibly from another thread - to ERS;.
Implements JiveXML::IMessage.
Definition at line 297 of file JiveXMLServer.cxx.
|
overridevirtual |
Callback whenever the server thread is stopped.
When the server thread stopped, we will also call the the signal handler with the special value -1.
Implements JiveXML::IServer.
Definition at line 177 of file JiveXMLServer.cxx.
|
staticprivate |
When the signal handler is called, switch the lock to the post condition.
Definition at line 155 of file JiveXMLServer.cxx.
| StatusCode JiveXMLServer::StartServingThread | ( | ) |
Start the serving thread.
Create the server by.
Definition at line 64 of file JiveXMLServer.cxx.
| StatusCode JiveXMLServer::StopServingThread | ( | ) |
Stop the serving thread.
Stop the server by.
Ping the server which will cause another request Otherwise the server won't update its loop condition
Definition at line 93 of file JiveXMLServer.cxx.
|
overridevirtual |
Put this event as new current event for stream given by name.
Get one event and put it as the new event for the this stream, which is identified by EventStreamID.
Implements JiveXML::IEventReceiver.
Definition at line 186 of file JiveXMLServer.cxx.
| void JiveXMLServer::Wait | ( | ) |
Wait for the server finish.
Wait for the server thread to finish.
This can be because a) we received a SIGTERM or SIGINT signal b) the server thread stopped by itself
Definition at line 165 of file JiveXMLServer.cxx.
|
mutableprivate |
Definition at line 106 of file JiveXMLServer.h.
|
inlinestaticprivate |
Definition at line 96 of file JiveXMLServer.h.
|
private |
Definition at line 103 of file JiveXMLServer.h.
|
private |
Definition at line 100 of file JiveXMLServer.h.
|
private |
Definition at line 113 of file JiveXMLServer.h.
|
private |
Definition at line 109 of file JiveXMLServer.h.