costin      02/01/25 22:41:51

  Modified:    jk/native2/include jk_worker.h
  Log:
  Added a cache for requests. Right now we recycle the pools ( it used to be part
  of the endpoint logic, I just preserved it ). It would make more sense to
  recycle the whole request, like we do in java - or don't bother at all,
  allocation is much cheaper ( and is even cheaper if apr_pools are used -
  the jk_pool does a malloc ). For now I'll leave it how it was.
  
  Get endpoint is gone, it's up to the worker to use an endpoint if it wants
  and how it uses it. Service is in - that's what the worker is supposed to do.
  
  Revision  Changes    Path
  1.10      +19 -24    jakarta-tomcat-connectors/jk/native2/include/jk_worker.h
  
  Index: jk_worker.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_worker.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- jk_worker.h       16 Dec 2001 23:17:23 -0000      1.9
  +++ jk_worker.h       26 Jan 2002 06:41:51 -0000      1.10
  @@ -58,7 +58,7 @@
   /***************************************************************************
    * Description: Workers controller header file                             *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           * 
  - * Version:     $Revision: 1.9 $                                           *
  + * Version:     $Revision: 1.10 $                                           *
    ***************************************************************************/
   
   #ifndef JK_WORKER_H
  @@ -102,10 +102,6 @@
    * There is also a load balancing worker (jk_lb_worker.c), which itself
    * manages a group of workers.
    *
  - * Web servers are configured to forward requests to a given worker.  To
  - * handle those requests, the worker's get_endpoint method is called, and
  - * then the service() method of that endpoint is called.
  - *
    * As with all the core jk classes, this is essentially an abstract base
    * class which is implemented/extended by classes which are specific to a
    * particular protocol (or request-handling system).  By using an abstract
  @@ -124,7 +120,8 @@
    * imagine that you are seeing the internal vtables of your favorite OO
    * language.  Whatever works for you.
    *
  - * See jk_ajp14_worker.c, jk_ajp13_worker.c and jk_ajp12_worker.c for examples.  
  + * See jk_ajp14_worker.c, jk_worker_status for examples.  
  + *
    */
   struct jk_worker {
   
  @@ -159,6 +156,10 @@
       /** Reuse the endpoint and it's connection
        */
       struct jk_objCache *endpointCache;
  +
  +    /** Request pool cache. XXX We may use reqCache.
  +     */
  +    struct jk_objCache *rPoolCache;
       
       /* 
        * Open connections cache...
  @@ -214,34 +215,28 @@
       /*
        * Do whatever initialization needs to be done to start this worker up.
        * Configuration options are passed in via the props parameter.  
  +     *
  +     * You can skip this by setting it to NULL.
        */
       int (JK_METHOD *init)(struct jk_env *env, jk_worker_t *_this,
                             struct jk_map *props,
                             struct jk_workerEnv *we );
   
       /*
  -     * Obtain an endpoint to service a particular request.  A pointer to
  -     * the endpoint is stored in pend. The done() method in the
  -     * endpoint will be called when the endpoint is no longer needed.
  +     * Shutdown this worker. XXX Some cleanup must be made by default
  +     * by workerEnv, so we don't need to duplicate the code.
        */
  -    int (JK_METHOD *get_endpoint)(struct jk_env *env, jk_worker_t *_this,
  -                                  struct jk_endpoint **pend );
  +    int (JK_METHOD *destroy)(struct jk_env *env, jk_worker_t *_thisP );
   
       /*
  -     * Called when this particular endpoint has finished processing a
  -     * request.  For some protocols (e.g. ajp12), this frees the memory
  -     * associated with the endpoint.  For others (e.g. ajp13/ajp14), this can
  -     * return the endpoint to a cache of already opened endpoints.  
  -     */
  -/*     int (JK_METHOD *done)(jk_env_t *env, */
  -/*                           jk_worker_t *_this, */
  -/*                           struct jk_endpoint *p ); */
  -
  +     * Forward a request to the servlet engine.  The request is described
  +     * by the jk_ws_service_t object.  I'm not sure exactly how
  +     * is_recoverable_error is being used.  
  +     */
  +    int (JK_METHOD *service)(struct jk_env *env,
  +                             struct jk_worker *_this,
  +                             struct jk_ws_service *s);
       
  -    /*
  -     * Shutdown this worker. 
  -     */
  -    int (JK_METHOD *destroy)(struct jk_env *env, jk_worker_t *_thisP );
   };
   
   #ifdef __cplusplus
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to