costin 2003/02/27 21:05:03 Modified: jk/native2/common jk_config_file.c jk_channel_socket.c Log: Added few more getters and setters. I'll go over all the components and add more after I finish the java side ( that will query and represent the Apache-side as regular mbeans ) ( I had some of this on my computer for a while - I want to get it off my list ) Revision Changes Path 1.8 +21 -0 jakarta-tomcat-connectors/jk/native2/common/jk_config_file.c Index: jk_config_file.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_config_file.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- jk_config_file.c 4 Feb 2003 07:39:59 -0000 1.7 +++ jk_config_file.c 28 Feb 2003 05:05:03 -0000 1.8 @@ -381,6 +381,24 @@ return JK_OK; } +/** Get a property for this config object + */ +static void * JK_METHOD jk2_config_file_getAttribute( struct jk_env *env, struct jk_bean *mbean, + char *name) +{ + jk_config_t *cfg=mbean->object; + + if( strcmp( name, "file" )==0 ) { + return cfg->file; + } else if( strcmp( name, "ver" )==0 ) { + return 0; + } else { + return ""; + } +} + +static char *myGetAttInfo[]={ "ver", "file", NULL }; +static char *mySetAttInfo[]={ "ver", "file", "save", NULL }; int JK_METHOD jk2_config_file_factory( jk_env_t *env, jk_pool_t *pool, jk_bean_t *result, @@ -393,6 +411,8 @@ return JK_ERR; _this->pool = pool; + result->getAttributeInfo = myGetAttInfo; + result->setAttributeInfo = mySetAttInfo; _this->ver=0; _this->setPropertyString=jk2_config_setPropertyString; @@ -406,6 +426,7 @@ result->object=_this; result->setAttribute=jk2_config_file_setAttribute; + result->getAttribute=jk2_config_file_getAttribute; _this->mbean=result; return JK_OK; 1.48 +18 -3 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.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- jk_channel_socket.c 4 Feb 2003 07:39:59 -0000 1.47 +++ jk_channel_socket.c 28 Feb 2003 05:05:03 -0000 1.48 @@ -114,6 +114,7 @@ jk_endpoint_t *endpoint); static char *jk2_channel_socket_multiValueInfo[]={"group", NULL }; +static char *jk2_channel_socket_getAttributeInfo[]={"name", NULL }; static char *jk2_channel_socket_setAttributeInfo[]={"host", "port", "route", "lb_factor", "level", NULL }; @@ -124,10 +125,10 @@ jk_channel_t *ch=(jk_channel_t *)mbean->object; char *value=(char *)valueP; jk_channel_socket_private_t *socketInfo= - (jk_channel_socket_private_t *)(ch->_privatePtr); + (jk_channel_socket_private_t *)(ch->_privatePtr); if( strcmp( "host", name ) == 0 ) { - socketInfo->host=value; + socketInfo->host=value; } else if( strcmp( "port", name ) == 0 ) { socketInfo->port=atoi( value ); } else if( strcmp( "keepalive", name ) == 0 ) { @@ -142,6 +143,19 @@ return JK_OK; } +static void * JK_METHOD jk2_channel_socket_getAttribute(jk_env_t *env, jk_bean_t *bean, + char *name ) +{ + jk_channel_t *ch=(jk_channel_t *)bean->object; + jk_channel_socket_private_t *socketInfo= + (jk_channel_socket_private_t *)(ch->_privatePtr); + + if( strcmp( name, "name" )==0 ) { + return bean->name; + } + return NULL; +} + /** resolve the host IP ( jk_resolve ) and initialize the channel. */ static int JK_METHOD jk2_channel_socket_init(jk_env_t *env, @@ -652,9 +666,10 @@ ch->is_stream=JK_TRUE; result->setAttribute= jk2_channel_socket_setAttribute; + result->getAttribute= jk2_channel_socket_getAttribute; result->init= jk2_channel_socket_init; - /*result->getAttributeInfo=jk2_channel_socket_getAttributeInfo;*/ + result->getAttributeInfo=jk2_channel_socket_getAttributeInfo; result->multiValueInfo=jk2_channel_socket_multiValueInfo; result->setAttributeInfo=jk2_channel_socket_setAttributeInfo;
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]