Main Page | Class Hierarchy | Class List | File List | Class Members

RIPCSession Class Reference

#include <RIPCSession.h>

List of all members.

Public Member Functions

virtual RIPCEventcreateEvent (char const *name, bool signaled, bool manualReset)=0
virtual RIPCEventopenEvent (char const *name)=0
virtual RIPCSemaphorecreateSemaphore (char const *name, int initCount)=0
virtual RIPCSemaphoreopenSemaphore (char const *name)=0
virtual RIPCMutexcreateMutex (char const *name, bool locked)=0
virtual RIPCMutexopenMutex (char const *name)=0
virtual RIPCQueuecreateQueue (char const *name)=0
virtual RIPCQueueopenQueue (char const *name)=0
virtual RIPCSharedMemorycreateSharedMemory (char const *name, RIPCObject const &objDesc)=0
virtual RIPCSharedMemorycreateSharedMemory (char const *name, void const *obj, size_t objSize)=0
virtual RIPCSharedMemoryopenSharedMemory (char const *name)=0
virtual RIPCLockcreateLock (char const *name)=0
virtual RIPCLockopenLock (char const *name)=0
virtual RIPCBarriercreateBarrier (char const *name, int nSessions)=0
virtual RIPCBarrieropenBarrier (char const *name)=0
virtual void close ()=0
virtual void shutdownServer ()=0
virtual void showServerInfo (char *buf, size_t bufSize)=0
virtual bool isLocal ()=0
virtual bool isOk ()=0
virtual void getErrorText (char *buf, size_t bufSize)=0


Detailed Description

RIPC session. Session can be remote and local. Remote sessions establish conntection with the server through TCP/IP stream socket. In this case primitives at local computer servers as stubs and redirect requests to the server. This mode is useful to provide sycnhronization and communication between several Java processes at the same or different computers. Local sessions are useful to provide synhcronization of threads within the same process. The single local session can be shared by all threads.
Session interface provides methods for creating sycnhronization objects. Name of the object is unique with objects of the same type (events, semaphores,...). It is possible that, for example mutex and event has the same name.


Member Function Documentation

virtual void RIPCSession::close  )  [pure virtual]
 

Close session. This method disconnects client from server, release all locks hold by this session and close all primitives opened by this session.
Attention!You should no call this method for local sessions if it is shared by multiple threads

virtual RIPCBarrier* RIPCSession::createBarrier char const *  name,
int  nSessions
[pure virtual]
 

Create or return existed barrier synchronization object.

Parameters:
name unique barrier name.
nSessions positive number of sessions to be synchronized on barrier
Returns:
created or existed barrier, use alreadExists method to check if new object is created

virtual RIPCEvent* RIPCSession::createEvent char const *  name,
bool  signaled,
bool  manualReset
[pure virtual]
 

Create or return existed event synchronization object.

Parameters:
name unique event name.
signaled initial state of the event, ignored if mutex already exists
manualReset mode of the event, ignored if mutex already exists
Returns:
created or existed event, use alreadExists method to check if new object is created

virtual RIPCLock* RIPCSession::createLock char const *  name  )  [pure virtual]
 

Create or return existed lock synchronization object.

Parameters:
name unique lock name.
Returns:
created or existed lock, use alreadExists method to check if new object is created

virtual RIPCMutex* RIPCSession::createMutex char const *  name,
bool  locked
[pure virtual]
 

Create or return existed mutex synchronization object.

Parameters:
name unique mutex name.
locked initial state of the mutex, if true then it is owned by session created this mutex, ignored if mutex already exists
Returns:
created or existed mutex, use alreadExists method to check if new object is created

virtual RIPCQueue* RIPCSession::createQueue char const *  name  )  [pure virtual]
 

Create or return existed queue bject.

Parameters:
name unique queue name.
Returns:
created or existed queue, use alreadExists method to check if new object is created

virtual RIPCSemaphore* RIPCSession::createSemaphore char const *  name,
int  initCount
[pure virtual]
 

