costin      02/05/03 10:37:35

  Modified:    jk/native2/common jk_worker_status.c
  Log:
  Better organization, make the worker status the first on the page.
  
  See also the changes in jk_worker_ajp, now informations about lb status
  and number of requests/err will be easy accessible.
  
  Revision  Changes    Path
  1.16      +101 -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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- jk_worker_status.c        2 May 2002 03:13:05 -0000       1.15
  +++ jk_worker_status.c        3 May 2002 17:37:35 -0000       1.16
  @@ -95,6 +95,99 @@
   
   }
   
  +static void jk2_worker_status_displayRuntimeWorkers(jk_env_t *env, jk_ws_service_t 
*s,
  +                                                       jk_workerEnv_t *wenv)
  +{
  +    jk_map_t *map=wenv->initData;
  +    int i;
  +    int needHeader=JK_TRUE;
  +
  +    s->jkprintf(env, s, "<H3>Worker runtime info</H3>\n");
  +    s->jkprintf(env, s, "<p>Worker information, using getAttribute() </p>\n");
  +
  +    s->jkprintf(env, s, "<table border>\n");
  +    for( i=0; i < env->_objects->size( env, env->_objects ); i++ ) {
  +        char *name=env->_objects->nameAt( env, env->_objects, i );
  +        jk_bean_t *mbean=env->_objects->valueAt( env, env->_objects, i );
  +        int j;
  +        int propCount;
  +
  +        /* Don't display aliases */
  +        if( strchr(name, ':')==NULL )
  +            continue;
  +        
  +        if( mbean==NULL || mbean->getAttributeInfo==NULL ) 
  +            continue;
  +
  +        if( mbean->getAttribute == NULL )
  +            continue;
  +
  +        if( strncmp( "ajp13", mbean->type, 5 ) != 0 )
  +            continue;
  +
  +        if( needHeader ) {
  +            s->jkprintf(env, s, "<tr><th>name</th>\n");
  +            for( j=0; mbean->getAttributeInfo[j] != NULL; j++ ) {
  +                char *pname=mbean->getAttributeInfo[j];
  +                
  +                s->jkprintf(env, s, "<th>%s</th>", pname );
  +            }
  +            needHeader = JK_FALSE;
  +        } 
  +        
  +        s->jkprintf(env, s, "</tr><tr><td>%s</td>\n", mbean->localName);
  +        for( j=0; mbean->getAttributeInfo[j] != NULL; j++ ) {
  +            char *pname=mbean->getAttributeInfo[j];
  +            
  +            s->jkprintf(env, s, "<td>%s</td>",
  +                        mbean->getAttribute( env, mbean, pname));
  +        }
  +    }
  +    s->jkprintf( env,s , "</table>\n" );
  +}
  +
  +static void jk2_worker_status_displayRuntimeUris(jk_env_t *env, jk_ws_service_t *s,
  +                                                       jk_workerEnv_t *wenv)
  +{
  +    jk_map_t *map=wenv->initData;
  +    int i;
  +
  +    s->jkprintf(env, s, "<H3>URI info</H3>\n");
  +    s->jkprintf(env, s, "<p>Information about uri mappings. "
  +                "Will include some statistics ( for the active process )</p>\n");
  +    s->jkprintf(env, s, "<table border>\n");
  +    s->jkprintf(env, s, "<tr><th>Name</th><th>Value</td></tr>\n");
  +    for( i=0; i < env->_objects->size( env, env->_objects ); i++ ) {
  +        char *name=env->_objects->nameAt( env, env->_objects, i );
  +        jk_bean_t *mbean=env->_objects->valueAt( env, env->_objects, i );
  +        int j;
  +        int propCount;
  +
  +        /* Don't display aliases */
  +        if( strchr(name, ':')==NULL )
  +            continue;
  +        
  +        if( mbean==NULL || mbean->getAttributeInfo==NULL ) 
  +            continue;
  +
  +        if( mbean->getAttribute == NULL )
  +            continue;
  +
  +        if( strncmp( "uri", mbean->type, 3 ) != 0 )
  +            continue;
  +        
  +        for( j=0; mbean->getAttributeInfo[j] != NULL; j++ ) {
  +            char *pname=mbean->getAttributeInfo[j];
  +            
  +            
  +            s->jkprintf(env, s, "<tr><td>%s</td><td>%s</td><td>%s</td></tr>",
  +                        mbean->localName, pname,
  +                        mbean->getAttribute( env, mbean, pname));
  +        }
  +    }
  +    s->jkprintf( env,s , "</table>\n" );
  +}
  +
   static void jk2_worker_status_displayRuntimeProperties(jk_env_t *env, 
jk_ws_service_t *s,
                                                          jk_workerEnv_t *wenv)
   {
  @@ -122,6 +215,11 @@
           if( mbean->getAttribute == NULL )
               continue;
   
  +        if( strncmp( "uri", mbean->type, 3 ) == 0  ||
  +            strncmp( "ajp13", mbean->type, 5 ) == 0 ) {
  +            continue;
  +        }
  +        
           for( j=0; mbean->getAttributeInfo[j] != NULL; j++ ) {
               char *pname=mbean->getAttributeInfo[j];
               
  @@ -200,9 +298,11 @@
       }
       
       /* Body */
  +    jk2_worker_status_displayRuntimeWorkers(env, s, s->workerEnv );
  +    jk2_worker_status_displayRuntimeUris(env, s, s->workerEnv );
       jk2_worker_status_displayConfigProperties(env, s, s->workerEnv );
  -    jk2_worker_status_displayActiveProperties(env, s, s->workerEnv );
       jk2_worker_status_displayRuntimeProperties(env, s, s->workerEnv );
  +    jk2_worker_status_displayActiveProperties(env, s, s->workerEnv );
       
       s->afterRequest( env, s);
       return JK_OK;
  
  
  

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

Reply via email to