v2.10-0 (21000JUN2005)

Go4TaskHandler
Class TGo4TaskManager


class TGo4TaskManager
derived from TNamed


Field Summary
 private Bool_tfbClientIsRemoved
          True if the last specified client is removed from server.
flag is set by connector thread who performs the DisconnectClient
of TaskManager; is reset by WaitForClientRemoved method.
 private Bool_tfbHasControllerConnection
          true if this server already has one connection to a
master client that has the controller role.
 const static const Int_tfgiDISCONCYCLES
          cycles to wait for client disconnection
 const static const UInt_tfguDISCONTIME
          time for each disonnection wait cycle
 private UInt_tfuNegotiationPort
          port number for the server client negotiation connections
 private UInt_tfuTaskCount
           
 private TMutex*fxListMutex
           
 private TGo4ServerTask*fxServer
           
 private TIterator*fxTaskIter
          Iterator over list of tasks.
 private TObjArray*fxTaskList
           
 private TGo4Socket*fxTransport
           

Fields inherited from class TNamed
fName, fTitle

Constructor Summary
 TGo4TaskManager(const char * name, TGo4ServerTask* server, UInt_t negotiationport)
           
 private TGo4TaskManager()
           
 private TGo4TaskManager(const TGo4TaskManager& right)
           

Destructor Summary
 virtual synchronized ~TGo4TaskManager()
           

Method Summary
 Bool_tAddClient(const char * client, const char * host, Go4CommandMode_t role)
          adds client task of name to manager: create server task handler and try to connect to client
Command execution role depends on previous login passowrd
 Bool_tAddTaskHandler(TGo4TaskHandler* han)
          adds external task handler to array
 Go4CommandMode_tClientLogin()
          Check account and password of the client that requests a
connection to this server.
 Int_tConnectClient(const char * client, const char * host, Go4CommandMode_t role)
          used by connector runnable to wait for a client request to
connect to this server task.
 Int_tDisConnectClient(const char * name, Bool_t clientwait)
          disonnect an existing client by name, wait for negotiation OK
if clientwait is true
 Int_tDisConnectClient(TGo4TaskHandler* taskhandler, Bool_t clientwait)
          disonnect an existing client by name, wait for negotiation OK
if clientwait is true
 TGo4TaskHandler*GetLastTaskHandler()
          returns last task handler in list
 TMutex*GetMutex()
           
 UInt_tGetNegotiationPort()
          returns the portnumber for client server
negotiation port which is actually used by
the running taskmanager
 const UInt_tGetTaskCount()
          Number of entries in taskhandler list, i.e. number of connected clients
 TGo4TaskHandler*GetTaskHandler(const char * name)
          returns certain task handler by name
 Bool_tHasControllerTask()
           
 TGo4TaskHandler*NewTaskHandler(const char * name)
          creates new task handler with given name and adds it into array
 TGo4TaskHandler*NextTaskHandler(Bool_t reset)
          For iteration over all connected task handlers.
 private synchronized TGo4TaskManager&operator=(const TGo4TaskManager& right)
           
 Bool_tRemoveTaskHandler(const char * name)
          removes task handler from array by name
 Int_tServeClient()
          used by connector runnable to wait for a client connect/disonnect request
 Int_tWaitForClientRemoved()
           

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

fbClientIsRemoved

private Bool_t fbClientIsRemoved
True if the last specified client is removed from server.
flag is set by connector thread who performs the DisconnectClient
of TaskManager; is reset by WaitForClientRemoved method.

fbHasControllerConnection

private Bool_t fbHasControllerConnection
true if this server already has one connection to a
master client that has the controller role. Only one
controller or administrator taskhandler is allowed per server.

fgiDISCONCYCLES

public const static const Int_t fgiDISCONCYCLES
cycles to wait for client disconnection

fguDISCONTIME

public const static const UInt_t fguDISCONTIME
time for each disonnection wait cycle

