ATLAS Offline Software
|
#include <JiveXMLServer.h>
Public Member Functions | |
JiveXMLServer (int port=0) | |
Constructor. More... | |
virtual | ~JiveXMLServer () |
Destructor. More... | |
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. More... | |
IEventServer methods | |
virtual std::vector< std::string > | GetStreamNames () const override |
get the names of all the streams More... | |
virtual const EventStreamID | GetEventStreamID (const std::string &streamName) const override |
get the current EventStreamID for a particular stream More... | |
virtual const std::string | GetEvent (const EventStreamID &evtStreamID) const override |
get the current event for a particular stream More... | |
virtual int | GetState () const override |
get the Status of the application More... | |
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. More... | |
virtual MSG::Level | LogLevel () const override |
Get the logging level. More... | |
Event serving thread control | |
static OWLSemaphore lock | ATLAS_THREAD_SAFE |
static std::atomic< int > | m_receivedSignal {0} |
int | portNumber |
EventStreamMap | m_eventStreamMap |
pthread_mutex_t m_accessLock | ATLAS_THREAD_SAFE |
pthread_t | m_ServerThreadHandle |
bool | m_runServerThread |
StatusCode | StartServingThread () |
Start the serving thread. More... | |
StatusCode | StopServingThread () |
Stop the serving thread. More... | |
virtual bool | GetRunServerFlag () const override |
The server thread will stop once this flag is set to false. More... | |
virtual void | ServerThreadStopped () override |
Callback whenever the server thread is stopped. More... | |
void | Wait () |
Wait for the server finish. More... | |
static void | signalHandler (int signum) |
When the signal handler is called, switch the lock to the post condition. More... | |
Definition at line 38 of file JiveXMLServer.h.
JiveXMLServer::JiveXMLServer | ( | int | port = 0 | ) |
|
virtual |
Destructor.
Definition at line 58 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 357 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 325 of file JiveXMLServer.cxx.
|
inlineoverridevirtual |
The server thread will stop once this flag is set to false.
Implements JiveXML::IEventServer.
Definition at line 80 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 279 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 290 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 401 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 389 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 192 of file JiveXMLServer.cxx.
|
staticprivate |
When the signal handler is called, switch the lock to the post condition.
Definition at line 169 of file JiveXMLServer.cxx.
StatusCode JiveXMLServer::StartServingThread | ( | ) |
Start the serving thread.
Create the server by.
Definition at line 70 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 107 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 201 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 181 of file JiveXMLServer.cxx.
|
inlinestaticprivate |
Definition at line 97 of file JiveXMLServer.h.
|
mutableprivate |
Definition at line 110 of file JiveXMLServer.h.
|
private |
Definition at line 107 of file JiveXMLServer.h.
|
inlinestaticprivate |
Definition at line 100 of file JiveXMLServer.h.
|
private |
Definition at line 117 of file JiveXMLServer.h.
|
private |
Definition at line 113 of file JiveXMLServer.h.
|
private |
Definition at line 104 of file JiveXMLServer.h.