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

2003-02-28 Thread costin
costin  2003/02/28 21:49:58

  Modified:jk/native2/common jk_channel_socket.c jk_endpoint.c jk_env.c
jk_map.c jk_uriEnv.c jk_worker_ajp13.c
jk_worker_lb.c jk_worker_status.c
   jk/native2/include jk_env.h jk_map.h
  Log:
  Added more getters and setters.
  
  A bit of refactoring for common methods ( the itoa and map concat ).
  
  The really interesting one is adding getters and setters to the endpoint ( to 
abstract
  the info from scoreboard ), I'm working on it.
  
  I split the status page in 4 - the config info doesn't change, there is no
  need to display it all the time, and the scoreboard page can grow and is the
  really interesting one from performance perspective.
  
  Revision  ChangesPath
  1.49  +19 -5 jakarta-tomcat-connectors/jk/native2/common/jk_channel_socket.c
  
  Index: jk_channel_socket.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_socket.c,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- jk_channel_socket.c   28 Feb 2003 05:05:03 -  1.48
  +++ jk_channel_socket.c   1 Mar 2003 05:49:58 -   1.49
  @@ -113,10 +113,10 @@
   static int JK_METHOD jk2_channel_socket_close(jk_env_t *env, jk_channel_t *ch,
jk_endpoint_t *endpoint);
   
  -static char *jk2_channel_socket_multiValueInfo[]={group, NULL };
  -static char *jk2_channel_socket_getAttributeInfo[]={name, NULL };
  -static char *jk2_channel_socket_setAttributeInfo[]={host, port, route, 
lb_factor,
  -level, NULL };
  +static char *jk2_channel_socket_getAttributeInfo[]={host, port, keepalive, 
timeout, nodelay,
  +debug, disabled, NULL };
  +static char *jk2_channel_socket_setAttributeInfo[]={host, port, keepalive, 
timeout, nodelay,
  +debug, disabled, NULL };
   
   static int JK_METHOD jk2_channel_socket_setAttribute(jk_env_t *env,
  jk_bean_t *mbean,
  @@ -152,6 +152,20 @@
   
   if( strcmp( name, name )==0 ) {
   return  bean-name;
  +} else if( strcmp( host, name ) == 0 ) {
  +return socketInfo-host;
  +} else if( strcmp( port, name ) == 0 ) {
  +return jk2_env_itoa( env, socketInfo-port );
  +} else if( strcmp( nodelay, name ) == 0 ) {
  +return jk2_env_itoa( env, socketInfo-ndelay );
  +} else if( strcmp( keepalive, name ) == 0 ) {
  +return jk2_env_itoa( env, socketInfo-keepalive );
  +} else if( strcmp( timeout, name ) == 0 ) {
  +return jk2_env_itoa( env, socketInfo-timeout );
  +} else if( strcmp( debug, name ) == 0 ) {
  +return jk2_env_itoa( env, ch-mbean-debug );
  +} else if( strcmp( disabled, name ) == 0 ) {
  +return jk2_env_itoa( env, ch-mbean-disabled );
   }
   return NULL;
   }
  @@ -670,7 +684,7 @@
   result-init= jk2_channel_socket_init; 
   
   result-getAttributeInfo=jk2_channel_socket_getAttributeInfo;
  -result-multiValueInfo=jk2_channel_socket_multiValueInfo;
  +result-multiValueInfo=NULL;
   result-setAttributeInfo=jk2_channel_socket_setAttributeInfo;
   
   result-object= ch;
  
  
  
  1.23  +20 -1 jakarta-tomcat-connectors/jk/native2/common/jk_endpoint.c
  
  Index: jk_endpoint.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_endpoint.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- jk_endpoint.c 4 Feb 2003 07:39:59 -   1.22
  +++ jk_endpoint.c 1 Mar 2003 05:49:58 -   1.23
  @@ -126,9 +126,26 @@
