#include <TGo4ServerTask.h>
Inheritance diagram for TGo4ServerTask:
Public Types | |
enum | ELaunchmodes { kSecureShell = BIT(0), kGuiEmbed = BIT(1) } |
Public Methods | |
TGo4ServerTask (const char *name, UInt_t negotiationport=0, Bool_t blockingmode=kFALSE, Bool_t standalone=kFALSE, Bool_t autostart=kTRUE, Bool_t autocreate=kTRUE, Bool_t ismaster=kTRUE) | |
virtual | ~TGo4ServerTask () |
virtual void | Quit () |
Quit method used by quit command; may be overridden in special application. More... | |
void | Shutdown () |
Fast Quit() without waiting for proper disconnection. More... | |
virtual Int_t | LaunchClient (const char *name, const char *remotehost=0, const char *remotedir=0, const char *remotecommand=0, Int_t mode=0) |
method using a shell script to create a new linux xterm with a client executable. More... | |
TGo4TaskManager * | GetTaskManager () |
TGo4TaskHandler * | GetCurrentTaskHandler () |
Get task handler of the currently activated client connection. More... | |
TGo4TaskHandler * | GetTaskHandler () |
Get task handler for client specified by name. More... | |
TGo4TaskHandler * | GetTaskHandler (const char *name) |
Get task handler for client specified by name. More... | |
TGo4BufferQueue * | GetCommandQueue (const char *task=0) |
TGo4BufferQueue * | GetStatusQueue (const char *task=0) |
TGo4BufferQueue * | GetDataQueue (const char *task=0) |
virtual TGo4Command * | NextCommand () |
Delivers next command. More... | |
virtual void | SendStatus (TGo4Status *stat, const char *receiver=0) |
Send status object via status channel to the master. More... | |
virtual void | SendStatusBuffer () |
Send internal status buffer to the master(s). More... | |
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. More... | |
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. More... | |
Bool_t | ConnectorThreadIsStopped () |
Returns the waiting state fbIsWaiting of the Connector Thread;. More... | |
void | SetCurrentTask (const char *name) |
sets current client task (i.e. More... | |
void | SetConnect (TGo4Socket *trans, const char *host, UInt_t port, Bool_t keepserv=kFALSE) |
void | SetDisConnect (TGo4Socket *trans) |
TGo4Socket * | GetConnectTransport () |
const char * | GetConnectorName () const |
const char * | GetConnectHost () const |
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. More... | |
virtual Int_t | RemoveAllClients () |
Remove all connected client task from this server. More... | |
virtual Bool_t | RemoveClient (const char *name, Bool_t clientwait=kTRUE, Bool_t isterminating=kFALSE) |
Remove the client task specified by name from this server. More... | |
Bool_t | RemoveCurrentClient () |
removes the currently active client from server (disconnect). More... | |
Int_t | WaitForOpen () |
Int_t | WaitForClose () |
Overrides the ThreadManager Initialization; is used to setup the client connections on demand; checks for fbConnectRequest flag. More... | |
Int_t | WaitForConnection () |
Static Public Attributes | |
const Int_t | fgiOPENWAITCYCLES = 100 |
maximum cycles to wait until transport is open. More... | |
const UInt_t | fguOPENWAITCYCLETIME = 100 |
time for each open wait cycle. More... | |
const Int_t | fgiCLOSEWAITCYCLES = 100 |
maximum cycles to wait until transport is closed. More... | |
const UInt_t | fguCLOSEWAITCYCLETIME = 100 |
time for each close wait cycle. More... | |
const Int_t | fgiCONNECTWAITCYCLES = 20 |
maximum cycles to wait until transport is connected. More... | |
const UInt_t | fguCONNECTWAITCYCLETIME = 200 |
time for each connect wait cycle. More... | |
const UInt_t | fguCONNECTTIMERPERIOD = 100 |
period of task connector timer. More... | |
const Text_t | fgcLAUNCHPREFSFILE [] = "Go4Library/Go4LaunchClientPrefs.txt" |
Name of the Preferences file for the client startup. More... | |
Private Attributes | |
TString | fxConnectorName |
remember name of connector thread. More... | |
TGo4TaskManager * | fxTaskManager |
More... | |
TGo4TaskHandler * | fxCurrentTaskHandler |
@supplierCardinality 1. More... | |
TGo4Socket * | fxConnectTransport |
link to the next TaskHandler transport instance that shall be connected by the Application Control Timer with the client. More... | |
TGo4Socket * | fxDisConnectTransport |
link to the next TaskHandler transport instance that shall be disconnected by the Application Control Timer with the client. More... | |
TString | fxConnectHost |
hostname for timer connect. More... | |
UInt_t | fuConnectPort |
port number for timer connect. More... | |
Bool_t | fbKeepServerSocket |
True if open in server mode shall keep the server socket instance. More... | |
Bool_t | fbConnectRequest |
True if fxConnectTransport shall be Open() by AppControlTimer. More... | |
Bool_t | fbDisConnectRequest |
True if fxConnectTransport shall be Close() by AppControlTimer. More... | |
Bool_t | fbConnectIsOpen |
True if fxConnectTransport waits in server Open() call. More... | |
Bool_t | fbConnectIsDone |
True if fxConnectTransport has returned from Open(), i.e. More... | |
Bool_t | fbConnectIsClose |
True if fxConnectTransport has returned from Close(), i.e. More... | |
TGo4TaskConnectorTimer * | fxConnectorTimer |
timer responsible for the connection/disconnection of clients; independent of application control timer More... |
|
Definition at line 302 of file TGo4ServerTask.h. |
|
Definition at line 49 of file TGo4ServerTask.cxx. References fguCONNECTTIMERPERIOD, TGo4ThreadManager::fguTEXTLENGTH, fxConnectorName, fxConnectorTimer, fxTaskManager, TGo4ThreadManager::fxWorkHandler, GetConnectorName(), TGo4CommandInvoker::Instance(), TGo4ThreadManager::Launch(), TGo4ThreadHandler::NewThread(), and TGo4CommandInvoker::Register(). |
|
Definition at line 95 of file TGo4ServerTask.cxx. References TGo4ThreadHandler::CancelAll(), fxConnectorTimer, fxTaskManager, and TGo4ThreadManager::GetWorkHandler(). |
|
Quit method used by quit command; may be overridden in special application.
Reimplemented from TGo4Task. Definition at line 609 of file TGo4ServerTask.cxx. References TGo4Log::Debug(), TGo4Task::fgiTERMID, TGo4Task::IsMaster(), RemoveAllClients(), TGo4Task::SendStatusMessage(), TGo4Task::Terminate(), and TGo4Task::WakeCommandQueue(). |
|
Fast Quit() without waiting for proper disconnection. For analysis server shutdown. Definition at line 620 of file TGo4ServerTask.cxx. References TGo4Log::Debug(), TGo4Task::fgiTERMID, fguCONNECTTIMERPERIOD, TGo4Task::GetSlave(), TGo4Task::IsMaster(), TGo4Task::SendStatusMessage(), TGo4TaskOwner::SetTask(), TGo4Thread::Sleep(), TGo4Slave::Stop(), TGo4Task::StopWorkThreads(), TGo4Slave::Terminate(), TGo4Task::Terminate(), and TGo4Task::WakeCommandQueue(). Referenced by TGo4ComServerQuit::ExeCom(). |
|
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 Definition at line 642 of file TGo4ServerTask.cxx. References ConnectorThreadIsStopped(), TGo4Log::Debug(), fgcLAUNCHPREFSFILE, TGo4ThreadManager::fguTEXTLENGTH, TGo4Task::GetMaster(), TGo4TaskManager::GetNegotiationPort(), GetTaskManager(), kGuiEmbed, kSecureShell, TGo4Master::SetSlave(), TGo4Thread::Sleep(), StartConnectorThread(), TGo4Master::StartSlaveWindow(), and StopConnectorThread(). Referenced by TGo4Master::ConnectSlave(), and TGo4ComLaunchClient::ExeCom(). |
|
Definition at line 292 of file TGo4ServerTask.cxx. References fxTaskManager. Referenced by LaunchClient(). |
|
Get task handler of the currently activated client connection.
Definition at line 287 of file TGo4ServerTask.cxx. References fxCurrentTaskHandler. Referenced by GetCommandQueue(), GetDataQueue(), GetStatusQueue(), GetTaskHandler(), TGo4TaskOwner::IsConnected(), RemoveClient(), RemoveCurrentClient(), TGo4TaskManager::RemoveTaskHandler(), TGo4LoggingRunnable::Run(), and TGo4ControllerRunnable::Run(). |
|
Get task handler for client specified by name.
Reimplemented from TGo4Task. Definition at line 282 of file TGo4ServerTask.cxx. References GetCurrentTaskHandler(). Referenced by GetCommandQueue(), GetDataQueue(), GetStatusQueue(), and RemoveClient(). |
|
Get task handler for client specified by name.
Definition at line 277 of file TGo4ServerTask.cxx. References fxTaskManager, and TGo4TaskManager::GetTaskHandler(). |
|
Reimplemented from TGo4Task. Definition at line 464 of file TGo4ServerTask.cxx. References TGo4TaskHandler::GetCommandQueue(), GetCurrentTaskHandler(), and GetTaskHandler(). |
|
Reimplemented from TGo4Task. Definition at line 477 of file TGo4ServerTask.cxx. References GetCurrentTaskHandler(), TGo4TaskHandler::GetStatusQueue(), and GetTaskHandler(). Referenced by TGo4ExampleServer::StopWorkThreads(). |
|
Reimplemented from TGo4Task. Definition at line 491 of file TGo4ServerTask.cxx. References GetCurrentTaskHandler(), TGo4TaskHandler::GetDataQueue(), and GetTaskHandler(). Referenced by TGo4ExampleServer::StopWorkThreads(). |
|
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. Reimplemented from TGo4Task. Definition at line 505 of file TGo4ServerTask.cxx. References fxTaskManager, TGo4TaskHandler::GetCommandQueue(), TGo4TaskManager::GetMutex(), TGo4TaskHandler::GetRole(), TGo4Queue::IsEmpty(), TGo4Task::IsMaster(), TGo4TaskManager::NextTaskHandler(), TGo4Command::SetMode(), TGo4Command::SetTaskName(), and TGo4BufferQueue::WaitObjectFromBuffer(). |
|
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 Reimplemented from TGo4Task. Definition at line 531 of file TGo4ServerTask.cxx. References TGo4BufferQueue::AddBufferFromObject(), TGo4Log::Debug(), fxTaskManager, TGo4TaskManager::GetMutex(), TGo4TaskHandler::GetStatusQueue(), TGo4Task::IsMaster(), TGo4TaskManager::NextTaskHandler(), and TGo4Task::SendStatus(). |
|
Send internal status buffer to the master(s).
Reimplemented from TGo4Task. Definition at line 556 of file TGo4ServerTask.cxx. References TGo4BufferQueue::AddBuffer(), TGo4Log::Debug(), TGo4Task::fxStatusBuffer, TGo4Task::fxStatusMutex, fxTaskManager, TGo4TaskManager::GetMutex(), TGo4TaskHandler::GetStatusQueue(), TGo4Task::IsMaster(), and TGo4TaskManager::NextTaskHandler(). |
|
starts the thread that listens to the connector port for a client negotiation request; used after launching an rsh client from server.
Definition at line 575 of file TGo4ServerTask.cxx. References GetConnectorName(), TGo4ThreadManager::GetWorkHandler(), and TGo4ThreadHandler::Start(). Referenced by LaunchClient(). |
|
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. Definition at line 583 of file TGo4ServerTask.cxx. References TGo4Socket::Close(), TGo4TaskHandler::fgcERROR, fxTaskManager, GetConnectorName(), TGo4TaskManager::GetNegotiationPort(), TGo4ThreadManager::GetWorkHandler(), TGo4Socket::Open(), TGo4Socket::Send(), and TGo4ThreadHandler::Stop(). Referenced by LaunchClient(). |
|
Returns the waiting state fbIsWaiting of the Connector Thread;.
Definition at line 601 of file TGo4ServerTask.cxx. References GetConnectorName(), TGo4ThreadHandler::GetThread(), TGo4ThreadManager::GetWorkHandler(), and TGo4Thread::IsWaiting(). Referenced by LaunchClient(). |
|
sets current client task (i.e. taskhandler) by name Definition at line 224 of file TGo4ServerTask.cxx. References TGo4Log::Debug(), fxCurrentTaskHandler, fxTaskManager, TGo4TaskManager::GetLastTaskHandler(), TGo4TaskManager::GetTaskHandler(), TGo4Task::IsWorkStopped(), TGo4Task::StartWorkThreads(), and TGo4Task::StopWorkThreads(). Referenced by TGo4TaskManager::AddClient(), and TGo4TaskManager::RemoveTaskHandler(). |
|
Definition at line 297 of file TGo4ServerTask.cxx. References fbConnectRequest, fbKeepServerSocket, fuConnectPort, fxConnectHost, and fxConnectTransport. Referenced by TGo4TaskHandler::ConnectServerChannel(), and TGo4TaskManager::ServeClient(). |
|
Definition at line 306 of file TGo4ServerTask.cxx. References fbDisConnectRequest, and fxDisConnectTransport. Referenced by TGo4TaskManager::ServeClient(). |
|
Definition at line 459 of file TGo4ServerTask.cxx. References fxConnectTransport. |
|
Definition at line 148 of file TGo4ServerTask.h. References fxConnectorName. Referenced by ConnectorThreadIsStopped(), StartConnectorThread(), StopConnectorThread(), and TGo4ServerTask(). |
|
Definition at line 150 of file TGo4ServerTask.h. References fxConnectHost. Referenced by 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.
Definition at line 312 of file TGo4ServerTask.cxx. References TGo4Socket::Close(), fbConnectIsClose, fbConnectIsDone, fbConnectIsOpen, fbConnectRequest, fbDisConnectRequest, fbKeepServerSocket, fuConnectPort, fxConnectTransport, fxDisConnectTransport, GetConnectHost(), TGo4Socket::IsOpen(), and TGo4Socket::Open(). Referenced by TGo4TaskConnectorTimer::Notify(). |
|
Remove all connected client task from this server.
Definition at line 179 of file TGo4ServerTask.cxx. References fxTaskManager, TGo4TaskManager::NextTaskHandler(), and RemoveClient(). Referenced by Quit(). |
|
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. Definition at line 102 of file TGo4ServerTask.cxx. References TGo4Log::Debug(), TGo4TaskManager::DisConnectClient(), fxTaskManager, GetCurrentTaskHandler(), GetTaskHandler(), TGo4Task::IsMaster(), kComQuit, TGo4Task::SendStopBuffers(), TGo4Task::StartWorkThreads(), TGo4Task::StopWorkThreads(), TGo4Task::SubmitEmergencyCommand(), TGo4Task::SubmitEmergencyData(), and TGo4TaskManager::WaitForClientRemoved(). Referenced by TGo4Master::DisconnectSlave(), TGo4ComRemoveClient::ExeCom(), RemoveAllClients(), and RemoveCurrentClient(). |
|
removes the currently active client from server (disconnect).
Definition at line 207 of file TGo4ServerTask.cxx. References TGo4Log::Debug(), GetCurrentTaskHandler(), and RemoveClient(). |
|
Definition at line 389 of file TGo4ServerTask.cxx. References fbConnectIsOpen, fgiOPENWAITCYCLES, fguOPENWAITCYCLETIME, and TGo4Thread::Sleep(). Referenced by TGo4TaskHandler::ConnectServerChannel(), and TGo4TaskManager::ServeClient(). |
|
Overrides the ThreadManager Initialization; is used to setup the client connections on demand; checks for fbConnectRequest flag.
Definition at line 411 of file TGo4ServerTask.cxx. References fbConnectIsClose, fgiCLOSEWAITCYCLES, fguCLOSEWAITCYCLETIME, and TGo4Thread::Sleep(). Referenced by TGo4TaskManager::ServeClient(). |
|
Definition at line 432 of file TGo4ServerTask.cxx. References fbConnectIsDone, fguCONNECTWAITCYCLETIME, TGo4ThreadManager::IsTerminating(), and TGo4Thread::Sleep(). Referenced by TGo4TaskHandler::ConnectServerChannel(), and TGo4TaskManager::ServeClient(). |
|
maximum cycles to wait until transport is open.
Definition at line 37 of file TGo4ServerTask.cxx. Referenced by WaitForOpen(). |
|
time for each open wait cycle.
Definition at line 38 of file TGo4ServerTask.cxx. Referenced by WaitForOpen(). |
|
maximum cycles to wait until transport is closed.
Definition at line 39 of file TGo4ServerTask.cxx. Referenced by WaitForClose(). |
|
time for each close wait cycle.
Definition at line 40 of file TGo4ServerTask.cxx. Referenced by WaitForClose(). |
|
maximum cycles to wait until transport is connected.
Definition at line 41 of file TGo4ServerTask.cxx. |
|
time for each connect wait cycle.
Definition at line 42 of file TGo4ServerTask.cxx. Referenced by WaitForConnection(). |
|
period of task connector timer.
Definition at line 43 of file TGo4ServerTask.cxx. Referenced by Shutdown(), and TGo4ServerTask(). |
|
remember name of connector thread.
Definition at line 229 of file TGo4ServerTask.h. Referenced by GetConnectorName(), and TGo4ServerTask(). |
|
Definition at line 233 of file TGo4ServerTask.h. Referenced by GetTaskHandler(), GetTaskManager(), NextCommand(), RemoveAllClients(), RemoveClient(), SendStatus(), SendStatusBuffer(), SetCurrentTask(), StopConnectorThread(), TGo4ServerTask(), and ~TGo4ServerTask(). |
|
@supplierCardinality 1.
Definition at line 236 of file TGo4ServerTask.h. Referenced by GetCurrentTaskHandler(), and SetCurrentTask(). |
|
link to the next TaskHandler transport instance that shall be connected by the Application Control Timer with the client.
Definition at line 242 of file TGo4ServerTask.h. Referenced by GetConnectTransport(), SetConnect(), and TimerConnect(). |
|
link to the next TaskHandler transport instance that shall be disconnected by the Application Control Timer with the client.
Definition at line 248 of file TGo4ServerTask.h. Referenced by SetDisConnect(), and TimerConnect(). |
|
hostname for timer connect.
Definition at line 253 of file TGo4ServerTask.h. Referenced by GetConnectHost(), and SetConnect(). |
|
port number for timer connect.
Definition at line 258 of file TGo4ServerTask.h. Referenced by SetConnect(), and TimerConnect(). |
|
True if open in server mode shall keep the server socket instance.
Definition at line 264 of file TGo4ServerTask.h. Referenced by SetConnect(), and TimerConnect(). |
|
True if fxConnectTransport shall be Open() by AppControlTimer.
Definition at line 269 of file TGo4ServerTask.h. Referenced by SetConnect(), and TimerConnect(). |
|
True if fxConnectTransport shall be Close() by AppControlTimer.
Definition at line 274 of file TGo4ServerTask.h. Referenced by SetDisConnect(), and TimerConnect(). |
|
True if fxConnectTransport waits in server Open() call.
Definition at line 280 of file TGo4ServerTask.h. Referenced by TimerConnect(), and WaitForOpen(). |
|
True if fxConnectTransport has returned from Open(), i.e. connection was established Definition at line 286 of file TGo4ServerTask.h. Referenced by TimerConnect(), and WaitForConnection(). |
|
True if fxConnectTransport has returned from Close(), i.e. connection was established Definition at line 292 of file TGo4ServerTask.h. Referenced by TimerConnect(), and WaitForClose(). |
|
timer responsible for the connection/disconnection of clients; independent of application control timer
Definition at line 299 of file TGo4ServerTask.h. Referenced by TGo4ServerTask(), and ~TGo4ServerTask(). |
|
Name of the Preferences file for the client startup.
Definition at line 46 of file TGo4ServerTask.cxx. Referenced by LaunchClient(), and TGo4Master::LaunchSlaveServer(). |