org::xmlBlaster::client::protocol::corba::CorbaDriverFactory Class Reference

Factory used to create instances of CorbaDriver objects. More...

Inheritance diagram for org::xmlBlaster::client::protocol::corba::CorbaDriverFactory:

Inheritance graph
[legend]
Collaboration diagram for org::xmlBlaster::client::protocol::corba::CorbaDriverFactory:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ~CorbaDriverFactory ()
CorbaDrivergetDriverInstance (org::xmlBlaster::util::Global *global)
 gets an instance of a corba driver with the specified name.
int killDriverInstance (org::xmlBlaster::util::Global *global)
 Kills the driver instance owned by the specified Global.

Static Public Member Functions

static CorbaDriverFactorygetFactory (org::xmlBlaster::util::Global &global, CORBA::ORB_ptr orb=((void *) 0))
 You can assign only one orb per CorbaDriverFactory object.

Friends

class Object_Lifetime_Manager
class ManagedObject
CorbaDriverFactorygetFactory (org::xmlBlaster::util::Global &global, CORBA::ORB_ptr orb=((void *) 0))

Detailed Description

Factory used to create instances of CorbaDriver objects.

It currently is a singleton class and has for that reason private constructors, destructor and assignment operator. To get a reference to the singleton instance you must invoke getFactory(...).

This factory has a running thread in which the orb performs its work. For threadsafe orbs, this is a blocking invocation to orb.run() (which exits when shutting down the orb). For singlethreaded orbs, it is a loop invoking orb.perform_work() with a sleep interval of 20 ms between each invocation to that method.

You can either pass to this factory a previously instantiated orb by passing it explicitly, or you can let it instantiate the default orb (with the arguments you passed at application startup) by not passing any orb or by passing NULL. If you pass an external orb, then this factory will not start the mentionned working thread nor it will free the orb resources. You must handle that on your own. If you let the factory create an orb instance, then this factory will start the thread and will cleanup all resources used by the orb.

Definition at line 47 of file CorbaDriverFactory.h.


Constructor & Destructor Documentation

org::xmlBlaster::client::protocol::corba::CorbaDriverFactory::~CorbaDriverFactory (  ) 

Definition at line 70 of file CorbaDriverFactory.cpp.

References org::xmlBlaster::util::thread::Thread::join().


Member Function Documentation

static CorbaDriverFactory& org::xmlBlaster::client::protocol::corba::CorbaDriverFactory::getFactory ( org::xmlBlaster::util::Global global,
CORBA::ORB_ptr  orb = ((void *) 0) 
) [static]

You can assign only one orb per CorbaDriverFactory object.

Since this class is currently a singleton, you can only assign one single orb to handle communication to xmlBlaster. So mixed orb implementation usage is still allowed, but to communicate to xmlBlaster you must use one single orb implementation per client application.

Parameters:
global the global parameter to pass
orb the orb to pass. Note that if you pass NULL (the default) then an own orb is initialized in the CorbaConnection class encapsulated by CorbaDriver. If you pass an orb different from NULL, then you are responsible of making the orb perform work and you must clean up its resources i.e. you must call expicitly shutdown and destroy on work completition.

CorbaDriver & org::xmlBlaster::client::protocol::corba::CorbaDriverFactory::getDriverInstance ( org::xmlBlaster::util::Global global  ) 

gets an instance of a corba driver with the specified name.

Definition at line 117 of file CorbaDriverFactory.cpp.

References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::util::Global::getLog(), org::xmlBlaster::util::lexical_cast(), and org::xmlBlaster::util::thread::Thread::start().

int org::xmlBlaster::client::protocol::corba::CorbaDriverFactory::killDriverInstance ( org::xmlBlaster::util::Global global  ) 

Kills the driver instance owned by the specified Global.

Note that if you invoked getDriverInstance several times with the same instanceName, you just decrement the internal reference counter. When the reference counter reaches zero, the driver is really destroyed.

Definition at line 150 of file CorbaDriverFactory.cpp.

References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::util::Global::getLog(), org::xmlBlaster::util::thread::Thread::join(), and org::xmlBlaster::util::lexical_cast().


Friends And Related Function Documentation

friend class Object_Lifetime_Manager [friend]

Definition at line 52 of file CorbaDriverFactory.h.

friend class ManagedObject [friend]

Definition at line 53 of file CorbaDriverFactory.h.

CorbaDriverFactory & org::xmlBlaster::client::protocol::corba::CorbaDriverFactory::getFactory ( org::xmlBlaster::util::Global global,
CORBA::ORB_ptr  orb = ((void *) 0) 
) [friend]

Definition at line 105 of file CorbaDriverFactory.cpp.


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