TSP: The Transport Sample Protocol



Request Handler
[Provider Core Library]

Collaboration diagram for Request Handler:The RequestHandler module is the set of all request handling API for TSP. More...


Modules

 RPC Request Handler
 The module is the set of functions which encapsulate the RPC machinery on server side.
 XML-RPC Request Handler
 The XMLRPCRequestLib module is the set of functions which encapsulate the RPC machinery.

Data Structures

struct  rqh_manager_data_t
 The TSP rqh manager data structure. More...
struct  TSP_provider_request_handler_t
 The structure TSP_provider_request_handler_t define object-oriented interface to a TSP request handler. More...

Typedefs

typedef int(*) tsp_request_handler_config_ft (struct TSP_provider_request_handler_t *)
 The TSP Request configuration object method This method must always return.
typedef int(*) tsp_request_handler_ft (struct TSP_provider_request_handler_t *)
 The TSP Request Handler object constructor.
typedef void *(*) tsp_request_handler_run_ft (void *)
 The TSP Request run object method, it may be passed as the start_routine of pthread_create(3), it is supposed to take the configuration parameter taken from the configuration step.
typedef enum TSP_request_handler_status TSP_request_handler_status_t
 Request handler status.
typedef int(*) tsp_request_handler_stop_ft (struct TSP_provider_request_handler_t *)
 The TSP Request stop object method, it will be called to stop the request handler.
typedef char *(*) tsp_request_handler_url_ft (struct TSP_provider_request_handler_t *)
 The TSP Request url getter object method, it will be called to retrieve the TSP URL at which the request handler may be reached if installed, configured and run.

Enumerations

enum  TSP_request_handler_status {
  TSP_RQH_STATUS_NOTINSTALLED = 0, TSP_RQH_STATUS_IDLE, TSP_RQH_STATUS_CONFIGURED, TSP_RQH_STATUS_RUNNING,
  TSP_RQH_STATUS_STOPPED
}
 Request handler status. More...

Functions

int TSP_provider_rqh_manager_end (void)
 End-up TSP configured request handlers.
TSP_provider_request_handler_tTSP_provider_rqh_manager_get (int rank)
 Get a request_handler.
int TSP_provider_rqh_manager_get_max_nb ()
 Get the maximum number of TSP_provider_request_handler.
int TSP_provider_rqh_manager_get_nb (void)
 Get the current number of TSP_provider_request_handler installed.
int TSP_provider_rqh_manager_get_nb_running (void)
 Get the current number of TSP_provider_request_handler running.
char * TSP_provider_rqh_manager_get_url (int rank)
 Get the URL for this request handler.
int TSP_provider_rqh_manager_init (void)
 Set-up TSP initial request handlers.
int TSP_provider_rqh_manager_install (int rank, tsp_request_handler_ft rqh_constructor)
 Install a TSP request handler.
int TSP_provider_rqh_manager_refresh (void)
 Refresh TSP request handlers activities this may start new request handler and/or stop running ones.
void TSP_provider_rqh_manager_waitend (void)
 This is a blocking function calls which triggers a wait on a condition variable which is signalled iff no more request handlers thread are running.


Detailed Description

The RequestHandler module is the set of all request handling API for TSP.

In TSP the command channel is handled by a request handler, that is each TSP request (request_open/close, request_sample, request_async_read/write ...) should be handled by each request handler. The core TSP is designed to provide several request handlers at the same time. The first TSP request handler is ONC-RPC, RPC Request Handler and there is a first draft of XML-RPC handler XML-RPC Request Handler. One may easily add other handler(s) if needed such as SOAP or CORBA handler. We define here the TSP request handler object and how to install and use it.


Typedef Documentation

typedef int(* ) tsp_request_handler_config_ft(struct TSP_provider_request_handler_t *)

The TSP Request configuration object method This method must always return.

If configuration succeed the method should return TRUE and FALSE otherwise.

typedef int(* ) tsp_request_handler_ft(struct TSP_provider_request_handler_t *)

The TSP Request Handler object constructor.

This function may be called to build a new request handler.

typedef void*(* ) tsp_request_handler_run_ft(void *)

The TSP Request run object method, it may be passed as the start_routine of pthread_create(3), it is supposed to take the configuration parameter taken from the configuration step.

This function should not return unless it terminates.

typedef enum TSP_request_handler_status TSP_request_handler_status_t

Request handler status.

typedef int(* ) tsp_request_handler_stop_ft(struct TSP_provider_request_handler_t *)

The TSP Request stop object method, it will be called to stop the request handler.

typedef char*(* ) tsp_request_handler_url_ft(struct TSP_provider_request_handler_t *)

The TSP Request url getter object method, it will be called to retrieve the TSP URL at which the request handler may be reached if installed, configured and run.


Enumeration Type Documentation

enum TSP_request_handler_status

Request handler status.

Enumerator:
TSP_RQH_STATUS_NOTINSTALLED  The request handler is not installed other field of the TSP_provider_request_handler_t are not significant.
TSP_RQH_STATUS_IDLE  The request handler is IDLE.
TSP_RQH_STATUS_CONFIGURED  The request handler is CONFIGURED.
TSP_RQH_STATUS_RUNNING  The request handler is RUNNING.
TSP_RQH_STATUS_STOPPED  The request handler is STOPPED.


Function Documentation

int TSP_provider_rqh_manager_end ( void   ) 

End-up TSP configured request handlers.

Returns:
TRUE on success, FALSE on failure

TSP_provider_request_handler_t* TSP_provider_rqh_manager_get ( int  rank  ) 

Get a request_handler.

Parameters:
rank IN, the rank of the requested handler in the array of registered request handler, should be less than TSP_provider_rqh_manager_get_nb
Returns:
the pointer to the actual request handler pointer may be NULL if rank is invalid.

int TSP_provider_rqh_manager_get_max_nb (  ) 

Get the maximum number of TSP_provider_request_handler.

Returns:
the maximum number of (registrable) request handler

int TSP_provider_rqh_manager_get_nb ( void   ) 

Get the current number of TSP_provider_request_handler installed.

Returns:
the number of registered request handler.

int TSP_provider_rqh_manager_get_nb_running ( void   ) 

Get the current number of TSP_provider_request_handler running.

Returns:
the number of running request handler

char* TSP_provider_rqh_manager_get_url ( int  rank  ) 

Get the URL for this request handler.

Parameters:
rank IN, the rank of the requested handler in the array of registered request handler, should be less than TSP_provider_rqh_manager_get_nb
Returns:
the string for the URL pointer may be NULL if rank is invalid or handler is KO.

int TSP_provider_rqh_manager_init ( void   ) 

Set-up TSP initial request handlers.

Returns:
TRUE on success, FALSE on failure

int TSP_provider_rqh_manager_install ( int  rank,
tsp_request_handler_ft  rqh_constructor 
)

Install a TSP request handler.

Parameters:
rank IN, the rank of the requested handler in the array of registered request handler, should be less than TSP_provider_rqh_manager_get_nb
rqh_constructor IN, function pointer to the request handler constructor
Returns:
TRUE on success FALSE on failure

int TSP_provider_rqh_manager_refresh ( void   ) 

Refresh TSP request handlers activities this may start new request handler and/or stop running ones.

Returns:
TRUE on success, FALSE on failure

void TSP_provider_rqh_manager_waitend ( void   ) 

This is a blocking function calls which triggers a wait on a condition variable which is signalled iff no more request handlers thread are running.

Framework Home Page.


Beware !! TSP wave is coming...