costin      02/01/25 22:17:47

  Modified:    jk/native2/include jk_channel.h
  Log:
  Added before/after request hooks to channel.
  
  Used to get resources that will be used for request processing ( instead
  of getting them on each message ) - that's the attach to vm in the case
  of the jni channel.
  
  Revision  Changes    Path
  1.5       +34 -2     jakarta-tomcat-connectors/jk/native2/include/jk_channel.h
  
  Index: jk_channel.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_channel.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- jk_channel.h      16 Dec 2001 23:17:23 -0000      1.4
  +++ jk_channel.h      26 Jan 2002 06:17:47 -0000      1.5
  @@ -63,6 +63,7 @@
   #include "jk_logger.h"
   #include "jk_pool.h"
   #include "jk_msg.h"
  +#include "jk_service.h"
   
   #ifdef __cplusplus
   extern "C" {
  @@ -106,6 +107,18 @@
        *  and the setting code can better report errors.
        */
       char **supportedProperties;
  +
  +    /* JK_TRUE if the channel is 'stream' based, i.e. it works using
  +       send() followed by blocking reads().
  +       XXX make it type and define an enum of supported types ?
  +
  +       The only alternative right now is JNI ( and doors ), where
  +       a single thread is used. After the first packet is sent the
  +       java side takes control and directly dispatch messages using the
  +       jni  ( XXX review - it would be simple with continuations, but
  +       send/receive flow is hard to replicate on jni ) 
  +    */
  +    int is_stream;
       
       struct jk_worker *worker; 
       jk_map_t *properties;
  @@ -137,14 +150,33 @@
      */
       int (JK_METHOD *send)(struct jk_env *env, jk_channel_t *_this,
                          struct jk_endpoint *endpoint,
  -                       char *b, int len );
  +                          struct jk_msg *msg );
       
       /** Receive a packet
        */
       int (JK_METHOD *recv)(struct jk_env *env, jk_channel_t *_this,
                          struct jk_endpoint *endpoint,
  -                       char *b, int len );
  +                          struct jk_msg *msg );
  +
  +    /** Called before request processing, to initialize resources.
  +        All following calls will be in the same thread.
  +     */
  +    int (JK_METHOD *beforeRequest)(struct jk_env *env, jk_channel_t *_this,
  +                                   struct jk_worker *worker,
  +                                   struct jk_endpoint *endpoint,
  +                                   struct jk_ws_service *r );
  +                       
  +    /** Called after request processing. Used to be worker.done()
  +     */
  +    int (JK_METHOD *afterRequest)(struct jk_env *env, jk_channel_t *_this,
  +                                  struct jk_worker *worker,
  +                                  struct jk_endpoint *endpoint,
  +                                  struct jk_ws_service *r );
  +   
  +    
  +
       
  +    /* XXX remove for now, add later in all objects */
       /** Set a channel property. Properties are used to configure the 
        * communication channel ( example: port, host, file, shmem_name, etc).
        */
  
  
  

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

Reply via email to