Definition at line 58 of file servantlocators.h.
typedef std::map<Key, PortableServer::Servant> OSB_CORBA::Locators::ActiveObjectMap [private] |
STL container to store a servant for each servant key.
Definition at line 395 of file servantlocators.h.
typedef std::list<Key> OSB_CORBA::Locators::EvictorQueue [private] |
STL container to store list of servant keys in the queue.
Definition at line 392 of file servantlocators.h.
typedef std::pair<unsigned long, unsigned long> OSB_CORBA::Locators::Key |
typedef OSB_LIB::RwGuard OSB_CORBA::Locators::RwGuard [private] |
OSB_CORBA::Locators::Locators | ( | unsigned long | maxSize = 10000 |
) | [explicit] |
OSB_CORBA::Locators::~Locators | ( | ) |
OSB_CORBA::Locators::Locators | ( | const Locators & | ) | [private] |
Prevent copying: not implemented.
PortableServer::Servant OSB_CORBA::Locators::find | ( | const OSB_LIB::Id2< T > & | id | ) | [inline] |
PortableServer::Servant OSB_CORBA::Locators::find | ( | const OSB_LIB::Id< T > & | id | ) | [inline] |
PortableServer::Servant OSB_CORBA::Locators::find | ( | const Key & | key | ) |
Search a servant in the STL map by the servant key.
Search a servant in the STL map.
The function will first check if oid is the part of the servantId, if it is, it will look for the servant in the STL map, else it would throw.
key | Key of the servant to be searched for. | |
oid | Unique id of OSB_LIB object. |
Referenced by find().
unsigned long OSB_CORBA::Locators::increaseCounter | ( | ) | [private] |
Check if oid is part of servant id.
An object id of a servant consists of an object id of the object and a sequence number. This function checks if the parameter oid is the same as the object id part of the servant id.
key | Object id of the servant. | |
oid | Object id of object in the library. |
static PortableServer::ObjectId_var OSB_CORBA::Locators::keyToOid | ( | const Key & | key | ) | [static] |
Convert a servant key to CORBA object id.
key | The servant key. |
static Key OSB_CORBA::Locators::makeKey | ( | const OSB_LIB::Id2< T > & | id | ) | [inline, static] |
Create a servant key from an OSB_LIB Id2.
The servant key consists of 2 parts. The id1 of Id2 becomes the first part, the id2 of Id2 becomes the second part.
id | The OSB_LIB Id2. |
Definition at line 115 of file servantlocators.h.
References makeKey().
static Key OSB_CORBA::Locators::makeKey | ( | const OSB_LIB::Id< T > & | id | ) | [inline, static] |
Create a servant key from an OSB_LIB Id.
The servant key consists of 2 parts. The value of the Id becomes the first part, the send part is filled as 0.
id | The OSB_LIB Id. |
Definition at line 100 of file servantlocators.h.
References makeKey().
Create a servant key from two integer values.
The servant key consists of 2 parts. If the k2 is omitted, the second part is filled as 0.
k1 | The integer value for 1st part of servant key. | |
k2 | The integer value for 2nd part of servant key. |
Referenced by find(), makeKey(), regServant(), and regServantInc().
Key OSB_CORBA::Locators::oidToKey | ( | const PortableServer::ObjectId & | oid | ) | throw (OsbCorbaException) [private] |
Convert an PortableServer::ObjectId to a servant locator key.
oid | Object id to be converted. |
OsbCorbaException | internal error -1 if conversion fails. |
Prevent assignment: not implemented.
virtual void OSB_CORBA::Locators::postinvoke | ( | const PortableServer::ObjectId & | oid, | |
PortableServer::POA_ptr | poa, | |||
const char * | operation, | |||
void * | cookie, | |||
PortableServer::Servant | servant | |||
) | throw (CORBA::SystemException) [virtual] |
This function is not used at all.
virtual PortableServer::Servant OSB_CORBA::Locators::preinvoke | ( | const PortableServer::ObjectId & | oid, | |
PortableServer::POA_ptr | poa, | |||
const char * | operation, | |||
void *& | cookie | |||
) | throw ( CORBA::SystemException, PortableServer::ForwardRequest ) [virtual] |
This function maintains the position of the servants in the queue.
Each time the servant is used, it is moved to the front of the queue.
oid | Object id of the servant. | |
poa | Not used. | |
operation | Only used for debug messages. | |
cookie | Not used. |
SystemException | if the servant is not found in queue. |
RwGuard OSB_CORBA::Locators::readlock | ( | ) | [private] |
Read lock the locator.
Register a read-only servant with the locator.
This function is the only way a new servant can be inserted into the locator queue. The servant at the end of the queue is deleted if the queue is full.
key | The servant key used for registering servant. | |
servant | Pointer to the newly created servant. |
OsbCorbaException |
|
Referenced by regServant(), and regServantInc().
Key OSB_CORBA::Locators::regServant | ( | PortableServer::Servant | servant | ) |
Register a servant with the locator.
Only the internal sequence number is used while creating servant key.
servant | Pointer to the newly created servant. |
OsbCorbaException |
|
Key OSB_CORBA::Locators::regServant | ( | const OSB_LIB::Id< T > & | id, | |
PortableServer::Servant | servant | |||
) | [inline] |
Register a read-only servant with the locator.
id | The OSB object id used for creating servant key. | |
servant | Pointer to the newly created servant. |
OsbCorbaException |
|
Definition at line 167 of file servantlocators.h.
References makeKey(), and registerServant().
Key OSB_CORBA::Locators::regServant | ( | const OSB_LIB::Id2< T > & | id, | |
PortableServer::Servant | servant | |||
) | [inline] |
Register a read-only servant with the locator.
id | Consist of id1 and id2 which will make up the servant key. | |
servant | Pointer to the newly created servant. |
OsbCorbaException |
|
Definition at line 146 of file servantlocators.h.
References makeKey(), and registerServant().
Key OSB_CORBA::Locators::regServantInc | ( | PortableServer::Servant | servant | ) |
Register a servant with the locator, increasing the internal counter.
Only the internal sequence number is used while creating servant key.
servant | Pointer to the newly created servant. |
OsbCorbaException | if the key as generated for this new servant already exists. |
Key OSB_CORBA::Locators::regServantInc | ( | const OSB_LIB::Id< T > & | id, | |
PortableServer::Servant | servant | |||
) | [inline] |
Register a servant with the locator, increasing the internal counter.
In OSB, all writer servants own a local copy of the respective object. To ensure no duplicated servant keys are created for them, the internal sequence number is used as part of the servant key.
The object id, passed here, is used to construct the first part of the servant key; while the second part is filled by internal sequence number.
This function should also be used to register multiple servants with the same object id. This is, e.g., the case if each client works against its own servants.
id | The integer value used for creating the servant key. | |
servant | Pointer to the newly created servant. |
OsbCorbaException | if the key as generated for this new servant already exists. |
Definition at line 217 of file servantlocators.h.
References increaseCounter(), makeKey(), and registerServant().
void OSB_CORBA::Locators::unregServant | ( | const Key & | key, | |
bool | destroy | |||
) |
Unregister a servant with the locator.
key | Key of the servant to remove. | |
destroy | Flag to delete the servant, see below. |
If destroy is false, the caller is responsible to call the destructor of the servant. This is typically the case if the function is called from the servant's destructor.
RwGuard OSB_CORBA::Locators::writelock | ( | ) | [private] |
Write lock the locator.
unsigned long OSB_CORBA::Locators::count_ [private] |
EvictorQueue OSB_CORBA::Locators::evictorQ_ [private] |
const std::string OSB_CORBA::Locators::IFC [static] |
bool OSB_CORBA::Locators::inDtor_ [private] |
Definition at line 405 of file servantlocators.h.
unsigned long OSB_CORBA::Locators::maxSize_ [private] |
OSB_LIB::RwMutex OSB_CORBA::Locators::mutex_ [private] |