HelloWorld2 Class Reference

This client connects to xmlBlaster and subscribes to a message. More...

Inheritance diagram for HelloWorld2:

Inheritance graph
[legend]
Collaboration diagram for HelloWorld2:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 HelloWorld2 (Global &glob)
virtual ~HelloWorld2 ()
bool reachedAlive (StatesEnum, I_ConnectionsHandler *connectionsHandler)
 This is the callback method invoked from org::xmlBlaster::util::dispatch::ConnectionsHandler notifying the client that a connection has been established and that its status is now ALIVE.
void reachedDead (StatesEnum, I_ConnectionsHandler *)
 This is the callback method invoked from org::xmlBlaster::util::dispatch::ConnectionsHandler informing the client that the connection was lost (i.e.
void reachedPolling (StatesEnum, I_ConnectionsHandler *connectionsHandler)
 This is the callback method invoked from org::xmlBlaster::util::dispatch::ConnectionsHandler informing the client that the connection state has changed to POLLING.
void execute ()
string update (string &sessionId, UpdateKey &updateKey, unsigned char *content, long contentSize, UpdateQos &updateQos)
 Callbacks from xmlBlaster arrive here.

Detailed Description

This client connects to xmlBlaster and subscribes to a message.

We then publish the message and receive it asynchronous in the update() method.

Note that the CORBA layer is transparently hidden, and all code conforms to STD C++ (with STL).

 Invoke: HelloWorld2
 
See also:
xmlBlaster interface

Definition at line 35 of file HelloWorld2.cpp.


Constructor & Destructor Documentation

HelloWorld2::HelloWorld2 ( Global glob  ) 

Definition at line 44 of file HelloWorld2.cpp.

References org::xmlBlaster::util::I_Log::info().

virtual HelloWorld2::~HelloWorld2 (  )  [virtual]

Definition at line 55 of file HelloWorld2.cpp.


Member Function Documentation

bool HelloWorld2::reachedAlive ( StatesEnum  oldState,
I_ConnectionsHandler connectionsHandler 
) [virtual]

This is the callback method invoked from org::xmlBlaster::util::dispatch::ConnectionsHandler notifying the client that a connection has been established and that its status is now ALIVE.

It has a bool return which informs the org::xmlBlaster::util::dispatch::ConnectionsHandler what to do with the entries in the queue. If you return 'true', then the queue is flushed (i.e. the contents of the queue are sent to xmlBlaster). If you return 'false', then the contents of the queue are left untouched. You can then erase all entries manually. Note that this method is invoked also when the connection has been established the first time.

Implements org::xmlBlaster::client::I_ConnectionProblems.

Definition at line 60 of file HelloWorld2.cpp.

References org::xmlBlaster::util::queue::I_Queue::clear(), org::xmlBlaster::util::queue::I_Queue::getNumOfEntries(), org::xmlBlaster::util::dispatch::I_ConnectionsHandler::getQueue(), and org::xmlBlaster::util::I_Log::info().

void HelloWorld2::reachedDead ( StatesEnum  oldState,
I_ConnectionsHandler connectionsHandler 
) [virtual]

This is the callback method invoked from org::xmlBlaster::util::dispatch::ConnectionsHandler informing the client that the connection was lost (i.e.

when the state of the connectionsHandler has gone to DEAD).

Implements org::xmlBlaster::client::I_ConnectionProblems.

Definition at line 71 of file HelloWorld2.cpp.

References org::xmlBlaster::util::I_Log::info().

void HelloWorld2::reachedPolling ( StatesEnum  oldState,
I_ConnectionsHandler connectionsHandler 
) [virtual]

This is the callback method invoked from org::xmlBlaster::util::dispatch::ConnectionsHandler informing the client that the connection state has changed to POLLING.

Implements org::xmlBlaster::client::I_ConnectionProblems.

Definition at line 76 of file HelloWorld2.cpp.

References org::xmlBlaster::util::queue::I_Queue::getNumOfEntries(), org::xmlBlaster::util::dispatch::I_ConnectionsHandler::getQueue(), and org::xmlBlaster::util::I_Log::info().

void HelloWorld2::execute (  ) 

Definition at line 85 of file HelloWorld2.cpp.

References org::xmlBlaster::client::XmlBlasterAccess::connect(), org::xmlBlaster::client::XmlBlasterAccess::disconnect(), org::xmlBlaster::client::XmlBlasterAccess::erase(), org::xmlBlaster::util::I_Log::error(), org::xmlBlaster::util::Property::get(), org::xmlBlaster::util::queue::I_Queue::getNumOfEntries(), org::xmlBlaster::util::Global::getProperty(), org::xmlBlaster::client::XmlBlasterAccess::getQueue(), org::xmlBlaster::util::I_Log::info(), org::xmlBlaster::client::XmlBlasterAccess::initFailsafe(), org::xmlBlaster::client::XmlBlasterAccess::publish(), org::xmlBlaster::client::XmlBlasterAccess::receive(), org::xmlBlaster::client::qos::SubscribeQos::setMultiSubscribe(), org::xmlBlaster::client::key::PublishKey::setOid(), org::xmlBlaster::client::key::UnSubscribeKey::setOid(), org::xmlBlaster::util::thread::Thread::sleep(), org::xmlBlaster::client::XmlBlasterAccess::subscribe(), org::xmlBlaster::util::XmlBlasterException::toXml(), org::xmlBlaster::client::qos::PublishReturnQos::toXml(), org::xmlBlaster::util::MessageUnit::toXml(), org::xmlBlaster::client::qos::SubscribeReturnQos::toXml(), org::xmlBlaster::client::qos::UnSubscribeQos::toXml(), org::xmlBlaster::client::key::UnSubscribeKey::toXml(), and org::xmlBlaster::util::qos::ConnectQosData::toXml().

Referenced by main().

string HelloWorld2::update ( string &  sessionId,
UpdateKey updateKey,
unsigned char *  content,
long  contentSize,
UpdateQos updateQos 
)

Callbacks from xmlBlaster arrive here.

Definition at line 202 of file HelloWorld2.cpp.

References org::xmlBlaster::util::I_Log::info(), org::xmlBlaster::client::qos::GetReturnQos::toXml(), and org::xmlBlaster::client::key::MsgKeyBase::toXml().


The documentation for this class was generated from the following file: