costin      2002/06/10 16:57:24

  Modified:    jk/native2/common jk_channel_jni.c
  Log:
  Remove the dispatch ( which remains to be used only for incoming AJP messages,
  until we finish merging the 2 mechanisms ).
  
  Invoke() will be used instead - that's the new mechanism, used to support
  all new jk components.
  
  Revision  Changes    Path
  1.27      +24 -20    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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- jk_channel_jni.c  10 Jun 2002 21:55:06 -0000      1.26
  +++ jk_channel_jni.c  10 Jun 2002 23:57:24 -0000      1.27
  @@ -503,22 +503,6 @@
       return JK_OK;
   }
   
  -/** Called by java. Will take the rest of the message and dispatch again to the 
real target.
  - */
  -static int JK_METHOD jk2_channel_jni_dispatch(jk_env_t *env, void *target, 
jk_endpoint_t *ep, jk_msg_t *msg)
  -{
  -    jk_bean_t *jniChB=(jk_bean_t *)target;
  -    jk_channel_t *jniCh=(jk_channel_t *)jniChB->object;
  -    int code;
  -    
  -    if( jniCh->mbean->debug > 0 )
  -        env->l->jkLog(env, env->l, JK_LOG_INFO,"channelJni.java2cInvoke() ok\n");
  -
  -    code = (int)msg->getByte(env, msg);
  -    return ep->worker->workerEnv->dispatch( env, ep->worker->workerEnv,
  -                                            ep->currentRequest, ep, code, ep->reply 
);
  -}
  -
   static int JK_METHOD jk2_channel_jni_setProperty(jk_env_t *env,
                                                       jk_bean_t *mbean, 
                                                       char *name, void *valueP)
  @@ -542,6 +526,29 @@
       return JK_OK;
   }
   
  +/** Called by java. Will take the msg and dispatch it to workerEnv, as if it would
  + *  be if received via socket
  + */
  +int JK_METHOD jk2_channel_jni_invoke(jk_env_t *env, jk_bean_t *bean, jk_endpoint_t 
*ep, int code,
  +                                     jk_msg_t *msg, int raw)
  +{
  +    jk_channel_t *ch=(jk_channel_t *)bean->object;
  +    int rc=JK_OK;
  +
  +    if( ch->mbean->debug > 0 )
  +        env->l->jkLog(env, env->l, JK_LOG_INFO, 
  +                      "ch.%d() \n", code);
  +    
  +    code = (int)msg->getByte(env, msg);
  +
  +    if( ch->mbean->debug > 0 )
  +        env->l->jkLog(env, env->l, JK_LOG_INFO,"channelJni.java2cInvoke() %d\n", 
code);
  +
  +    return ep->worker->workerEnv->dispatch( env, ep->worker->workerEnv,
  +                                            ep->currentRequest, ep, code, ep->reply 
);
  +}
  +
  +
   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)
  @@ -576,10 +583,7 @@
       ch->workerEnv=wEnv;
       wEnv->addChannel( env, wEnv, ch );
   
  -    wEnv->registerHandler( env, wEnv, type,
  -                           "sendResponse", JK_HANDLE_JNI_DISPATCH,
  -                           jk2_channel_jni_dispatch, NULL );
  -
  +    result->invoke=jk2_channel_jni_invoke;
       
       return JK_OK;
   }
  
  
  

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

Reply via email to