| v2.10-0 (21000JUN2005) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class is responsible for the interconnection of two tasks:
provided are three communication channels (data, command, status),
one thread runnable is acting on each transport channel (e.g. socket);
one queue (buffer) is assigned to each channel
depending on client or server mode of the task handler, the threads get objects
from transporl and put them into the queue, or vice versa. (servertask sends commands,
but receives data and status objects)
taskhander is named such that it can be found in a list (i.e. task manager) by the server task
which may serve more than one client tasks
Field Summary | |
private Bool_t | fbClientMode True if taskhandler runs in client mode |
private Bool_t | fbIsAborting True if taskhandler is being aborted e.g. by remove exception |
private Bool_t | fbMasterMode True if taskhandler runs in master mode (sends commands, receives data and status). |
const static const Text_t[] | fgcCOMMANDTHREAD Suffix for command thread name |
const static const Text_t[] | fgcCONNECT Initial string for connect request (raw transport) |
const static const Text_t[] | fgcDATATHREAD Suffix for data thread name |
const static const Text_t[] | fgcDISCONNECT Initial string for disconnect request (raw transport) |
const static const Text_t[] | fgcERROR Error string for client connect negotiations (raw transport) |
const static const Text_t[] | fgcMASTER Task identifier for client connect negotiations (raw transport) |
const static const Text_t[] | fgcOK Ok string for client connect negotiations (raw transport) |
const static const Text_t[] | fgcSLAVE Task identifier for client connect negotiations (raw transport) |
const static const Text_t[] | fgcSTATUSTHREAD Suffix for status thread name |
const static const Int_t | fgiPORTWAITCYCLES Cycles to wait for a nonzero portnumber |
const static const Int_t | fgiTHREADSTOPCYCLES cycles to wait for taskhandler thread stop on disconnection |
const static const UInt_t | fguCOMMANDQUEUESIZE Maximum entries allowed for command queue |
const static const UInt_t | fguCONNECTORPORT Default port number of negotiation connection (raw transport) |
const static const UInt_t | fguDATAQUEUESIZE Maximum entries allowed for data queue |
const static const UInt_t | fguPORTWAITTIME Time for each waitgetport cycle |
const static const UInt_t | fguSTATUSQUEUESIZE Maximum entries allowed for status queue |
const static const UInt_t | fguTHREADSTOPTIME time for each threadstop wait cycle |
const static const UInt_t | fguTRANSPORTCHECKDELAY Delay time (ms) to wait between two checks of transport connection |
private static TNamed | fgxADMINISTRATORACCOUNT This keeps account for admin connection. |
private static TNamed | fgxCONTROLLERACCOUNT This keeps account for controller connection. |
private static TNamed | fgxOBSERVERACCOUNT This keeps account for observer connection. |
private Int_t | fiComPort Command connection port number |
private Int_t | fiDatPort Data connection port number |
private Go4CommandMode_t | fiRole For server connection to client: This indicates role of connected client, if client is master. |
private Int_t | fiStatPort Status connection port number |
private UInt_t | fuNegPort Actual port number of negotiation connection (raw transport) |
private TGo4Queue* | fxCommandQueue Buffers (queues) for the three transport channels: |
private TGo4CommandRunnable* | fxCommandRun link to command runnable which is managed by thread handler |
private TGo4Socket* | fxCommandTransport Transport channels (e.g. sockets) for command, status, data |
private TString | fxComName Remember name of command thread |
private TGo4Queue* | fxDataQueue |
private TGo4DataRunnable* | fxDataRun link to data runnable which is managed by thread handler |
private TGo4Socket* | fxDataTransport |
private TString | fxDatName Remember name of data thread |
private TString | fxHostName Remember name of remote task handler |
private TGo4CommandInvoker* | fxInvoker Link to external command invoker instance used for direct command in client mode: |
private TString | fxStatName Remember name of status thread |
private TGo4Queue* | fxStatusQueue |
private TGo4StatusRunnable* | fxStatusRun link to status runnable which is managed by thread handler |
private TGo4Socket* | fxStatusTransport |
private TGo4ThreadHandler* | fxThreadHandler link to external threadhandler which is used for the transport service threads (runnables); these runnables are instantiated from the task handler ctor and passed to the thread handler who takes over the responsibility for the runnables (threadhandler internal mode threads) |
private TGo4ThreadManager* | fxThreadManager Link to threadmanager that owns the task handler, used for runnable ctors |
Fields inherited from class TNamed |
fName, fTitle |
Constructor Summary | |
| TGo4TaskHandler(const char * name, TGo4ThreadManager* threadmanager, Bool_t clientmode, Bool_t mastermode, UInt_t negotiationport) |
private | TGo4TaskHandler() |
Destructor Summary | |
virtual synchronized | ~TGo4TaskHandler() |
Method Summary | |
void | ClearQueues() Clear all entries of queues. |
void | CloseChannels() Close transport channels and clear queues. |
Bool_t | Connect(const char * host, TGo4Socket* negotiator) establishes the connections of all three transport channels and starts the service threads |
Bool_t | ConnectClientChannel(const char * name, TGo4Socket* negotiator, TGo4Socket* channel, const char * host) method defining the connection protocol of one data transport channel (data, status, or command). |
Bool_t | ConnectServerChannel(const char * name, TGo4Socket* negotiator, TGo4Socket* channel, const char * host) Method defining the connection protocol of one data transport channel (data, status, or command). |
virtual TGo4TaskHandlerStatus* | CreateStatus() create a status object with information on the current taskhandler state. this object may be sent to the server or may be used to restore current status by memento mechanism |
Bool_t | DisConnect(Bool_t waitforclient) Closes the connections of all three transport channels. |
const TGo4Queue* | GetCommandQueue() |
const TGo4Socket* | GetCommandTransport() |
const const char * | GetComName() |
const Int_t | GetComPort() |
const TGo4Queue* | GetDataQueue() |
const TGo4Socket* | GetDataTransport() |
const const char * | GetDatName() |
const Int_t | GetDatPort() |
const const char * | GetHostName() |
const TGo4CommandInvoker* | GetInvoker() returns pointer to copy of client invoker which may be used by server to check the valid command clients |
Go4CommandMode_t | GetRole() |
const const char * | GetStatName() |
const Int_t | GetStatPort() |
const TGo4Queue* | GetStatusQueue() |
const TGo4Socket* | GetStatusTransport() |
const TGo4ThreadManager* | GetThreadManager() |
const Bool_t | IsAborting() Check whether this instance is currently being aborted |
const Bool_t | IsClientMode() Check whether this instance is client or server taskhandler |
const Bool_t | IsMasterMode() Check whether this instance is client or server taskhandler |
Bool_t | ServerLogin(TGo4Socket* connector, Go4CommandMode_t account) Negotiate login to requested server channel with account type |
TGo4Socket* | ServerRequest(const char * host) request to server at host to connect or disconnect us, returns negotiation channel |
void | SetAborting(Bool_t isaborting) sets the internal aborting state of this taskhandler instance; will be checked before an exception tries to cancel this taskhandler |
static void | SetAdminAccount(const char * name, const char * passwd) Specify login name and password for administrator account. |
static void | SetCtrlAccount(const char * name, const char * passwd) Specify login name and password for controller account. |
void | SetInvoker(TGo4CommandInvoker* inv) sets pointer to client invoker which may be used by server to check the valid command clients |
void | SetNegotiationPort(UInt_t port) Set port for the negotiation channel (client mode). |
static void | SetObservAccount(const char * name, const char * passwd) Specify login name and password for observer account. |
void | SetRole(Go4CommandMode_t role) |
void | StartTransportThreads() Start all transport threads of this taskhandler (command, data, status). |
Bool_t | StopTransportThreads(Bool_t wait) Stop all transport threads of this taskhandler (command, data, status). |
Int_t | WaitGetPort(TGo4Socket* sock) Get actual local port number of specified Go4 socket. |
Bool_t | WaitThreadStop(const char * name) Wait for the thread of name to be stopped. |
Methods inherited from class TNamed |
operator=, Clear, Clone, Compare, Copy, FillBuffer, GetName, GetTitle, Hash, IsSortable, SetName, SetNameTitle, SetTitle, ls, Print, Sizeof, Class, Class_Name, Class_Version, Dictionary, IsA, ShowMembers, Streamer, StreamerNVirtual, DeclFileName, ImplFileLine, ImplFileName, DeclFileLine |
Field Detail |
private Bool_t fbClientMode
private Bool_t fbIsAborting
private Bool_t fbMasterMode
public const static const Text_t[] fgcCOMMANDTHREAD
public const static const Text_t[] fgcCONNECT
public const static const Text_t[] fgcDATATHREAD
public const static const Text_t[] fgcDISCONNECT
public const static const Text_t[] fgcERROR
public const static const Text_t[] fgcMASTER
public const static const Text_t[] fgcOK
public const static const Text_t[] fgcSLAVE
public const static const Text_t[] fgcSTATUSTHREAD
public const static const Int_t fgiPORTWAITCYCLES
public const static const Int_t fgiTHREADSTOPCYCLES
public const static const UInt_t fguCOMMANDQUEUESIZE
public const static const UInt_t fguCONNECTORPORT
public const static const UInt_t fguDATAQUEUESIZE
public const static const UInt_t fguPORTWAITTIME
public const static const UInt_t fguSTATUSQUEUESIZE
public const static const UInt_t fguTHREADSTOPTIME
public const static const UInt_t fguTRANSPORTCHECKDELAY
private static TNamed fgxADMINISTRATORACCOUNT
private static TNamed fgxCONTROLLERACCOUNT
private static TNamed fgxOBSERVERACCOUNT
private Int_t fiComPort
private Int_t fiDatPort
private Go4CommandMode_t fiRole
private Int_t fiStatPort
private UInt_t fuNegPort
private TGo4Queue* fxCommandQueue
private TGo4CommandRunnable* fxCommandRun
private TGo4Socket* fxCommandTransport
private TString fxComName
private TGo4Queue* fxDataQueue
private TGo4DataRunnable* fxDataRun
private TGo4Socket* fxDataTransport
private TString fxDatName
private TString fxHostName
private TGo4CommandInvoker* fxInvoker
private TString fxStatName
private TGo4Queue* fxStatusQueue
private TGo4StatusRunnable* fxStatusRun
private TGo4Socket* fxStatusTransport
private TGo4ThreadHandler* fxThreadHandler
private TGo4ThreadManager* fxThreadManager
Constructor Detail |
public TGo4TaskHandler(const char * name, TGo4ThreadManager* threadmanager, Bool_t clientmode, Bool_t mastermode, UInt_t negotiationport)
private TGo4TaskHandler()
Method Detail |
public virtual synchronized ~TGo4TaskHandler()
Method Detail |
public void ClearQueues()
public void CloseChannels()
public Bool_t Connect(const char * host, TGo4Socket* negotiator)
public Bool_t ConnectClientChannel(const char * name, TGo4Socket* negotiator, TGo4Socket* channel, const char * host)
public Bool_t ConnectServerChannel(const char * name, TGo4Socket* negotiator, TGo4Socket* channel, const char * host)
public virtual TGo4TaskHandlerStatus* CreateStatus()
public Bool_t DisConnect(Bool_t waitforclient)
public const TGo4Queue* GetCommandQueue()
public const TGo4Socket* GetCommandTransport()
public const const char * GetComName()
public const Int_t GetComPort()
public const TGo4Queue* GetDataQueue()
public const TGo4Socket* GetDataTransport()
public const const char * GetDatName()
public const Int_t GetDatPort()
public const const char * GetHostName()
public const TGo4CommandInvoker* GetInvoker()
public Go4CommandMode_t GetRole()
public const const char * GetStatName()
public const Int_t GetStatPort()
public const TGo4Queue* GetStatusQueue()
public const TGo4Socket* GetStatusTransport()
public const TGo4ThreadManager* GetThreadManager()
public const Bool_t IsAborting()
public const Bool_t IsClientMode()
public const Bool_t IsMasterMode()
public Bool_t ServerLogin(TGo4Socket* connector, Go4CommandMode_t account)
public TGo4Socket* ServerRequest(const char * host)
public void SetAborting(Bool_t isaborting)
public static void SetAdminAccount(const char * name, const char * passwd)
public static void SetCtrlAccount(const char * name, const char * passwd)
public void SetInvoker(TGo4CommandInvoker* inv)
public void SetNegotiationPort(UInt_t port)
public static void SetObservAccount(const char * name, const char * passwd)
public void SetRole(Go4CommandMode_t role)
public void StartTransportThreads()
public Bool_t StopTransportThreads(Bool_t wait)
public Int_t WaitGetPort(TGo4Socket* sock)
public Bool_t WaitThreadStop(const char * name)
Association Links |
to Class TNamed
to Class TNamed
to Class TGo4ThreadManager
to Class TGo4ThreadHandler
to Class TGo4CommandInvoker
to Class TGo4Queue
to Class TGo4Queue
to Class TGo4Queue
to Class TGo4Socket
to Class TGo4Socket
to Class TGo4Socket
to Class Go4CommandMode_t
to Class TGo4StatusRunnable
to Class TGo4DataRunnable
to Class TGo4CommandRunnable
| J.Adamczewski, M.Al-Turany, D.Bertini, H.G.Essel, S.Linev | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |