costin      02/03/18 10:25:05

  Modified:    jk/native2/common jk_channel_apr_socket.c jk_channel_jni.c
                        jk_channel_socket.c
  Log:
  Update the config of channels.
  
  Revision  Changes    Path
  1.4       +12 -27    
jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c
  
  Index: jk_channel_apr_socket.c
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jk_channel_apr_socket.c   2 Mar 2002 06:07:48 -0000       1.3
  +++ jk_channel_apr_socket.c   18 Mar 2002 18:25:05 -0000      1.4
  @@ -119,10 +119,6 @@
     XXX We could also use properties or 'notes'
   */
   
  -int JK_METHOD jk2_channel_socket_factory(jk_env_t *env, jk_pool_t *pool,
  -                                         void **result,
  -                                         const char *type, const char *name);
  -
   static int JK_METHOD jk2_channel_socket_resolve(jk_env_t *env, char *host,
                                                   short port,
                                                   jk_channel_socket_private_t *rc);
  @@ -130,17 +126,13 @@
   static int JK_METHOD jk2_channel_socket_close(jk_env_t *env, jk_channel_t *_this,
                                                 jk_endpoint_t *endpoint);
   
  -static int JK_METHOD jk2_channel_socket_getProperty(jk_env_t *env,
  -                                                    jk_channel_t *_this, 
  -                                                    char *name, char **value)
  -{
  -    return JK_FALSE;
  -}
   
   static int JK_METHOD jk2_channel_socket_setProperty(jk_env_t *env,
  -                                                   jk_channel_t *_this, 
  -                                                   char *name, char *value)
  +                                                    jk_bean_t *mbean, 
  +                                                    char *name, void *valueP)
   {
  +    jk_channel_t *_this=(jk_channel_t *)mbean->object;
  +    char *value=valueP;
       jk_channel_socket_private_t *socketInfo=
           (jk_channel_socket_private_t *)(_this->_privatePtr);
   
  @@ -178,7 +170,7 @@
       }
       env->l->jkLog(env, env->l, JK_LOG_INFO,
                     "channel_socket.init(): %s:%d for %s\n", host,
  -                  port, _this->worker->name );
  +                  port, _this->worker->mbean->name );
   
       return rc;
   }
  @@ -524,17 +516,12 @@
   
   
   int JK_METHOD jk2_channel_apr_socket_factory(jk_env_t *env,
  -                                        jk_pool_t *pool, 
  -                                        void **result,
  -                                        const char *type, const char *name)
  +                                             jk_pool_t *pool, 
  +                                             jk_bean_t *result,
  +                                             const char *type, const char *name)
   {
       jk_channel_t *_this;
       
  -    if( strcmp( "channel", type ) != 0 ) {
  -        /* Wrong type  XXX throw */
  -        *result=NULL;
  -        return JK_FALSE;
  -    }
       _this=(jk_channel_t *)pool->calloc(env, pool, sizeof( jk_channel_t));
       
       _this->_privatePtr= (jk_channel_socket_private_t *)
  @@ -545,13 +532,11 @@
       _this->init= jk2_channel_socket_init; 
       _this->open= jk2_channel_socket_open; 
       _this->close= jk2_channel_socket_close; 
  -    /*     _this->getProperty= jk2_channel_socket_getProperty;  */
  -    _this->setProperty= jk2_channel_socket_setProperty; 
  -
  -    _this->name="aprSocket";
  -
  -    *result= _this;
       _this->is_stream=JK_TRUE;
  +
  +    result->setAttribute= jk2_channel_socket_setProperty; 
  +    _this->mbean=result;
  +    result->object= _this;
       
       return JK_TRUE;
   }
  
  
  
  1.5       +12 -23    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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- jk_channel_jni.c  2 Mar 2002 06:07:48 -0000       1.4
  +++ jk_channel_jni.c  18 Mar 2002 18:25:05 -0000      1.5
  @@ -99,14 +99,10 @@
   } jk_ch_jni_ep_private_t;
   
   
  -int JK_METHOD jk2_channel_jni_factory(jk_env_t *env, jk_pool_t *pool,
  -                                      void **result,
  -                                      const char *type, const char *name);
  -
   
   static int JK_METHOD jk2_channel_jni_setProperty(jk_env_t *env,
  -                                                   jk_channel_t *_this, 
  -                                                   char *name, char *value)
  +                                                 jk_bean_t *mbean, 
  +                                                 char *name, void *value)
   {
       return JK_TRUE;
   }
  @@ -119,7 +115,7 @@
          have it.
       */
       env->l->jkLog(env, env->l, JK_LOG_INFO,"channel_jni.init():  %s\n", 
  -                  _this->worker->name );
  +                  _this->worker->mbean->name );
   
       return JK_TRUE;
   }
  @@ -592,22 +588,15 @@
   
   
   
  -int JK_METHOD jk2_channel_jni_factory(jk_env_t *env,
  -                                     jk_pool_t *pool, 
  -                                     void **result,
  -                                     const char *type, const char *name)
  -{
  -    jk_channel_t *_this;
  -    
  -    if( strcmp( "channel", type ) != 0 ) {
  -     /* Wrong type  XXX throw */
  -     *result=NULL;
  -     return JK_FALSE;
  -    }
  +int JK_METHOD jk2_channel_jni_factory(jk_env_t *env, jk_pool_t *pool, 
  +                                      jk_bean_t *result,
  +                                      const char *type, const char *name)
  +{
  +    jk_channel_t *_this=result->object;
  +    
       _this=(jk_channel_t *)pool->calloc(env, pool, sizeof( jk_channel_t));
       
       _this->recv= jk2_channel_jni_recv;
  -    _this->setProperty= jk2_channel_jni_setProperty; 
       _this->send= jk2_channel_jni_send; 
       _this->init= jk2_channel_jni_init; 
       _this->open= jk2_channel_jni_open; 
  @@ -616,13 +605,13 @@
       _this->beforeRequest= jk2_channel_jni_beforeRequest;
       _this->afterRequest= jk2_channel_jni_afterRequest;
       
  -    _this->name="jni";
  -
       _this->_privatePtr=(jk_channel_jni_private_t *)pool->calloc(env, pool,
                       sizeof(jk_channel_jni_private_t));
       _this->is_stream=JK_FALSE;
       
  -    *result= _this;
  +    result->setAttribute= jk2_channel_jni_setProperty;
  +    _this->mbean=result;
  +    result->object= _this;
       
       return JK_TRUE;
   }
  
  
  
  1.15      +14 -29    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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- jk_channel_socket.c       2 Mar 2002 06:07:48 -0000       1.14
  +++ jk_channel_socket.c       18 Mar 2002 18:25:05 -0000      1.15
  @@ -110,10 +110,6 @@
     XXX We could also use properties or 'notes'
   */
   
  -int JK_METHOD jk2_channel_socket_factory(jk_env_t *env, jk_pool_t *pool,
  -                                        void **result,
  -                                     const char *type, const char *name);
  -
   static int JK_METHOD jk2_channel_socket_resolve(jk_env_t *env, char *host,
                                                  short port,
                                                  struct sockaddr_in *rc);
  @@ -121,17 +117,12 @@
   static int JK_METHOD jk2_channel_socket_close(jk_env_t *env, jk_channel_t *_this,
                                                jk_endpoint_t *endpoint);
   
  -static int JK_METHOD jk2_channel_socket_getProperty(jk_env_t *env,
  -                                                   jk_channel_t *_this, 
  -                                                   char *name, char **value)
  -{
  -    return JK_FALSE;
  -}
  -
  -static int JK_METHOD jk2_channel_socket_setProperty(jk_env_t *env,
  -                                                   jk_channel_t *_this, 
  -                                                   char *name, char *value)
  +static int jk2_channel_socket_setAttribute(jk_env_t *env,
  +                                           jk_bean_t *mbean,
  +                                           char *name, void *valueP)
   {
  +    jk_channel_t *_this=(jk_channel_t *)mbean->object;
  +    char *value=(char *)valueP;
       jk_channel_socket_private_t *socketInfo=
        (jk_channel_socket_private_t *)(_this->_privatePtr);
   
  @@ -169,7 +160,7 @@
       }
       env->l->jkLog(env, env->l, JK_LOG_INFO,
                     "channel_socket.init(): %s:%d for %s\n", host,
  -                  port, _this->worker->name );
  +                  port, _this->worker->mbean->name );
       
       return rc;
   }
  @@ -456,17 +447,12 @@
   
   
   int JK_METHOD jk2_channel_socket_factory(jk_env_t *env,
  -                                        jk_pool_t *pool, 
  -                                        void **result,
  -                                     const char *type, const char *name)
  +                                         jk_pool_t *pool, 
  +                                         jk_bean_t *result,
  +                                         const char *type, const char *name)
   {
       jk_channel_t *_this;
       
  -    if( strcmp( "channel", type ) != 0 ) {
  -     /* Wrong type  XXX throw */
  -     *result=NULL;
  -     return JK_FALSE;
  -    }
       _this=(jk_channel_t *)pool->calloc(env, pool, sizeof( jk_channel_t));
       
       _this->_privatePtr= (jk_channel_socket_private_t *)
  @@ -477,14 +463,13 @@
       _this->init= jk2_channel_socket_init; 
       _this->open= jk2_channel_socket_open; 
       _this->close= jk2_channel_socket_close; 
  -/*         _this->getProperty= jk2_channel_socket_getProperty;  */
  -    _this->setProperty= jk2_channel_socket_setProperty; 
  -
  -    _this->name="file";
   
       _this->is_stream=JK_TRUE;
  -    
  -    *result= _this;
  +
  +
  +    result->setAttribute= jk2_channel_socket_setAttribute; 
  +    result->object= _this;
  +    _this->mbean=result;
       
       return JK_TRUE;
   }
  
  
  

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

Reply via email to