v2.10-0 (21000JUN2005)

Go4TaskHandler
Class TGo4ServerTask

Direct Known Subclasses:
TGo4ExampleServer

class TGo4ServerTask
derived from TGo4Task


Inner Class Summary
 public classTGo4ServerTask.ELaunchmodes
           

Field Summary
 private Bool_tfbConnectIsClose
          True if fxConnectTransport has returned from Close(),
i.e. connection was established
 private Bool_tfbConnectIsDone
          True if fxConnectTransport has returned from Open(),
i.e. connection was established
 private Bool_tfbConnectIsOpen
          True if fxConnectTransport waits in server Open() call
 private Bool_tfbConnectRequest
          True if fxConnectTransport shall be Open() by AppControlTimer
 private Bool_tfbDisConnectRequest
          True if fxConnectTransport shall be Close() by AppControlTimer
 private Bool_tfbKeepServerSocket
          True if open in server mode shall keep the server socket instance
 const static const Text_t[]fgcLAUNCHPREFSFILE
          Name of the Preferences file for the client startup
 const static const Int_tfgiCLOSEWAITCYCLES
          maximum cycles to wait until transport is closed
 const static const Int_tfgiCONNECTWAITCYCLES
          maximum cycles to wait until transport is connected
 const static const Int_tfgiOPENWAITCYCLES
          maximum cycles to wait until transport is open
 const static const UInt_tfguCLOSEWAITCYCLETIME
          time for each close wait cycle
 const static const UInt_tfguCONNECTTIMERPERIOD
          period of task connector timer
 const static const UInt_tfguCONNECTWAITCYCLETIME
          time for each connect wait cycle
 const static const UInt_tfguOPENWAITCYCLETIME
          time for each open wait cycle
 private UInt_tfuConnectPort
          port number for timer connect
 private TStringfxConnectHost
          hostname for timer connect
 private TStringfxConnectorName
          remember name of connector thread
 private TGo4TaskConnectorTimer*fxConnectorTimer
          timer responsible for the connection/disconnection of clients;
independent of application control timer
 private TGo4Socket*fxConnectTransport
          link to the next TaskHandler transport instance that shall be connected
by the Application Control Timer with the client
 private TGo4TaskHandler*fxCurrentTaskHandler
           
 private TGo4Socket*fxDisConnectTransport
          link to the next TaskHandler transport instance that shall be disconnected
by the Application Control Timer with the client
 private TGo4TaskManager*fxTaskManager
           

Fields inherited from class Go4TaskHandler.TGo4Task
fgiTERMID, fxStatusBuffer, fxStatusMutex

Fields inherited from class Go4ThreadManager.TGo4ThreadManager
fbAppBlocking, fbAutoCreate, fbAutoStart, fbInitDone, fbTerminateApplication, fbTerminating, fglTIMERPERIOD, fguTEXTLENGTH, fxBlocker, fxWorkHandler

Fields inherited from class TNamed
fName, fTitle

Constructor Summary
TGo4ServerTask(const char * name, UInt_t negotiationport, Bool_t blockingmode, Bool_t standalone, Bool_t autostart, Bool_t autocreate, Bool_t ismaster)
           

Destructor Summary
 virtual synchronized ~TGo4ServerTask()
           

Method Summary
 Bool_tConnectorThreadIsStopped()
          Returns the waiting state fbIsWaiting of the Connector
Thread;
 TGo4BufferQueue*GetCommandQueue(const char * task)
           
 const const char *GetConnectHost()
           
 const const char *GetConnectorName()
           
 TGo4Socket*GetConnectTransport()
           
 TGo4TaskHandler*GetCurrentTaskHandler()
          Get task handler of the currently activated client connection
 TGo4BufferQueue*GetDataQueue(const char * task)
           
 TGo4BufferQueue*GetStatusQueue(const char * task)
           
 TGo4TaskHandler*GetTaskHandler()
          Get task handler for client specified by name
 TGo4TaskHandler*GetTaskHandler(const char * name)
          Get task handler for client specified by name
 TGo4TaskManager*GetTaskManager()
           
 virtual Int_tLaunchClient(const char * name, const char * remotehost, const char * remotedir, const char * remotecommand, Int_t mode)
          method using a shell script to create
a new linux xterm with a client executable.
 virtual TGo4Command*NextCommand()
          Delivers next command.
 virtual voidQuit()
          Quit method used by quit command; may be overridden
in special application
 virtual Int_tRemoveAllClients()
          Remove all connected client task from this server
 virtual Bool_tRemoveClient(const char * name, Bool_t clientwait, Bool_t isterminating)
          Remove the client task specified by name from this server.
 Bool_tRemoveCurrentClient()
          removes the currently active client from server (disconnect)
 virtual voidSendStatus(TGo4Status* stat, const char * receiver)
          Send status object via status channel to the master.
 virtual voidSendStatusBuffer()
          Send internal status buffer to the master(s).
 voidSetConnect(TGo4Socket* trans, const char * host, UInt_t port, Bool_t keepserv)
           
 voidSetCurrentTask(const char * name)
          sets current client task (i.e. taskhandler) by name
 voidSetDisConnect(TGo4Socket* trans)
           
 voidShutdown()
          Fast Quit() without waiting for proper disconnection.
 virtual Bool_tStartConnectorThread()
          starts the thread that listens to the connector port
