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/server/apache2 mod_jk2.c
Date Tue, 08 Apr 2003 04:01:19 GMT
costin      2003/04/07 21:01:19

  Modified:    jk/native2/server/apache2 mod_jk2.c
  Log:
  Add another option - so we don't have to mangle the names.
  
  JkSet2 COMPONENT_NAME PROPERTY VALUE
  
  Revision  Changes    Path
  1.60      +52 -2     jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c
  
  Index: mod_jk2.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- mod_jk2.c	4 Mar 2003 07:19:31 -0000	1.59
  +++ mod_jk2.c	8 Apr 2003 04:01:19 -0000	1.60
  @@ -141,6 +141,53 @@
       return NULL;
   }
   
  +/*
  + * JkSet2 oname property value
  + *
  + * Set jk options. 
  + */
  +static const char *jk2_set3(cmd_parms *cmd,void *per_dir,
  +                            const char *name, char *property, char *value)
  +{
  +    server_rec *s = cmd->server;
  +    jk_uriEnv_t *serverEnv=(jk_uriEnv_t *)
  +        ap_get_module_config(s->module_config, &jk2_module);
  +    jk_env_t *env=workerEnv->globalEnv;
  +    int rc;
  +    jk_bean_t *mbean;
  +
  +    if( name == NULL || property==NULL || value==NULL ) {
  +        ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, cmd->temp_pool,
  +                      "mod_jk2: Null option in JkSet2\n");
  +        return NULL;
  +    }
  +    
  +    mbean=env->getBean( env, name );
  +    if( mbean==NULL ) {
  +        ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, cmd->temp_pool,
  +                      "mod_jk2: Creating object %s\n", name );
  +        mbean=env->createBean( env, workerEnv->config->pool, name );
  +    }
  +
  +    if( mbean == NULL ) {
  +        /* Can't create it, save the value in our map */
  +        workerEnv->config->setProperty( env, workerEnv->config, workerEnv->config->mbean,
name, value );
  +        return NULL;
  +    }
  +
  +    if( mbean->settings == NULL )
  +        jk2_map_default_create(env, &mbean->settings, workerEnv->config->pool);
  +    
  +    rc=workerEnv->config->setProperty( env, workerEnv->config, mbean, property,
value );
  +
  +    if (rc!=JK_OK) {
  +        ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, cmd->temp_pool,
  +                      "mod_jk2: Unrecognized option %s %s %s\n", name, property, value);
  +    }
  +
  +    return NULL;
  +}
  +
   /**
    * Set a property associated with a URI, using native <Location> 
    * directives.
  @@ -189,7 +236,10 @@
           */
       AP_INIT_TAKE2(
           "JkSet", jk2_set2, NULL, RSRC_CONF,
  -        "Set a jk property, same syntax and rules as in JkWorkersFile"),
  +        "Set a jk property, 2 parameters - objectName.property value"),
  +    AP_INIT_TAKE3(
  +        "JkSet2", jk2_set3, NULL, RSRC_CONF,
  +        "Set a jk property, 3 parameters - objectName property value"),
       AP_INIT_TAKE2(
           "JkUriSet", jk2_uriSet, NULL, ACCESS_CONF,
           "Defines a jk property associated with a Location"),
  
  
  

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


Mime
View raw message