ZeusBase-Library
2.0.4
|
#include <AbstractSkel.h>
Classes | |
class | TClientHandlerThread |
Public Member Functions | |
TAbstractSkel (bool bHighPerformance=false) | |
virtual Retval | startSkeleton (IString &rAddress, Uint &rPort, bool bDynamic) |
virtual void | kill (Float64 dTimeOut=5.0) |
virtual void | execute () |
void | dispatch1 (const TCCTPRequest &request, TCCTPResponse &response) |
void | processAsynchronousCalls () |
Retval | getClientSocket (Uint uiThreadID, TSocket *&rpSocket) const |
bool | isRunning () const |
void | setCleanFlag () |
void | setUseRemoteObjectAsReferencesOnly (bool bFlag) |
Public Member Functions inherited from zeus::TThread | |
TThread (EPriority ePriority=etNormal) | |
TThread (IRunnable &rObj, EPriority ePriority=etNormal) | |
EPriority | getPriority () const |
void | setPriority (EPriority ePriority) |
virtual bool | isAlive () const |
virtual bool | isDead () const |
virtual void | resume () |
virtual bool | signalizeStop (Float64 dTimeOut=5.0) |
virtual bool | start () |
virtual void | suspend () |
virtual bool | yield () |
virtual Retval | postObject (ISynchronizeObject &rObject, bool bWaitForCompletion) |
virtual bool MQUALIFIER | isInterrupted () const |
virtual Uint MQUALIFIER | getThreadID () const |
virtual Retval MQUALIFIER | askForInterface (const InterfaceID &rInterfaceID, IZUnknown *&rpIface) |
virtual void MQUALIFIER | addRef () const |
virtual void MQUALIFIER | release () const |
Public Member Functions inherited from zeus::TZObject | |
TZObject () | |
TZObject (const TString &strName) | |
TZObject (const IString &strName) | |
Uint | getHash () const |
TString | toString () const |
virtual TString | getObjName () const |
virtual void | setObjName (const TString &name) |
Protected Member Functions | |
virtual | ~TAbstractSkel () |
virtual Retval | dispatchCommand (const IRemoteMethodCall &rMethod, IRemoteMethodCall *&rpMethodreturn)=0 |
virtual void | dispatchAsynchCommand (const IRemoteMethodCall &) |
virtual void | startNewHandler (TSocket &rClient) |
Retval | postAsynchronMethod (const IRemoteMethodCall &rMethod) |
Protected Member Functions inherited from zeus::TThread | |
virtual | ~TThread () |
virtual void | onTerminated () |
virtual void | onStarted () |
Protected Member Functions inherited from zeus::TZObject | |
virtual | ~TZObject () |
TZObject (const TZObject &rObject) | |
TZObject & | operator= (const TZObject &rObject) |
Int | getRefCounter () const |
Protected Attributes | |
TSingleLinkedList< TClientHandlerThread * > | m_lstClients |
List of all available clients. More... | |
TCriticalSection & | m_rLock |
Lock to protect the client list. More... | |
TAutoPtr< TServerSocket > | m_ptrSocket |
Client Soket to handle. More... | |
bool | m_bCleanFlag |
Cleaning flag to remove wasted Clienthandler. More... | |
bool | m_bUseRemoteObjectAsReferencesOnly |
Flag if all remote objects are used as remote references only. More... | |
Protected Attributes inherited from zeus::TThread | |
bool | m_bInterrupted |
Flag to check if the thread should terminate. More... | |
TThreadMessageQueue & | m_rQueue |
Message queue of the thread. More... | |
Protected Attributes inherited from zeus::TZObject | |
Uint | m_uiID |
Additional Inherited Members | |
Public Types inherited from zeus::TThread | |
enum | EPriority { etNormal = 0, etLow = 1, etHigh = 2, etLower = 3, etHigher = 4, etTimeCritical = 5 } |
Static Public Member Functions inherited from zeus::TThread | |
static void | sleep (const Float &rfDelay) |
This class implements n abstract skeleton according to the server client model. The AbstractSkel is the server thread. Each incomming request is handled over a client handler thread, which is a inner class of this server. The method calls are dispatched by the main class using a customized method (overwritten by concrete skeleton class).
TAbstractSkel::TAbstractSkel | ( | bool | bHighPerformance = false | ) |
Creates a abstract skeleton object
bHighPerformance | : flag for high performance data communication. false is default. |
|
protectedvirtual |
Destroys the abstract skeleton
void TAbstractSkel::dispatch1 | ( | const TCCTPRequest & | request, |
TCCTPResponse & | response | ||
) |
Internal method for dispatching using the remote method call technology.
|
inlineprotectedvirtual |
|
protectedpure virtual |
Implemented in zeus::TCommPipe_Skel, zeus::TMessagePool_Skel, zeus::TMessageServerConnection_Skel, and zeus::TNamedContext_Skel.
|
virtual |
Executes the server thread. Listening for incomming reguests
Reimplemented from zeus::TThread.
Retval TAbstractSkel::getClientSocket | ( | Uint | uiThreadID, |
TSocket *& | rpSocket | ||
) | const |
Returns the client socket of the connected client. The thread ID is used to distinguish between clients. Use TreadManager to receive the thread id in the running program context.
|
inline |
Checks if the skeleton is started (running and the server socket is bound to an address)
|
virtual |
Kills the server thread
Reimplemented from zeus::TThread.
|
protected |
adds a remote method call into the asynchronous call queue
void TAbstractSkel::processAsynchronousCalls | ( | ) |
processes all asynchronous calls
void TAbstractSkel::setCleanFlag | ( | ) |
Each terminating client should call this method. If the clean flag is set the skeleton will remove all wasted client handler from its list.
|
inline |
If the m_bUseRemoteObjectAsReferencesOnly flag is set, no stubs are created on the skeleton side. All remote objects are handled as remote references only
|
protectedvirtual |
STarts a new client handle. If you want to use an other client handler thread you have to overwrite this method only. Create your own client handler and add it to the m_lstClients object.
rClient | Socket of the client |
Reimplemented in zeus::TCommPipe_Skel.
|
virtual |
Starts the skeleton binding the server socket to a ip address. This method starts the thread after successfully binding the socket.
rAddress | : in out parameter for IP address. if the dynamic flag is set this parameter is an out parameter otherwise the address given is used for connecting |
rPort | : in out parameter for tcp port. If the dynamic falg is set this parameter is the out parameter otherwise the port is used to connect |
bDynamic | : If this flag is set the socket is bound dynamically to a network interface and an unused tcp port. |
RET_NOERROR | : Server socket bound and thread started |
RET_REQUEST_FAILED | : Could not bind socket. The server thread hasn't be started. |
|
protected |
Cleaning flag to remove wasted Clienthandler.
|
protected |
Flag if all remote objects are used as remote references only.
|
protected |
List of all available clients.
|
protected |
Client Soket to handle.
|
protected |
Lock to protect the client list.