Create or return existed semaphore synchronization object.

Parameters:
name unique semaphore name.
initCount non-negative initial value of semaphore counter, ignored if mutex already exists
Returns:
created or existed semaphore, use alreadExists method to check if new object is created

virtual RIPCSharedMemory* RIPCSession::createSharedMemory char const *  name,
void const *  obj,
size_t  objSize
[pure virtual]
 

Create or return existed shared memory object.

Parameters:
name unique shared memory name.
obj non-null initial value of shared memory object
objSize size of object
Returns:
created or existed shared memory, use alreadExists method to check if new object is created

virtual RIPCSharedMemory* RIPCSession::createSharedMemory char const *  name,
RIPCObject const &  objDesc
[pure virtual]
 

Create or return existed shared memory object.

Parameters:
name unique shared memory name.
objDesc object descriptor of initial value of shared memory object
Returns:
created or existed shared memory, use alreadExists method to check if new object is created

virtual void RIPCSession::getErrorText char *  buf,
size_t  bufSize
[pure virtual]
 

Get communication error message in case of conenction failure. This method should be used if RIPCInternalException exception was thrown or isOk() method returns false

Parameters:
buf buffer where to place error message
bufSize buffer size, if length of error message is greater than size of the buffer, it will be trucated

virtual bool RIPCSession::isLocal  )  [pure virtual]
 

Checks whether it is local session

Returns:
true is session was created by means of RIPCServerFactory factory, false - if session was created by RIPCClientFactory.

virtual bool RIPCSession::isOk  )  [pure virtual]
 

Checks whether session is ok or not

Returns:
true if connection is successfully established for remote session or it is local session, false - if conenction can not be established. In last case error message can be obtained by getErrorText

virtual RIPCBarrier* RIPCSession::openBarrier char const *  name  )  [pure virtual]
 

Open existed barrier.

Parameters:
name barrier name
Returns:
barrier or null if barrier with such name doesn't exists

virtual RIPCEvent* RIPCSession::openEvent char const *  name  )  [pure virtual]
 

Open existed event.

Parameters:
name event name
Returns:
event or null if event with such name doesn't exists

virtual RIPCLock* RIPCSession::openLock char const *  name  )  [pure virtual]
 

Open existed lock.

Parameters:
name lock name
Returns:
lock or null if lock with such name doesn't exists

virtual RIPCMutex* RIPCSession::openMutex char const *  name  )  [pure virtual]
 

Open existed mutex.

Parameters:
name mutex name
Returns:
mutex or null if mutex with such name doesn't exists

virtual RIPCQueue* RIPCSession::openQueue char const *  name  )  [pure virtual]
 

Open existed queue.

Parameters:
name queue name
Returns:
queue or null if queue with such name doesn't exists

virtual RIPCSemaphore* RIPCSession::openSemaphore char const *  name  )  [pure virtual]
 

Open existed semaphore.

Parameters:
name semaphore name
Returns:
semaphore or null if semaphore with such name doesn't exists

virtual RIPCSharedMemory* RIPCSession::openSharedMemory char const *  name  )  [pure virtual]
 

Create or return existed shared memory object.

Parameters:
name unique shared memory name.
Returns:
created or existed shared memory, use alreadExists method to check if new object is created

virtual void RIPCSession::showServerInfo char *  buf,
size_t  bufSize
[pure virtual]
 

Get information about server state. This method is used by RIPCServerMonitor and should not be used by normal client unless it wants to monitor server itself.

Parameters:
buf buffer where to output information
bufSize buffer size, if size of information is greater than size of the buffer, it will be trucated

virtual void RIPCSession::shutdownServer  )  [pure virtual]
 

Terminate server. This method is used by RIPCServerMonitor and should not be used by normal client unless it wants to monitor server itself. This method do nothing for local sessions. You should not execute any other session method after this this method.


The documentation for this class was generated from the following file:
Generated on Wed Nov 26 14:58:19 2003 for RIPC by doxygen 1.3.5