for a client negotiation request; used after launching an
rsh client from server
 virtual Bool_tStopConnectorThread()
          stops the thread that listens to the connector port
for a client negotiation request;
used before launching an rsh client from server.
 virtual Int_tTimerConnect()
          this method is used by the connectortimer Notify to
connect or disconnect a transportchannel (TSocket) on demand;
the connection process itself is handled by the connector runnable
which uses services of the TaskManager class
 Int_tWaitForClose()
           
 Int_tWaitForConnection()
           
 Int_tWaitForOpen()
           

Methods inherited from class Go4TaskHandler.TGo4Task
AddUserCommand, AddUserCommandList, CreateCommandList, CreateStatus, ExecuteString, GetCommanderName, GetLocalCommandQueue, GetMaster, GetPrototype, GetSlave, GetStatus, Initialization, IsMaster, IsWorkStopped, KillMain, MakeCommand, NextObject, NextStatus, RestartMain, SendObject, SendStatusMessage, SendStopBuffers, SetMaster, SetOwner, SetWorkIsStopped, Start, StartWorkThreads, Stop, StopWorkThreads, SubmitCommand, SubmitCommand, SubmitEmergencyCommand, SubmitEmergencyData, SubmitLocalCommand, Terminate, TerminateFast, UpdateStatus, UpdateStatusBuffer, WakeCommandQueue

Methods inherited from class Go4ThreadManager.TGo4ThreadManager
BlockApp, GetWorkHandler, IsAppBlocking, IsInitDone, IsTerminateApp, IsTerminating, Launch, operator=, SetTimer, UnBlockApp

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

fbConnectIsClose

private Bool_t fbConnectIsClose
True if fxConnectTransport has returned from Close(),
i.e. connection was established

fbConnectIsDone

private Bool_t fbConnectIsDone
True if fxConnectTransport has returned from Open(),
i.e. connection was established

fbConnectIsOpen

private Bool_t fbConnectIsOpen
True if fxConnectTransport waits in server Open() call

fbConnectRequest

private Bool_t fbConnectRequest
True if fxConnectTransport shall be Open() by AppControlTimer

fbDisConnectRequest

private Bool_t fbDisConnectRequest
True if fxConnectTransport shall be Close() by AppControlTimer

fbKeepServerSocket

private Bool_t fbKeepServerSocket
True if open in server mode shall keep the server socket instance

fgcLAUNCHPREFSFILE

public const static const Text_t[] fgcLAUNCHPREFSFILE
Name of the Preferences file for the client startup

fgiCLOSEWAITCYCLES

public const static const Int_t fgiCLOSEWAITCYCLES
maximum cycles to wait until transport is closed

fgiCONNECTWAITCYCLES

public const static const Int_t fgiCONNECTWAITCYCLES
maximum cycles to wait until transport is connected

fgiOPENWAITCYCLES

public const static const Int_t fgiOPENWAITCYCLES
maximum cycles to wait until transport is open

fguCLOSEWAITCYCLETIME

public const static const UInt_t fguCLOSEWAITCYCLETIME
time for each close wait cycle

fguCONNECTTIMERPERIOD

public const static const UInt_t fguCONNECTTIMERPERIOD
period of task connector timer

fguCONNECTWAITCYCLETIME

public const static const UInt_t fguCONNECTWAITCYCLETIME
time for each connect wait cycle

fguOPENWAITCYCLETIME

public const static const UInt_t fguOPENWAITCYCLETIME
time for each open wait cycle

fuConnectPort

private UInt_t fuConnectPort
port number for timer connect

fxConnectHost

private TString fxConnectHost
hostname for timer connect

fxConnectorName

private TString fxConnectorName
remember name of connector thread

fxConnectorTimer

private TGo4TaskConnectorTimer* fxConnectorTimer
timer responsible for the connection/disconnection of clients;
independent of application control timer
supplierCardinality 1
link aggregationByValue

fxConnectTransport

private TGo4Socket* fxConnectTransport
link to the next TaskHandler transport instance that shall be connected
by the Application Control Timer with the client

fxCurrentTaskHandler

private TGo4TaskHandler* fxCurrentTaskHandler
supplierCardinality 1

fxDisConnectTransport

private TGo4Socket* fxDisConnectTransport
link to the next TaskHandler transport instance that shall be disconnected
by the Application Control Timer with the client

fxTaskManager

private TGo4TaskManager* fxTaskManager
supplierCardinality 1
link aggregationByValue
Constructor Detail

TGo4ServerTask