return JK_OK;
   }
   
  +static char *getAttInfo[]={ id, NULL };
  +
  +static void * JK_METHOD jk2_endpoint_getAttribute(jk_env_t *env, jk_bean_t *bean,
  +  char *name )
  +{
  +jk_endpoint_t *ep=(jk_endpoint_t *)bean-object;
  +
  +if( strcmp( name, id )==0 ) {
  +return  1;
  +} else if (strcmp(inheritGlobals, name) == 0) {
  +return ;
  +}
  +return NULL;
  +}
  +
  +
  +
   int JK_METHOD
   jk2_endpoint_factory( jk_env_t *env, jk_pool_t *pool,
  -  jk_bean_t *result,
  +  jk_bean_t *result,
 const char *type, const char *name)
   {
   jk_endpoint_t *e = (jk_endpoint_t *)pool-calloc(env, pool,
  @@ -162,6 +179,8 @@
   epId=atoi( result-localName );
   
   result-object = e;
  +result-getAttributeInfo=getAttInfo;
  +result-getAttribute=jk2_endpoint_getAttribute;
   e-mbean=result;
   
   e-workerEnv=env-getByName( env, workerEnv );
  

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

2002-05-23 Thread costin

costin  02/05/23 21:26:00

  Modified:jk/native2/common jk_env.c jk_shm.c
   jk/native2/include jk_env.h
  Log:
  Moved the common code in jk_env. Many components need an aprPool, and assuming
  that jk_pool wraps an aprPool is not the cleanest solution.
  
  Revision  ChangesPath
  1.28  +29 -2 jakarta-tomcat-connectors/jk/native2/common/jk_env.c
  
  Index: jk_env.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_env.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- jk_env.c  23 May 2002 14:54:07 -  1.27
  +++ jk_env.c  24 May 2002 04:26:00 -  1.28
  @@ -55,10 +55,12 @@
*   *
* = */

  +#include jk_global.h
   #include jk_env.h
   #include jk_objCache.h
   
   jk_env_t *jk_env_globalEnv;
  +void *jkGlobalAprPool;
   
   /* Private methods 
   */
  @@ -70,6 +72,29 @@
   
   /*  Env management  */
   
  +static void JK_METHOD *jk2_env_getAprPool( jk_env_t *env ) {
  +#ifdef HAS_APR
  +/* We don't want to have to recreate the scoreboard after
  + * restarts, so we'll create a global pool and never clean it.
  + */
  +if( jkGlobalAprPool==NULL ) {
  +int rc;
  +
  +/* Make sure apr is initialized */
  +apr_initialize(); 
  +rc = apr_pool_create(( apr_pool_t **)jkGlobalAprPool, NULL);
  +if (rc != APR_SUCCESS || jkGlobalAprPool==NULL ) {
  +env-l-jkLog(env, env-l, JK_LOG_ERROR, 
  +  Unable to create global apr pool\n);
  +return NULL;
  +}
  +}
  +return jkGlobalAprPool;
  +#else
  +return NULL;
  +#endif
  +}
  +
   /** Public method, creates/get the global env
*/
   jk_env_t* JK_METHOD jk2_env_getEnv( char *id, jk_pool_t *pool ) {
  @@ -109,7 +134,8 @@
   env-releaseEnv= parentEnv-releaseEnv; 
   env-jkClearException=parentEnv-jkClearException;
   env-jkException=parentEnv-jkException;
  -
  +env-getAprPool=parentEnv-getAprPool;
  +
   env-_registry=parentEnv-_registry;
   env-_objects=parentEnv-_objects;
   env-l=parentEnv-l;
  @@ -393,7 +419,7 @@
 env.registerFactory(): NullPointerException\n);
   return;
   }
  -env-_registry-put( env, env-_registry, type, fact, NULL );
  +env-_registry-put( env, env-_registry, (char *)type, (void *)fact, NULL );
   }
   
   /*  Exceptions  */
  @@ -457,6 +483,7 @@
   env-debug = 0;
   env-jkClearException=jk_env_jkClearException;
   env-jkException=jk_env_jkException;
  +env-getAprPool=jk2_env_getAprPool;
   
   env-id=0;
   
  
  
  
  1.19  +11 -14jakarta-tomcat-connectors/jk/native2/common/jk_shm.c
  
  Index: jk_shm.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_shm.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- jk_shm.c  19 May 2002 17:37:08 -  1.18
  +++ jk_shm.c  24 May 2002 04:26:00 -  1.19
  @@ -81,7 +81,6 @@
   #include apr_file_io.h
   #include apr_file_info.h
   #include apr_general.h
  -static apr_pool_t *globalShmPool;
   
   #elif defined(HAVE_MMAP)  !defined(WIN32)
   
  @@ -117,20 +116,13 @@
   apr_file_t *file;
   apr_finfo_t finfo;
   apr_mmap_t *aprMmap;
  +apr_pool_t *globalShmPool;
  +
  +globalShmPool= (apr_pool_t *)env-getAprPool( env );
  +
  +if( globalShmPool==NULL )
  +return JK_FALSE;
   
  -/* We don't want to have to recreate the scoreboard after
  - * restarts, so we'll create a global pool and never clean it.
  - */
  -if( globalShmPool==NULL ) {
  -/* Make sure apr is initialized */
  -apr_initialize(); 
  -rc = apr_pool_create(globalShmPool, NULL);
  -if (rc != APR_SUCCESS || globalShmPool==NULL ) {
  -env-l-jkLog(env, env-l, JK_LOG_ERROR, 
  -  Unable to create global pool for jk_shm\n);
  -return rc;
  -}
  -}
   
   /* First make sure the file exists and is big enough
*/
  @@ -331,6 +323,11 @@
   
   if( shm-size == 0  ) {
   shm-size = shm-slotSize * shm-slotMaxCount;
  +}
  +
  +if( shm-mbean-debug  0 ) {
  +env-l-jkLog(env, env-l, JK_LOG_INFO, shm.init(): file=%s size=%d\n,
  +  shm-fname, shm-size);
   }
   
   if( shm-size = 0 ) {
  
  
  
  1.16  +5 -2  jakarta-tomcat-connectors/jk/native2/include/jk_env.h
  
  Index: jk_env.h
  

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

2002-04-25 Thread costin

costin  02/04/25 11:37:44

  Modified:jk/native2/include jk_env.h
  Log:
  Added a 'recycle' method.
  
  Obviously malloc is cheap in C ( but it does have some syncs ! ), but
  we need to preserve the jni 'global references' and maybe in future pin
  the jbyteArrays.
  
  Revision  ChangesPath
  1.13  +4 -5  jakarta-tomcat-connectors/jk/native2/include/jk_env.h
  
  Index: jk_env.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_env.h,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- jk_env.h  12 Apr 2002 21:49:03 -  1.12
  +++ jk_env.h  25 Apr 2002 18:37:44 -  1.13
  @@ -91,6 +91,7 @@
   typedef struct jk_bean jk_bean_t;
   typedef struct jk_env jk_env_t;
   
  +extern struct jk_env *jk_env_globalEnv;
   
   /**
* Factory used to create all jk objects. Factories are registered with 
  @@ -184,13 +185,9 @@
*  XXX Implement run-time change in the status/ctl workers.
*/
   int  ( JK_METHOD *setAttribute)(struct jk_env *env, struct jk_bean *bean,
  - char *name, void *value );
  +char *name, void *value );
   
   void *  ( JK_METHOD *getAttribute)(struct jk_env *env, struct jk_bean *bean, 
char *name );
  -
  -/* getBeanInfo() */
  -
  -/* invoke() */
   };
   
   /**
  @@ -223,6 +220,8 @@
   /** Release the env instance. The tmpPool will be recycled.
*/
   int (JK_METHOD *releaseEnv)(struct jk_env *parent, struct jk_env *chld);
  +
  +int (JK_METHOD *recycleEnv)(struct jk_env *env);
   
   /*  Exceptions  */
   
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_env.h jk_global.h jk_handler.h jk_logger.h

