39 namespace pexExceptions = lsst::pex::exceptions;
67 throw LSST_EXCEPT(pexExceptions::RuntimeError,
"topic "+ topicName +
" is already registered with EventSystem");
75 throw LSST_EXCEPT(pexExceptions::RuntimeError,
"queue "+ queueName +
" is already registered with EventSystem");
87 throw LSST_EXCEPT(pexExceptions::RuntimeError,
"topic "+ topicName +
" is already registered with EventSystem");
93 throw LSST_EXCEPT(pexExceptions::RuntimeError,
"queue "+ queueName +
" is already registered with EventSystem");
102 throw LSST_EXCEPT(pexExceptions::RuntimeError,
"topic"+ topicName +
" is already registered with EventSystem");
111 throw LSST_EXCEPT(pexExceptions::RuntimeError,
"queue"+ queueName +
" is already registered with EventSystem");
120 throw LSST_EXCEPT(pexExceptions::RuntimeError,
"destination "+ destinationName +
" is not registered with EventSystem");
122 transmitter->publishEvent(event);
129 if ((transmitter)->getTopicName() == name) {
135 if ((qTransmitter)->getQueueName() == name) {
149 if ((receiver = getReceiver(destinationName)) == 0) {
150 throw LSST_EXCEPT(pexExceptions::RuntimeError,
"destination "+ destinationName +
" is not registered with EventSystem");
153 return receiver->receiveEvent(timeout);
164 if ((receiver)->getTopicName() == name)
168 if ((qReceiver)->getQueueName() == name)
static EventSystem & getDefaultEventSystem()
return the default EventSystem object, which can access all previously created Transmitters and recei...
void publishEvent(std::string const &destinationName, Event &event)
send an event to a destination
Singleton use to make sure the events library is initialized.
void createEnqueuer(std::string const &hostName, std::string const &queueName, int hostPort=EventBroker::DEFAULTHOSTPORT)
create a EventQueuer to send messages to the message broker
Receive events from the event bus.
table::Key< std::string > name
static std::list< boost::shared_ptr< EventTransmitter > > _transmitters
static std::list< boost::shared_ptr< EventDequeuer > > _dequeuers
void createReceiver(std::string const &hostName, std::string const &topicName, int hostPort=EventBroker::DEFAULTHOSTPORT)
create an EventReceiver which will receive message
Receive events from the event bus.
Representation of an LSST Event.
Representation of an LSST CommandEvent.
defines the EventLibrary class
Receive events from the event bus.
static std::list< boost::shared_ptr< EventReceiver > > _receivers
static const long infiniteTimeout
Transmit events to the event bus.
void createDequeuer(std::string const &hostName, std::string const &queueName, int hostPort=EventBroker::DEFAULTHOSTPORT)
create a EventDequeuer which will receive message
Transmit events to the event bus.
static EventSystem * defaultEventSystem
#define LSST_EXCEPT(type,...)
static std::list< boost::shared_ptr< EventEnqueuer > > _enqueuers
Representation of an LSST Event.
boost::shared_ptr< Transmitter > getTransmitter(std::string const &name)
Represent process that created an event.
void createTransmitter(std::string const &hostName, std::string const &topicName, int hostPort=EventBroker::DEFAULTHOSTPORT)
create an EventTransmitter to send messages to the message broker
static void initializeLibrary()
initialize the ActiveMQ library, but only do it once.
boost::shared_ptr< Receiver > getReceiver(std::string const &name)
Transmit events to the event bus.
This object allows creation of the system's event transmitters and receivers, which can be specified ...
defines the EventSystem class