You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2002/03/02 06:42:12 UTC

cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_worker.h

costin      02/03/01 21:42:12

  Modified:    jk/native2/include jk_worker.h
  Log:
  Finally remove validate().
  
  Initialization is done using setProperty() followed by an init().
  The worker should be independent of the way it is configured -
  and 'smart' workers can change some settings at runtime.
  
  Adding individual setters and introspection is of course not
  easy in C, but setProperty() is close enough for what we
  need.
  
  Revision  Changes    Path
  1.12      +10 -19    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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_worker.h	6 Feb 2002 19:19:16 -0000	1.11
  +++ jk_worker.h	2 Mar 2002 05:42:12 -0000	1.12
  @@ -58,7 +58,7 @@
   /***************************************************************************
    * Description: Workers controller header file                             *
    * Author:      Gal Shachor <sh...@il.ibm.com>                           * 
  - * Version:     $Revision: 1.11 $                                           *
  + * Version:     $Revision: 1.12 $                                           *
    ***************************************************************************/
   
   #ifndef JK_WORKER_H
  @@ -152,10 +152,12 @@
       /** Communication channel used by the worker 
        */
       struct jk_channel *channel;
  +    char *channelName;
   
       /** Reuse the endpoint and it's connection
        */
       struct jk_objCache *endpointCache;
  +    int cache_sz;
   
       /** Request pool cache. XXX We may use a pool of requests.
        */
  @@ -181,33 +183,22 @@
       /** If num_of_workers > 0 this is an load balancing worker
        */
       jk_worker_t **lb_workers;
  +    struct jk_map *lbWorkerMap;
       int num_of_workers;
   
  -    /*
  -     * Given a worker which is in the process of being created, and a list
  -     * of configuration options (or 'properties'), check to see if it the
  -     * options are.  This will always be called before the init() method.
  -     *
  -     * This is different from init - see the apache config process.
  -     * Validate should only do static checks on data ( if it has all
  -     * the info it needs and if it's valid ). Init() can do any
  -     * 'active' opertions.
  -     *
  -     * You can skip this by setting it to NULL.
  -     */
  -    int (JK_METHOD *validate)(struct jk_env *env, jk_worker_t *_this,
  -                              struct jk_map *props,
  -                              struct jk_workerEnv *we);
  +    int (JK_METHOD *setProperty)(struct jk_env *env, jk_worker_t *_this,
  +                                 char *name, char *value );
   
  +    char *(JK_METHOD *getProperty)(struct jk_env *env, jk_worker_t *_this,
  +                                   char *name );
  +    
       /*
        * 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 );
  +    int (JK_METHOD *init)(struct jk_env *env, jk_worker_t *_this);
   
       /*
        * Shutdown this worker. XXX Some cleanup must be made by default
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_worker.h

Posted by co...@covalent.net.
On Fri, 1 Mar 2002, Bill Barker wrote:

> >   Initialization is done using setProperty() followed by an init().
> >   The worker should be independent of the way it is configured -
> >   and 'smart' workers can change some settings at runtime.
> >
> >   Adding individual setters and introspection is of course not
> >   easy in C, but setProperty() is close enough for what we
> >   need.
> >
> So, I guess in JK3 we'll need full-blown C++ style vtables and interface
> discovery? We'll have almost managed to re-invent COM. ;-)

:-)

I see no other way to implement run-time configuration. Restarting
apache every time you want to add a worker or webapp is not a very
good solution.

The whole Gnome ( and many other C projects ) are written in object 
oriented C, and this coding style has a lot of benefits hard to 
achieve otherwise.

Sometime ago I was acused that I write 'C in java' ( I avoid 
interfaces and complex object models, use byte[] - just look at 
MessageBytes). Now it seems I write 'java in C'. Someone on cocoon wants 
'lisp style in java' ( with continuations, etc ). 

I don't think this is bad. Jk2 uses the 'JNI-style' OO-C, and
an object model that is very close to tomcat. I hope this will
make java people feel more comfortable and understand the code
more easily, and I hope we'll feel some of the benefits
of OO.

( and yes, I miss inheritance )

Costin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_worker.h

Posted by Bill Barker <wb...@wilshire.com>.
----- Original Message -----
From: <co...@apache.org>
To: <ja...@apache.org>
Sent: Friday, March 01, 2002 9:42 PM
Subject: cvs commit: jakarta-tomcat-connectors/jk/native2/include
jk_worker.h


> costin      02/03/01 21:42:12
>
>   Modified:    jk/native2/include jk_worker.h
>   Log:
>   Finally remove validate().
>
>   Initialization is done using setProperty() followed by an init().
>   The worker should be independent of the way it is configured -
>   and 'smart' workers can change some settings at runtime.
>
>   Adding individual setters and introspection is of course not
>   easy in C, but setProperty() is close enough for what we
>   need.
>
So, I guess in JK3 we'll need full-blown C++ style vtables and interface
discovery? We'll have almost managed to re-invent COM. ;-)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>