tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_registry.c jk_worker_jni.c jk_worker_run.c jk_worker_status.c
Date Sat, 02 Mar 2002 06:13:42 GMT
costin      02/03/01 22:13:42

  Modified:    jk/native2/common jk_registry.c jk_worker_jni.c
                        jk_worker_run.c jk_worker_status.c
  Log:
  More updates for setProperty()
  
  Revision  Changes    Path
  1.13      +2 -2      jakarta-tomcat-connectors/jk/native2/common/jk_registry.c
  
  Index: jk_registry.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_registry.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- jk_registry.c	21 Feb 2002 11:12:11 -0000	1.12
  +++ jk_registry.c	2 Mar 2002 06:13:42 -0000	1.13
  @@ -63,7 +63,7 @@
   #include "jk_registry.h"
   /***************************************************************************
    * Description: Worker list                                                *
  - * Version:     $Revision: 1.12 $                                           *
  + * Version:     $Revision: 1.13 $                                           *
    ***************************************************************************/
   
   /** Static declarations for all 'hardcoded' modules. This is a hack, 
  @@ -124,7 +124,7 @@
     env->registerFactory( env, "handler", "logon",   jk2_handler_logon_factory );
     env->registerFactory( env, "handler", "discovery",
                           jk2_handler_discovery_factory );
  -
  +  
     /* Optional objects */
   
   #ifdef HAVE_JNI
  
  
  
  1.4       +45 -40    jakarta-tomcat-connectors/jk/native2/common/jk_worker_jni.c
  
  Index: jk_worker_jni.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_jni.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jk_worker_jni.c	21 Feb 2002 11:13:59 -0000	1.3
  +++ jk_worker_jni.c	2 Mar 2002 06:13:42 -0000	1.4
  @@ -123,12 +123,11 @@
   }
   
   
  -static int JK_METHOD jk2_jni_worker_validate(jk_env_t *env, jk_worker_t *pThis,
  -                                             jk_map_t *props, jk_workerEnv_t *we)
  +static int JK_METHOD jk2_jni_worker_setProperty(jk_env_t *env, jk_worker_t *pThis,
  +                                                char *name, char *value)
   {
       jni_worker_data_t *jniWorker;
       int mem_config = 0;
  -    char *str_config = NULL;
       int rc;
       JNIEnv *jniEnv;
       char *prefix;
  @@ -141,31 +140,56 @@
   
       jniWorker = pThis->worker_private;
   
  -    prefix=(char *)props->pool->alloc( env, props->pool,
  -                                       strlen( pThis->name ) + 10 );
  -    strcpy( prefix, "worker." );
  -    strcat( prefix, pThis->name );
  -    fprintf(stderr, "Prefix= %s\n", prefix );
  +
  +    return JK_TRUE;
  +}
  +
  +static int JK_METHOD jk2_jni_worker_init(jk_env_t *env, jk_worker_t *_this)
  +{
  +    jni_worker_data_t *jniWorker;
  +    JNIEnv *jniEnv;
  +    jstring cmd_line = NULL;
  +    jstring stdout_name = NULL;
  +    jstring stderr_name = NULL;
  +    jint rc = 0;
  +    char *str_config = NULL;
  +    jk_map_t *props=_this->workerEnv->initData;
       
  -    rc=jniWorker->vm->init(env, jniWorker->vm, props, prefix );
  -    if( rc!=JK_TRUE ) {
  -        env->l->jkLog(env, env->l, JK_LOG_ERROR,
  -                      "jni.validate() failed to load vm init params\n");
  +    if(! _this || ! _this->worker_private) {
  +        env->l->jkLog(env, env->l, JK_LOG_EMERG,
  +                      "In init, assert failed - invalid parameters\n");
           return JK_FALSE;
       }
  +
  +    jniWorker = _this->worker_private;
  +    {
  +        char *prefix=(char *)_this->pool->alloc( env, _this->pool,
  +                                                 strlen( _this->name ) + 10 );
  +        strcpy( prefix, "worker." );
  +        strcat( prefix, _this->name );
  +        fprintf(stderr, "Prefix= %s\n", prefix );
  +        
  +        rc=jniWorker->vm->init(env, jniWorker->vm, _this->workerEnv->initData,
prefix );
  +        
  +        if( rc!=JK_TRUE ) {
  +            env->l->jkLog(env, env->l, JK_LOG_ERROR,
  +                          "jni.validate() failed to load vm init params\n");
  +            return JK_FALSE;
  +        }
  +    }
       
       jniWorker->className = jk2_map_getStrProp( env, props, "worker",
  -                                              pThis->name,
  -                                              "class", JAVA_BRIDGE_CLASS_NAME);
  -
  +                                               _this->name,
  +                                               "class", JAVA_BRIDGE_CLASS_NAME);
  +    
       jniWorker->tomcat_cmd_line = jk2_map_getStrProp( env, props, "worker",
  -                                                    pThis->name,
  +                                                    _this->name,
                                                       "cmd_line", NULL ); 
   
       jniWorker->stdout_name= jk2_map_getStrProp( env, props, "worker",
  -                                               pThis->name, "stdout", NULL ); 
  +                                               _this->name, "stdout", NULL ); 
       jniWorker->stderr_name= jk2_map_getStrProp( env, props, "worker",
  -                                               pThis->name, "stderr", NULL );
  +                                               _this->name, "stderr", NULL );
       
       env->l->jkLog(env, env->l, JK_LOG_INFO,
                     "jni.validate() cmd: %s %s %s %s\n",
  @@ -198,7 +222,7 @@
   
       if( jniWorker->jk_java_bridge_class == NULL ) {
           env->l->jkLog(env, env->l, JK_LOG_EMERG,
  -                      "Can't find class %s in %s\n", str_config,
  +                      "Can't find class %s in %s\n", jniWorker->className,
                         jniWorker->vm->tomcat_classpath );
           /* [V] the detach here may segfault on 1.1 JVM... */
           jniWorker->vm->detach(env,  jniWorker->vm);
  @@ -220,28 +244,9 @@
       env->l->jkLog(env, env->l, JK_LOG_INFO, 
                     "jni.validate() ok\n");
   
  -    return JK_TRUE;
  -}
   
  -static int JK_METHOD jk2_jni_worker_init(jk_env_t *env, jk_worker_t *_this,
  -                                         jk_map_t *props, jk_workerEnv_t *we)
  -{
  -    jni_worker_data_t *jniWorker;
  -    JNIEnv *jniEnv;
  -    jstring cmd_line = NULL;
  -    jstring stdout_name = NULL;
  -    jstring stderr_name = NULL;
  -    jint rc = 0;
  -    
  -
  -    if(! _this || ! _this->worker_private) {
  -        env->l->jkLog(env, env->l, JK_LOG_EMERG,
  -                      "In init, assert failed - invalid parameters\n");
  -        return JK_FALSE;
  -    }
  -
  -    jniWorker = _this->worker_private;
   
  +    
       if(_this->workerEnv->vm != NULL ) {
           env->l->jkLog(env, env->l, JK_LOG_DEBUG,
                         "jni.init(), done (been here!)\n");
  @@ -391,7 +396,7 @@
       jniData->stdout_name           = NULL;
       jniData->stderr_name           = NULL;
   
  -    _this->validate       = jk2_jni_worker_validate;
  +    _this->setProperty       = jk2_jni_worker_setProperty;
       _this->init           = jk2_jni_worker_init;
       _this->destroy        = jk2_jni_worker_destroy;
       _this->service = jk2_jni_worker_service;
  
  
  
  1.4       +0 -1      jakarta-tomcat-connectors/jk/native2/common/jk_worker_run.c
  
  Index: jk_worker_run.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_run.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jk_worker_run.c	21 Feb 2002 11:13:59 -0000	1.3
  +++ jk_worker_run.c	2 Mar 2002 06:13:42 -0000	1.4
  @@ -133,7 +133,6 @@
       _this->lb_workers     = NULL;
       _this->num_of_workers = 0;
       _this->worker_private = NULL;
  -    _this->validate       = NULL;
       _this->init           = NULL;
       _this->destroy        = NULL;
       _this->service        = jk2_worker_run_service;
  
  
  
  1.8       +1 -1      jakarta-tomcat-connectors/jk/native2/common/jk_worker_status.c
  
  Index: jk_worker_status.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_status.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- jk_worker_status.c	1 Mar 2002 00:45:58 -0000	1.7
  +++ jk_worker_status.c	2 Mar 2002 06:13:42 -0000	1.8
  @@ -305,7 +305,7 @@
       _this->num_of_workers = 0;
       _this->worker_private = NULL;
       
  -    _this->validate       = NULL;
  +    _this->setProperty       = NULL;
       _this->init           = NULL;
       _this->destroy        = NULL;
       
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message