org::xmlBlaster::util::EmbeddedServer Class Reference

Collaboration diagram for org::xmlBlaster::util::EmbeddedServer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 EmbeddedServer (org::xmlBlaster::util::Global &glob, std::string &jvmArguments="", std::string &applArguments="", org::xmlBlaster::client::XmlBlasterAccess *externalAccess=((void *) 0))
 To start the server, you need a java virtual machine, the xmlBlaster server installed and in the CLASSPATH.
virtual ~EmbeddedServer ()
bool stop (bool shutdownExternal=false, bool warnIfNotRunning=true)
 This method shuts down the xmlBlaster server which is responding to the request.
bool start (bool blockUntilUp=true)
 
Parameters:
blockUntilUp if set to 'true' the method blocks until the server really is reacheable (i.e.

bool isSomeServerResponding ()
 This method can be used to check if a server is already running and responding to requests.

Friends

class EmbeddedServerRunner

Detailed Description

Definition at line 42 of file EmbeddedServer.h.


Constructor & Destructor Documentation

org::xmlBlaster::util::EmbeddedServer::EmbeddedServer ( org::xmlBlaster::util::Global glob,
std::string &  jvmArguments = "",
std::string &  applArguments = "",
org::xmlBlaster::client::XmlBlasterAccess externalAccess = ((void *) 0) 
)

To start the server, you need a java virtual machine, the xmlBlaster server installed and in the CLASSPATH.

Alternatively you can pass these parameters to the jvm with the 'applArguments' programmatically. You also can pass application parameters to the xmlBlaster. For example you could set traces to true (-trace true).

Note that it uses the user 'embeddedTester' to check if a connection exists (if a server is responding) and a user 'embeddedKiller' to kill the server. If you have configured an authentication service for xmlBlaster make sure that these users have credentials and that 'embeddedKiller' has authorization to kill the server.

Parameters:
glob the global variable
jvmArguments the arguments to pass to the java virtual machine.
applArguments the arguments to pass to the application.
externalAccess the pointer to the external org::xmlBlaster::client::XmlBlasterAccess object. If this is NULL, then an own instance is created each time, otherwise the external is used. This parameter is needed where the communication protocol does not support multithreading.

Referenced by org::xmlBlaster::util::EmbeddedServerRunner::run().

org::xmlBlaster::util::EmbeddedServer::~EmbeddedServer (  )  [virtual]

Definition at line 80 of file EmbeddedServer.cpp.

References org::xmlBlaster::util::I_Log::call(), stop(), and org::xmlBlaster::util::I_Log::trace().


Member Function Documentation

bool org::xmlBlaster::util::EmbeddedServer::stop ( bool  shutdownExternal = false,
bool  warnIfNotRunning = true 
)

This method shuts down the xmlBlaster server which is responding to the request.

If the current embedded server is running it shuts it down. If the current embedded server is not running, this method will make a try to kill it only if the 'shutdownExternal' flag has been set to 'true'. This flag defaults to 'false'. The method returns 'true' if a server was shutdown, 'false' otherwise. It blocks until the thread really has stopped (it joins the thread)

Definition at line 135 of file EmbeddedServer.cpp.

References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::client::XmlBlasterAccess::connect(), org::xmlBlaster::util::XmlBlasterException::isCommunication(), org::xmlBlaster::util::thread::Thread::join(), org::xmlBlaster::client::XmlBlasterAccess::publish(), org::xmlBlaster::util::qos::ConnectQosData::setAddress(), org::xmlBlaster::util::qos::address::AddressBase::setDelay(), org::xmlBlaster::client::key::PublishKey::setOid(), org::xmlBlaster::util::I_Log::trace(), and org::xmlBlaster::util::I_Log::warn().

Referenced by org::xmlBlaster::test::TestSuite::stopEmbeddedServer(), org::xmlBlaster::test::TestEmbeddedServer::testEmbeddedServer(), and ~EmbeddedServer().

bool org::xmlBlaster::util::EmbeddedServer::start ( bool  blockUntilUp = true  ) 

Parameters:
blockUntilUp if set to 'true' the method blocks until the server really is reacheable (i.e.

a client has successfully been able to connect)

Definition at line 90 of file EmbeddedServer.cpp.

References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::util::COMMUNICATION_NOCONNECTION, org::xmlBlaster::client::XmlBlasterAccess::connect(), org::xmlBlaster::client::XmlBlasterAccess::disconnect(), EmbeddedServerRunner, org::xmlBlaster::util::I_Log::error(), org::xmlBlaster::util::XmlBlasterException::isCommunication(), org::xmlBlaster::util::qos::ConnectQosData::setAddress(), org::xmlBlaster::util::qos::address::AddressBase::setDelay(), org::xmlBlaster::util::thread::Thread::sleepSecs(), org::xmlBlaster::util::thread::Thread::start(), org::xmlBlaster::util::XmlBlasterException::toXml(), and org::xmlBlaster::util::I_Log::trace().

Referenced by org::xmlBlaster::test::TestSuite::startEmbeddedServer(), org::xmlBlaster::test::TestEmbeddedServer::testEmbeddedServer(), and org::xmlBlaster::test::TestSuite::TestSuite().

bool org::xmlBlaster::util::EmbeddedServer::isSomeServerResponding (  ) 

This method can be used to check if a server is already running and responding to requests.

Definition at line 177 of file EmbeddedServer.cpp.

References org::xmlBlaster::client::XmlBlasterAccess::connect(), org::xmlBlaster::util::XmlBlasterException::isCommunication(), org::xmlBlaster::util::qos::SessionQosData::setAbsoluteName(), and org::xmlBlaster::util::qos::ConnectQosData::setSessionQos().


Friends And Related Function Documentation

friend class EmbeddedServerRunner [friend]

Definition at line 44 of file EmbeddedServer.h.

Referenced by start().


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