|
From: Ashish G. <as...@se...> - 2003-01-30 02:00:08
|
Leif Mortenson wrote: > >> This does sound like a very very good option. If something like this >> is present, it will >> help us a lot :) > > > Ok, I posted a feature request to track this feature: > http://sourceforge.net/tracker/index.php?func=detail&aid=676599&group_id=39428&atid=425190 > Read it over and post any comments if you would like to see things > done any differently. > > Cheers, > Leif > > > Hi Leif, I am having the following patch to do the feature, please let me know if this is okay (esp the methods wrapperRestartProcess() and wrapperStopProces()). Thank you very much, Ashish ------------------------ + const char * prop; + const char * value; + char paramBuffer[128]; + int i = 0; + if (jvmOut != -1) { while (1) { @@ -376,6 +381,34 @@ if (bytesRead <= 0) { break; } + do { + sprintf(paramBuffer, "wrapper.filter.trigger.%d", i + 1); + prop = getStringProperty(properties, paramBuffer, NULL); + if (prop) { + if (strlen(prop) > 0) { + if (strstr(readBuf, prop)) + { + sprintf(paramBuffer, "wrapper.filter.action.%d", i + 1); + value = getStringProperty(properties, paramBuffer, NULL); + if (value) { + if (strlen(value) > 0) { + if (strcasecmp(value,"SHUTDOWN") == 0) + { + wrapperStopRequested(1); + } + else if (strcasecmp(value,"RESTART") == 0) + { + wrapperRestartProcess(); + usleep(1000000); /* sleep 1 sec */ + } + } + } + } + } + } + ++i; + }while (prop); + |