Author: mturk
Date: Tue Nov 15 12:27:45 2011
New Revision: 1202155
URL: http://svn.apache.org/viewvc?rev=1202155&view=rev
Log:
Use the same signature and default values for Start and Stop class and method.
Modified:
commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
commons/proper/daemon/trunk/src/native/windows/include/apxwin.h
commons/proper/daemon/trunk/src/native/windows/src/utils.c
commons/proper/daemon/trunk/src/site/xdoc/procrun.xml
Modified: commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
URL:
http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c?rev=1202155&r1=1202154&r2=1202155&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
(original)
+++ commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c Tue
Nov 15 12:27:45 2011
@@ -1420,7 +1420,8 @@ void WINAPI serviceMain(DWORD argc, LPTS
apxStrCharReplaceA(_jni_sclass, '.', '/');
}
else {
- _jni_sclass = WideToANSI(L"java/lang/System");
+ /* Defaults to Main */
+ _jni_sclass = WideToANSI(L"Main");
}
_jni_sparam = SO_STOPPARAMS;
}
@@ -1466,9 +1467,9 @@ void WINAPI serviceMain(DWORD argc, LPTS
if (IS_VALID_STRING(SO_CLASSPATH))
_jni_classpath = WideToANSI(SO_CLASSPATH);
if (IS_VALID_STRING(SO_STARTMETHOD))
- _jni_rmethod = WideToAscii(SO_STARTMETHOD,
(LPSTR)SO_STARTMETHOD);
+ _jni_rmethod = WideToANSI(SO_STARTMETHOD);
if (IS_VALID_STRING(SO_STOPMETHOD))
- _jni_smethod = WideToAscii(SO_STOPMETHOD, (LPSTR)SO_STOPMETHOD);
+ _jni_smethod = WideToANSI(SO_STOPMETHOD);
_jni_jvmoptions = MzWideToANSI(SO_JVMOPTIONS);
}
if (_service_mode) {
Modified: commons/proper/daemon/trunk/src/native/windows/include/apxwin.h
URL:
http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/include/apxwin.h?rev=1202155&r1=1202154&r2=1202155&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/include/apxwin.h (original)
+++ commons/proper/daemon/trunk/src/native/windows/include/apxwin.h Tue Nov 15
12:27:45 2011
@@ -145,10 +145,7 @@ typedef enum {
APX_OSLEVEL apxGetOsLevel();
LPWSTR AsciiToWide(LPCSTR s, LPWSTR ws);
-LPSTR WideToAscii(LPCWSTR ws, LPSTR s);
LPSTR MzWideToAscii(LPCWSTR ws, LPSTR s);
-LPSTR WideToUTF8(LPCWSTR ws);
-LPSTR MzWideToUTF8(LPCWSTR ws);
LPSTR WideToANSI(LPCWSTR ws);
LPSTR MzWideToANSI(LPCWSTR ws);
Modified: commons/proper/daemon/trunk/src/native/windows/src/utils.c
URL:
http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/src/utils.c?rev=1202155&r1=1202154&r2=1202155&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/src/utils.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/src/utils.c Tue Nov 15
12:27:45 2011
@@ -147,46 +147,6 @@ LPWSTR AsciiToWide(LPCSTR s, LPWSTR ws)
return pszSave;
}
-LPSTR WideToAscii(LPCWSTR ws, LPSTR s)
-{
- LPSTR pszSave = s;
-
- if (!ws) {
- *s = '\0';
- return pszSave;
- }
- do {
- *s++ = (CHAR)*ws;
- } while( *ws++);
- return pszSave;
-}
-
-LPSTR WideToUTF8(LPCWSTR ws)
-{
-
- LPSTR s;
- int cch = WideCharToMultiByte(CP_UTF8, 0, ws, -1, NULL, 0, NULL, NULL);
- s = (LPSTR)apxAlloc(cch);
- if (!WideCharToMultiByte(CP_UTF8, 0, ws, -1, s, cch, NULL, NULL)) {
- apxFree(s);
- return NULL;
- }
- return s;
-}
-
-LPWSTR UTF8ToWide(LPCSTR cs)
-{
-
- LPWSTR s;
- int cch = MultiByteToWideChar(CP_UTF8, 0, cs, -1, NULL, 0);
- s = (LPWSTR)apxAlloc(cch * sizeof(WCHAR));
- if (!MultiByteToWideChar(CP_UTF8, 0, cs, -1, s, cch)) {
- apxFree(s);
- return NULL;
- }
- return s;
-}
-
LPSTR WideToANSI(LPCWSTR ws)
{
@@ -229,38 +189,6 @@ LPSTR MzWideToAscii(LPCWSTR ws, LPSTR s)
return pszSave;
}
-LPSTR MzWideToUTF8(LPCWSTR ws)
-{
- LPSTR str;
- LPSTR s;
- LPCWSTR p = ws;
- int cch = 0;
-
- for ( ; p && *p; p++) {
- int len = WideCharToMultiByte(CP_UTF8, 0, p, -1, NULL, 0, NULL, NULL);
- if (len > 0)
- cch += len;
- while (*p)
- p++;
- }
- cch ++;
- str = s = (LPSTR)apxAlloc(cch + 1);
-
- p = ws;
- for ( ; p && *p; p++) {
- int len = WideCharToMultiByte(CP_UTF8, 0, p, -1, s, cch, NULL, NULL);
- if (len > 0) {
- s = s + len;
- cch -= len;
- }
- while (*p)
- p++;
- }
- /* double terminate */
- *s = '\0';
- return str;
-}
-
LPSTR MzWideToANSI(LPCWSTR ws)
{
LPSTR str;
Modified: commons/proper/daemon/trunk/src/site/xdoc/procrun.xml
URL:
http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/site/xdoc/procrun.xml?rev=1202155&r1=1202154&r2=1202155&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/site/xdoc/procrun.xml (original)
+++ commons/proper/daemon/trunk/src/site/xdoc/procrun.xml Tue Nov 15 12:27:45
2011
@@ -373,7 +373,7 @@ then it is treated the same as <b>--</b>
</tr>
<tr>
<td>--StartClass</td>
- <td></td>
+ <td>Main</td>
<td>Class that contains the startup method.
Applies to the <b>jvm</b> and <b>Java</b> modes. (Not used in <b>exe</b>
mode.)
</td>
@@ -414,12 +414,9 @@ then it is treated the same as <b>--</b>
</tr>
<tr>
<td>--StopClass</td>
- <td></td>
+ <td>Main</td>
<td>Class that will be used on Stop service signal.
Applies to the <b>jvm</b> and <b>Java</b> modes.
- <br />
- <b>Note:</b> if <code>undefined</code> it defaults to
<code>java.lang.System</code> in
- which case <b>StopMethod</b> is set to <code>exit</code>.
</td>
</tr>
<tr>