public TGo4ServerTask(const char * name, UInt_t negotiationport, Bool_t blockingmode, Bool_t standalone, Bool_t autostart, Bool_t autocreate, Bool_t ismaster)
Method Detail

~TGo4ServerTask

public virtual synchronized ~TGo4ServerTask()
Method Detail

ConnectorThreadIsStopped

public Bool_t ConnectorThreadIsStopped()
Returns the waiting state fbIsWaiting of the Connector
Thread;

GetCommandQueue

public TGo4BufferQueue* GetCommandQueue(const char * task)

GetConnectHost

public const const char * GetConnectHost()

GetConnectorName

public const const char * GetConnectorName()

GetConnectTransport

public TGo4Socket* GetConnectTransport()

GetCurrentTaskHandler

public TGo4TaskHandler* GetCurrentTaskHandler()
Get task handler of the currently activated client connection

GetDataQueue

public TGo4BufferQueue* GetDataQueue(const char * task)

GetStatusQueue

public TGo4BufferQueue* GetStatusQueue(const char * task)

GetTaskHandler

public TGo4TaskHandler* GetTaskHandler()
Get task handler for client specified by name

GetTaskHandler

public TGo4TaskHandler* GetTaskHandler(const char * name)
Get task handler for client specified by name

GetTaskManager

public TGo4TaskManager* GetTaskManager()

LaunchClient

public virtual Int_t LaunchClient(const char * name, const char * remotehost, const char * remotedir, const char * remotecommand, Int_t mode)
method using a shell script to create
a new linux xterm with a client executable.
May be overridden by specialised subclass methods
to call the script appropriate for the
respective client.
mode specifiers: Bit1=0 - use rsh for starting analysis client
Bit1=1 - use ssh for starting analysis client
Bit2=0 - client in xterm window
Bit2=1 - client without xterm in same shell as gui
Bit3=0 - client outside gui mainframe (not implemented)
Bit3=1 - client embedded in gui mainframe (not implemented)
specify these bits respectively, with kSecureShell, kNoXterm, kGuiEmbed

NextCommand

public virtual TGo4Command* NextCommand()
Delivers next command. This implementation will poll over
command queues of all existing connections. Command is labeled
with name of ordering task, so data may be returned to
command sender only.

Quit

public virtual void Quit()
Quit method used by quit command; may be overridden
in special application

RemoveAllClients

public virtual Int_t RemoveAllClients()
Remove all connected client task from this server

RemoveClient

public virtual Bool_t RemoveClient(const char * name, Bool_t clientwait, Bool_t isterminating)
Remove the client task specified by name from this server.
If clientwait=true, remove with client handshake. If isterminating=true,
do not restart workthreads after removing the client.

RemoveCurrentClient

public Bool_t RemoveCurrentClient()
removes the currently active client from server (disconnect)

SendStatus

public virtual void SendStatus(TGo4Status* stat, const char * receiver)
Send status object via status channel to the master. Master name
may be specified, if more than one master is connected.
By default, object is send to all connected tasks

SendStatusBuffer

public virtual void SendStatusBuffer()
Send internal status buffer to the master(s).

SetConnect

public void SetConnect(TGo4Socket* trans, const char * host, UInt_t port, Bool_t keepserv)

SetCurrentTask

public void SetCurrentTask(const char * name)
sets current client task (i.e. taskhandler) by name

SetDisConnect

public void SetDisConnect(TGo4Socket* trans)

Shutdown

public void Shutdown()
Fast Quit() without waiting for proper disconnection.
For analysis server shutdown.

StartConnectorThread

public virtual Bool_t StartConnectorThread()
starts the thread that listens to the connector port
for a client negotiation request; used after launching an
rsh client from server

StopConnectorThread

public virtual Bool_t StopConnectorThread()
stops the thread that listens to the connector port
for a client negotiation request;
used before launching an rsh client from server.
A dummy connection is performed to release socket pending in listening
state, thus runnable may wait afterwards , and no
server socket is listening on spawning the client.
Tests showed that any child process took over the listening
server socket, which is not desired here and probably a bug of the system.

TimerConnect

public virtual Int_t TimerConnect()
this method is used by the connectortimer Notify to
connect or disconnect a transportchannel (TSocket) on demand;
the connection process itself is handled by the connector runnable
which uses services of the TaskManager class

WaitForClose

public Int_t WaitForClose()

WaitForConnection

public Int_t WaitForConnection()

WaitForOpen

public Int_t WaitForOpen()

Association Links

to Class TGo4TaskManager

Supplier Cardinality 1
Type aggregationByValue

to Class TGo4TaskHandler

Supplier Cardinality 1

to Class TGo4Socket

link to the next TaskHandler transport instance that shall be connected
by the Application Control Timer with the client

to Class TGo4Socket

link to the next TaskHandler transport instance that shall be disconnected
by the Application Control Timer with the client

to Class TGo4TaskConnectorTimer

timer responsible for the connection/disconnection of clients;
independent of application control timer

Supplier Cardinality 1
Type aggregationByValue

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

30-06-2005