fuNegotiationPort

private UInt_t fuNegotiationPort
port number for the server client negotiation connections

fuTaskCount

private UInt_t fuTaskCount

fxListMutex

private TMutex* fxListMutex

fxServer

private TGo4ServerTask* fxServer

fxTaskIter

private TIterator* fxTaskIter
Iterator over list of tasks.

fxTaskList

private TObjArray* fxTaskList
supplierCardinality 1..n
link aggregation

fxTransport

private TGo4Socket* fxTransport
Constructor Detail

TGo4TaskManager

public TGo4TaskManager(const char * name, TGo4ServerTask* server, UInt_t negotiationport)

TGo4TaskManager

private TGo4TaskManager()

TGo4TaskManager

private TGo4TaskManager(const TGo4TaskManager& right)
Method Detail

~TGo4TaskManager

public virtual synchronized ~TGo4TaskManager()
Method Detail

AddClient

public Bool_t AddClient(const char * client, const char * host, Go4CommandMode_t role)
adds client task of name to manager: create server task handler and try to connect to client
Command execution role depends on previous login passowrd

AddTaskHandler

public Bool_t AddTaskHandler(TGo4TaskHandler* han)
adds external task handler to array

ClientLogin

public Go4CommandMode_t ClientLogin()
Check account and password of the client that requests a
connection to this server. Return value specifies
client access priorities as defined in TGo4Command.h
Returns 0 in case of incorrect login.

ConnectClient

public Int_t ConnectClient(const char * client, const char * host, Go4CommandMode_t role)
used by connector runnable to wait for a client request to
connect to this server task. May specify mode of allowed commands
in case of client is master.

DisConnectClient

public Int_t DisConnectClient(const char * name, Bool_t clientwait)
disonnect an existing client by name, wait for negotiation OK
if clientwait is true

DisConnectClient

public Int_t DisConnectClient(TGo4TaskHandler* taskhandler, Bool_t clientwait)
disonnect an existing client by name, wait for negotiation OK
if clientwait is true

GetLastTaskHandler

public TGo4TaskHandler* GetLastTaskHandler()
returns last task handler in list

GetMutex

public TMutex* GetMutex()

GetNegotiationPort

public UInt_t GetNegotiationPort()
returns the portnumber for client server
negotiation port which is actually used by
the running taskmanager

GetTaskCount

public const UInt_t GetTaskCount()
Number of entries in taskhandler list, i.e. number of connected clients

GetTaskHandler

public TGo4TaskHandler* GetTaskHandler(const char * name)
returns certain task handler by name

HasControllerTask

public Bool_t HasControllerTask()

NewTaskHandler

public TGo4TaskHandler* NewTaskHandler(const char * name)
creates new task handler with given name and adds it into array

NextTaskHandler

public TGo4TaskHandler* NextTaskHandler(Bool_t reset)
For iteration over all connected task handlers. If
reset is true, internal iterator will be reset. Otherwies,
continue iterating list until last entry. Returns 0 when
iteration finishes.

operator=

private synchronized TGo4TaskManager& operator=(const TGo4TaskManager& right)

RemoveTaskHandler

public Bool_t RemoveTaskHandler(const char * name)
removes task handler from array by name

ServeClient

public Int_t ServeClient()
used by connector runnable to wait for a client connect/disonnect request

WaitForClientRemoved

public Int_t WaitForClientRemoved()

Association Links

to Class TGo4ServerTask

to Class TGo4Socket

to Class TObjArray

Supplier Cardinality 1..n
Type aggregation

to Class TMutex

to Class TIterator

Iterator over list of tasks.

to Class TGo4TaskHandler

Label TObjArray
Client Cardinality 1
Supplier Cardinality 1..*
Is directed
Type aggregation

J.Adamczewski, M.Al-Turany, D.Bertini, H.G.Essel, S.Linev

30-06-2005