2002-04-12 Thread nacho

nacho   02/04/12 14:49:03

  Modified:jk/native2/common jk_channel_jni.c jk_channel_socket.c
jk_config.c jk_endpoint.c jk_env.c
jk_handler_logon.c jk_handler_response.c
jk_logger_file.c jk_uriEnv.c jk_uriMap.c
jk_vm_default.c jk_worker_ajp13.c jk_workerEnv.c
   jk/native2/include jk_env.h jk_global.h jk_handler.h
jk_logger.h
  Log:
  Fixes for Win32 compatibility, 72 warnings left
  
  Revision  ChangesPath
  1.7   +6 -6  jakarta-tomcat-connectors/jk/native2/common/jk_channel_jni.c
  
  Index: jk_channel_jni.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_jni.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jk_channel_jni.c  11 Apr 2002 19:30:23 -  1.6
  +++ jk_channel_jni.c  12 Apr 2002 21:49:03 -  1.7
  @@ -277,7 +277,7 @@
 jk_endpoint_t *endpoint,
 jk_msg_t *msg) 
   {
  -int sd;
  +//int sd;
   int  sent=0;
   char *b;
   int len;
  @@ -370,10 +370,10 @@
jk_endpoint_t *endpoint,
jk_msg_t *msg) 
   {
  -jbyte *nbuf;
  -jbyteArray jbuf;
  -int jlen;
  -jboolean iscommit;
  +//jbyte *nbuf;
  +//jbyteArray jbuf;
  +//int jlen;
  +//jboolean iscommit;
   jk_channel_jni_private_t *jniCh=_this-_privatePtr;
   
   env-l-jkLog(env, env-l, JK_LOG_ERROR,
  @@ -406,7 +406,7 @@
   static int jk2_channel_jni_processMsg(jk_env_t *env, jk_endpoint_t *e,
 jk_ws_service_t *r)
   {
  -int code;
  +//int code;
   jk_handler_t *handler;
   int rc;
   jk_handler_t **handlerTable=e-worker-workerEnv-handlerTable;
  
  
  
  1.19  +3 -3  jakarta-tomcat-connectors/jk/native2/common/jk_channel_socket.c
  
  Index: jk_channel_socket.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_socket.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- jk_channel_socket.c   11 Apr 2002 19:30:23 -  1.18
  +++ jk_channel_socket.c   12 Apr 2002 21:49:03 -  1.19
  @@ -117,7 +117,7 @@
   static int JK_METHOD jk2_channel_socket_close(jk_env_t *env, jk_channel_t *ch,
jk_endpoint_t *endpoint);
   
  -static int jk2_channel_socket_setAttribute(jk_env_t *env,
  +static int JK_METHOD jk2_channel_socket_setAttribute(jk_env_t *env,
  jk_bean_t *mbean,
  char *name, void *valueP)
   {
  @@ -248,7 +248,7 @@
   jk_channel_t *ch,
   jk_endpoint_t *endpoint)
   {
  -int err;
  +//int err;
   jk_channel_socket_private_t *socketInfo=
(jk_channel_socket_private_t *)(ch-_privatePtr);
   
  @@ -261,7 +261,7 @@
   sock = socket(AF_INET, SOCK_STREAM, 0);
   if(sock  0) {
   #ifdef WIN32
  -if(SOCKET_ERROR == ret) { 
  +if(INVALID_SOCKET == sock) { 
   errno = WSAGetLastError() - WSABASEERR;
   }
   #endif /* WIN32 */
  
  
  
  1.10  +10 -10jakarta-tomcat-connectors/jk/native2/common/jk_config.c
  
  Index: jk_config.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_config.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- jk_config.c   11 Apr 2002 19:32:04 -  1.9
  +++ jk_config.c   12 Apr 2002 21:49:03 -  1.10
  @@ -58,7 +58,7 @@
   /***
* Description: General purpose config object *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.9 $   *
  + * Version: $Revision: 1.10 $   *
***/
   
   #include jk_global.h
  @@ -140,7 +140,7 @@
 char *workerFile)
   {
   FILE *fp;
  -char buf[LENGTH_OF_LINE + 1];
  +//char buf[LENGTH_OF_LINE + 1];
   int i,j;
   
   fp= fopen(workerFile, w);
  @@ -201,16 +201,16 @@
   jk_bean_t *w = NULL;
   char *type=NULL;
   char *dot=0;
  -int i;
  -char **comp;
  -int nrComp;
  +//int i;
  +//char 

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

2002-03-24 Thread costin

costin  02/03/24 11:21:40

  Modified:jk/native2/include jk_env.h
  Log:
  Initial/experimental field to store all the supported properties in
  each component.
  
  Will be used to simplify/generalize the status worker.
  
  Revision  ChangesPath
  1.9   +8 -0  jakarta-tomcat-connectors/jk/native2/include/jk_env.h
  
  Index: jk_env.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_env.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- jk_env.h  23 Mar 2002 16:52:18 -  1.8
  +++ jk_env.h  24 Mar 2002 19:21:40 -  1.9
  @@ -132,6 +132,7 @@
   /* Type of this object
*/
   const char *type;
  +
   /* Name of the object
*/
   const char *name;
  @@ -148,6 +149,13 @@
   */
   struct jk_map *settings;
   
  +/* Temp - will change !*/
  +/* Attributes supported by getAttribute method */
  +char **getAttributeInfo;
  +
  +/* Attributes supported by setAttribute method */
  +char **setAttributeInfo;
  +
   /** Set a jk property. This is similar with the mechanism
*  used by java side ( with individual setters for
*  various properties ), except we use a single method
  
  
  

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




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

2002-03-24 Thread costin

costin  02/03/24 19:32:35

  Modified:jk/native2/include jk_env.h
  Log:
  Added a better creation method ( moved from jk_config ), easier to use.
  It uses the full name and return the jk_bean ( to be used for futher config )
  
  Revision  ChangesPath
  1.10  +12 -1 jakarta-tomcat-connectors/jk/native2/include/jk_env.h
  
  Index: jk_env.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_env.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- jk_env.h  24 Mar 2002 19:21:40 -  1.9
  +++ jk_env.h  25 Mar 2002 03:32:35 -  1.10
  @@ -222,12 +222,23 @@
*  XXX Not implemented/not used
*/
   void (JK_METHOD *jkClearException)( jk_env_t *env );
  +
  +/** Create an object using the name. Use the : separated prefix as
  + *  type. XXX This should probably replace createInstance.
  + *
  + *  @param parentPool  The pool of the parent. The object is created in its own 
pool,
  + * but if the parent is removed all childs will be removed 
as well. Use a long
  + * lived pool ( env-globalPool, workerEnv-pool ) if you 
don't want this.
  + *  @param objName. It must follow the documented convention, with the type as 
prefix, then ':'
  + */
  +struct jk_bean *(*createBean)( struct jk_env *env, struct jk_pool *parentPool, 
char *objName );
  +
   
   /** Create an object instance. It'll first get the factory, then
   call it. This is a very frequent operation.
   */
   void *
  -(JK_METHOD *createInstance)( jk_env_t *env, struct jk_pool *pool,
  +(JK_METHOD *createInstance)( jk_env_t *env, struct jk_pool *parentPool,
const char *type, const char *name );
   
   void *
  
  
  

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




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

2002-03-18 Thread costin

costin  02/03/18 09:53:27

  Modified:jk/native2/include jk_env.h
  Log:
  Major change in jk component registration and config.
  
  jk_bean_t is a common structure used by all jk components for registration
  and configuration. The model is similar with beans ( or mbeans ) - the
  properties are pushed using setters. Because it's C, we use a single
  setAttribute() method instead of one setter for each configurable thing.
  
  Metadata can be added either using a 'magic' property ( getAttribute(properties )),
  or externally, either in config or in a java proxy. ( that's for much later )
  
  Revision  ChangesPath
  1.7   +69 -32jakarta-tomcat-connectors/jk/native2/include/jk_env.h
  
  Index: jk_env.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_env.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jk_env.h  21 Feb 2002 11:15:04 -  1.6
  +++ jk_env.h  18 Mar 2002 17:53:27 -  1.7
  @@ -68,6 +68,9 @@
   #include jk_map.h
   #include jk_worker.h
   
  +#define JK_LINE __FILE__,__LINE__
  +
  +
   /** 
*  Common environment for all jk functions. Provide uniform
*  access to pools, logging, factories and other 'system' services.
  @@ -84,28 +87,23 @@
   struct jk_env;
   struct jk_logger;
   struct jk_map;
  +struct jk_bean;
  +typedef struct jk_bean jk_bean_t;
   typedef struct jk_env jk_env_t;
   
   /**
* Factory used to create all jk objects. Factories are registered with 
  - * jk2_env_registerFactory ( or automatically - LATER ), and created
  - * with jk2_env_getFactory.
  - * 
  - * Essentially, an abstract base class (or factory class) with a single
  - * method -- think of it as createWorker() or the Factory Method Design
  - * Pattern.  There is a different worker_factory function for each of the
  - * different types of workers.  The set of all these functions is created
  - * at startup from the list in jk_worker_list.h, and then the correct one
  - * is chosen in jk_worker.c-wc_create_worker().  See jk_worker.c and
  - * jk_ajp13_worker.c/jk_ajp14_worker.c for examples.
  + * jk2_env_registerFactory. The 'core' components are registered in
  + * jk_registry.c
*
  - * This allows new workers to be written without modifing the plugin code
  - * for the various web servers (since the only link is through
  - * jk_worker_list.h).  
  + * Each jk component must be configurable using the setAttribute methods
  + * in jk_bean. The factory is responsible to set up the config methods.
  + *
  + * The mechanism provide modularity and manageability to jk.
*/
   typedef int (JK_METHOD *jk_env_objectFactory_t)(jk_env_t *env,
   struct jk_pool *pool,
  -void **result, 
  +struct jk_bean *mbean, 
   const char *type,
   const char *name);
   
  @@ -114,8 +112,6 @@
*/
   jk_env_t* JK_METHOD jk2_env_getEnv( char *id, struct jk_pool *pool );
   
  -#define JK_LINE __FILE__,__LINE__
  -
   struct jk_exception {
   char *file;
   int line;
  @@ -128,6 +124,46 @@
   
   typedef struct jk_exception jk_exception_t;
   
  +
  +/** Each jk object will use this mechanism for configuration
  + *  XXX Should it be named mbean ?
  + */
  +struct jk_bean {
  +/* Type of this object
  + */
  +const char *type;
  +/* Name of the object
  + */
  +const char *name;
  +
  +/* The wrapped object
  + */
  +void *object;
  +
  +/** Set a jk property. This is similar with the mechanism
  + *  used by java side ( with individual setters for
  + *  various properties ), except we use a single method
  + *  and a big switch
  + *
  + *  As in java beans, setting a property may have side effects
  + *  like changing the log level or reading a secondary
  + *  properties file.
  + *
  + *  Changing a property at runtime will also be supported for
  + *  some properties.
  + *  XXX Document supported properties as part of
  + *  workers.properties doc.
  + *  XXX Implement run-time change in the status/ctl workers.
  + */
  +int (*setAttribute)(struct jk_env *env, struct jk_bean *bean,
  + char *name, void *value );
  +
  +void *(*getAttribute)(struct jk_env *env, struct jk_bean *bean, char *name );
  +
  +/* getBeanInfo() */
  +
  +/* invoke() */
  +};
   
   /**
*  The env will be used in a similar way with the JniEnv, to provide 
  @@ -146,7 +182,8 @@
   */
   struct jk_pool *localPool;
   
  -/* Exceptions
  +/* Exceptions.
  + *  XXX Not implemented/not used
*/
   void (JK_METHOD *jkThrow)( jk_env_t *env,
  

cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_env.h jk_global.h jk_map.h jk_md5.h

2002-02-21 Thread hgomez

hgomez  02/02/21 03:15:05

  Modified:jk/native2/include jk_env.h jk_global.h jk_map.h jk_md5.h
  Log:
  Seventh Batch of jk2 renaming
  
  Revision  ChangesPath
  1.6   +4 -4  jakarta-tomcat-connectors/jk/native2/include/jk_env.h
  
  Index: jk_env.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_env.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jk_env.h  6 Feb 2002 19:18:21 -   1.5
  +++ jk_env.h  21 Feb 2002 11:15:04 -  1.6
  @@ -88,8 +88,8 @@
   
   /**
* Factory used to create all jk objects. Factories are registered with 
  - * jk_env_registerFactory ( or automatically - LATER ), and created
  - * with jk_env_getFactory.
  + * jk2_env_registerFactory ( or automatically - LATER ), and created
  + * with jk2_env_getFactory.
* 
* Essentially, an abstract base class (or factory class) with a single
* method -- think of it as createWorker() or the Factory Method Design
  @@ -112,7 +112,7 @@
   /** Get a pointer to the jk_env. We could support multiple 
*  env 'instances' in future - for now it's a singleton.
*/
  -jk_env_t* JK_METHOD jk_env_getEnv( char *id, struct jk_pool *pool );
  +jk_env_t* JK_METHOD jk2_env_getEnv( char *id, struct jk_pool *pool );
   
   #define JK_LINE __FILE__,__LINE__
   
  @@ -216,7 +216,7 @@
   struct jk_exception *lastException;
   };
   
  -void JK_METHOD jk_registry_init(jk_env_t *env);
  +void JK_METHOD jk2_registry_init(jk_env_t *env);
   
   
   #ifdef __cplusplus
  
  
  
  1.4   +4 -4  jakarta-tomcat-connectors/jk/native2/include/jk_global.h
  
  Index: jk_global.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_global.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jk_global.h   12 Jan 2002 04:43:04 -  1.3
  +++ jk_global.h   21 Feb 2002 11:15:04 -  1.4
  @@ -59,7 +59,7 @@
* Description: Global definitions and include files that should exist *
*  anywhere   *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.3 $   *
  + * Version: $Revision: 1.4 $   *
***/
   
   #ifndef JK_GLOBAL_H
  @@ -77,10 +77,10 @@
   #include sys/stat.h
   
   /** START OF AREA TO MODIFY BEFORE RELEASING */
  -#define JK_VERMAJOR 1
  -#define JK_VERMINOR 2
  +#define JK_VERMAJOR 2
  +#define JK_VERMINOR 0
   #define JK_VERFIX   0
  -#define JK_VERSTRING1.2.0
  +#define JK_VERSTRING2.0.0
   
   /* Beta number */
   #define JK_VERBETA  1
  
  
  
  1.9   +13 -13jakarta-tomcat-connectors/jk/native2/include/jk_map.h
  
  Index: jk_map.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_map.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- jk_map.h  12 Jan 2002 04:43:46 -  1.8
  +++ jk_map.h  21 Feb 2002 11:15:04 -  1.9
  @@ -58,7 +58,7 @@
   /***
* Description: Map object header file *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.8 $   *
  + * Version: $Revision: 1.9 $   *
***/
   
   #ifndef JK_MAP_H
  @@ -118,7 +118,7 @@
   void *_private;
   };
   
  -int jk_map_default_create(struct jk_env *env, jk_map_t **m, 
  +int jk2_map_default_create(struct jk_env *env, jk_map_t **m, 
 struct jk_pool *pool); 
   
   /* int map_open(jk_env *env, jk_map_t *m); */
  @@ -130,10 +130,10 @@
*  on any map.
*/
   
  -char *jk_map_getString(struct jk_env *env, struct jk_map *m,
  +char *jk2_map_getString(struct jk_env *env, struct jk_map *m,
  const char *name, char *def);
   
  -int jk_map_getBool(struct jk_env *env, struct jk_map *m,
  +int jk2_map_getBool(struct jk_env *env, struct jk_map *m,
  const char *prop, const char *def);
   
   /** Get a string property, using the worker's style
  @@ -141,18 +141,18 @@
   will be used.
   Example worker.ajp13.host=localhost.
   */
  -char *jk_map_getStrProp(struct jk_env *env, jk_map_t *m,
  +char *jk2_map_getStrProp(struct jk_env *env, jk_map_t *m,
   const char *objType, const char 

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

2002-02-06 Thread costin

costin  02/02/06 11:18:21

  Modified:jk/native2/include jk_env.h
  Log:
  Initial work on the exception mechanism, that would allow more meaningfull
  error messages out of jk. We can live without it, so it's low priority.
  
  Revision  ChangesPath
  1.5   +46 -4 jakarta-tomcat-connectors/jk/native2/include/jk_env.h
  
  Index: jk_env.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_env.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- jk_env.h  16 Dec 2001 23:17:23 -  1.4
  +++ jk_env.h  6 Feb 2002 19:18:21 -   1.5
  @@ -114,17 +114,59 @@
*/
   jk_env_t* JK_METHOD jk_env_getEnv( char *id, struct jk_pool *pool );
   
  +#define JK_LINE __FILE__,__LINE__
   
  +struct jk_exception {
  +char *file;
  +int line;
  +
  +char *type;
  +char *msg;
  +
  +struct jk_exception *next;
  +};
  +
  +typedef struct jk_exception jk_exception_t;
  +
  +
   /**
*  The env will be used in a similar way with the JniEnv, to provide 
*  access to various low level services ( pool, logging, system properties )
*  in a consistent way. In time we should have all methods follow 
  - *  the same pattern, with env as a first parameter, then the object ( this ) and 
  - *  the other methods parameters.  
  + *  the same pattern, with env as a first parameter, then the object ( this )
  + *  and the other methods parameters.  
*/
   struct jk_env {
   struct jk_logger *l;
  -struct jk_pool   *globalPool; 
  +struct jk_pool   *globalPool;
  +
  +/** Pool used for local allocations. It'll be reset when the
  +env is released ( the equivalent of 'detach' ). Can be
  +used for temp. allocation of small objects.
  +*/
  +struct jk_pool *localPool;
  +
  +/* Exceptions
  + */
  +void (JK_METHOD *jkThrow)( jk_env_t *env,
  +   const char *file, int line,
  +   const char *type,
  +   const char *fmt, ... );
  +
  +/** re-throw the exception and record the current pos.
  + *  in the stack trace
  + */
  +void (JK_METHOD *jkReThrow)( jk_env_t *env,
  + const char *file, int line );
  +
  +/* Last exception that occured
  + */
  +struct jk_exception *(JK_METHOD *jkException)( jk_env_t *env );
  +
  +/** Clear the exception state
  + */
  +void (JK_METHOD *jkClearException)( jk_env_t *env );
  +
   
   /** Global properties ( similar with System properties in java)
*/
  @@ -171,7 +213,7 @@
   
   /* private */
   struct jk_map *_registry;
  -
  +struct jk_exception *lastException;
   };
   
   void JK_METHOD jk_registry_init(jk_env_t *env);
  
  
  

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