jsmooth-cvs Mailing List for JSmooth (Page 4)
Status: Beta
Brought to you by:
reyes
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(64) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(44) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(23) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(35) |
Mar
(75) |
Apr
(105) |
May
(89) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(12) |
Nov
|
Dec
|
2014 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Rodrigo R. <re...@us...> - 2007-05-17 10:56:52
|
Update of /cvsroot/jsmooth/jsmooth/sample In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14160/sample Modified Files: sample.jsmooth Log Message: adds the single instance feature Index: sample.jsmooth =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/sample/sample.jsmooth,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** sample.jsmooth 13 May 2007 20:07:43 -0000 1.13 --- sample.jsmooth 17 May 2007 10:56:15 -0000 1.14 *************** *** 1,5 **** <?xml version="1.0" encoding="ISO-8859-1"?> <jsmoothproject> - <JVMSearchPath>registry</JVMSearchPath> <JVMSearchPath>javahome</JVMSearchPath> <JVMSearchPath>jrepath</JVMSearchPath> --- 1,4 ---- *************** *** 7,11 **** <JVMSearchPath>exepath</JVMSearchPath> <JVMSearchPath>jview</JVMSearchPath> ! <arguments></arguments> <currentDirectory>..\classes</currentDirectory> <embeddedJar>true</embeddedJar> --- 6,10 ---- <JVMSearchPath>exepath</JVMSearchPath> <JVMSearchPath>jview</JVMSearchPath> ! <JVMSearchPath>registry</JVMSearchPath> <currentDirectory>..\classes</currentDirectory> <embeddedJar>true</embeddedJar> *************** *** 41,45 **** <maximumVersion></maximumVersion> <minimumVersion>1.3</minimumVersion> ! <skeletonName>Console Wrapper</skeletonName> <skeletonProperties> <key>Message</key> --- 40,44 ---- <maximumVersion></maximumVersion> <minimumVersion>1.3</minimumVersion> ! <skeletonName>Custom Web Download Wrapper</skeletonName> <skeletonProperties> <key>Message</key> *************** *** 48,57 **** </skeletonProperties> <skeletonProperties> ! <key>PressKey</key> ! <value>0</value> </skeletonProperties> <skeletonProperties> ! <key>Debug</key> <value>1</value> </skeletonProperties> </jsmoothproject> --- 47,64 ---- </skeletonProperties> <skeletonProperties> ! <key>DownloadURL</key> ! <value></value> </skeletonProperties> <skeletonProperties> ! <key>SingleProcess</key> <value>1</value> </skeletonProperties> + <skeletonProperties> + <key>Debug</key> + <value>0</value> + </skeletonProperties> + <skeletonProperties> + <key>SingleInstance</key> + <value>0</value> + </skeletonProperties> </jsmoothproject> |
From: Rodrigo R. <re...@us...> - 2007-05-17 10:56:35
|
Update of /cvsroot/jsmooth/jsmooth/src/locale In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14160/src/locale Modified Files: Texts.properties Texts_fr.properties Log Message: adds the single instance feature Index: Texts.properties =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/locale/Texts.properties,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Texts.properties 30 Apr 2007 20:57:08 -0000 1.14 --- Texts.properties 17 May 2007 10:56:19 -0000 1.15 *************** *** 96,100 **** SKEL_CUSTOMDOWNLOAD_PROPERTY_MESSAGE_DESCRIPTION=When no JVM is found in the target computer, the user is prompted with the message defined below. Then, the default browser is launched with the URL defined here. SKEL_CUSTOMDOWNLOAD_PROPERTY_MESSAGE_LABEL=Message ! SKEL_CUSTOMDOWNLOAD_PROPERTY_URL_DESCRIPTION=URL of a file to download and execute. It must start with http://..... SKEL_CUSTOMDOWNLOAD_PROPERTY_URL_LABEL=URL # --- 96,100 ---- SKEL_CUSTOMDOWNLOAD_PROPERTY_MESSAGE_DESCRIPTION=When no JVM is found in the target computer, the user is prompted with the message defined below. Then, the default browser is launched with the URL defined here. SKEL_CUSTOMDOWNLOAD_PROPERTY_MESSAGE_LABEL=Message ! SKEL_CUSTOMDOWNLOAD_PROPERTY_URL_DESCRIPTION=URL of a file to download and execute. It must start with http://, https://, or ftp://... SKEL_CUSTOMDOWNLOAD_PROPERTY_URL_LABEL=URL # *************** *** 151,152 **** --- 151,156 ---- </ul><h2>JSmooth Support</h2> \ Please submit any bug you may find to <a href="http://sourceforge.net/tracker/?group_id=86730">the jsmooth tracker</a>. Should you have any question, please use <a href="http://sourceforge.net/forum/?group_id=86730">the forum</a> (hosted at sourceforge's). + # + # + SKEL_GENERIC_SINGLEINSTANCE=Single instance + SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION=When this option is enabled, only one instance of the application can run at any time. <p> If the instance of the application is running, it is requested to bring its window (if any) to the front. Index: Texts_fr.properties =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/locale/Texts_fr.properties,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Texts_fr.properties 30 Apr 2007 20:57:08 -0000 1.9 --- Texts_fr.properties 17 May 2007 10:56:22 -0000 1.10 *************** *** 95,99 **** SKEL_CUSTOMDOWNLOAD_PROPERTY_MESSAGE_DESCRIPTION=Lorsqu'aucune JVM n'est trouvée sur l'ordinateur, l'utilisateur se voit proposer le téléchargement par le message défini ci-contre. SKEL_CUSTOMDOWNLOAD_PROPERTY_MESSAGE_LABEL=Message ! SKEL_CUSTOMDOWNLOAD_PROPERTY_URL_DESCRIPTION=URL d'un fichier à télécharger puis exécuter. Cette URL doit commencer par <tt>http://...</tt> SKEL_CUSTOMDOWNLOAD_PROPERTY_URL_LABEL=URL # --- 95,99 ---- SKEL_CUSTOMDOWNLOAD_PROPERTY_MESSAGE_DESCRIPTION=Lorsqu'aucune JVM n'est trouvée sur l'ordinateur, l'utilisateur se voit proposer le téléchargement par le message défini ci-contre. SKEL_CUSTOMDOWNLOAD_PROPERTY_MESSAGE_LABEL=Message ! SKEL_CUSTOMDOWNLOAD_PROPERTY_URL_DESCRIPTION=URL d'un fichier à télécharger puis exécuter. Cette URL doit commencer par http://, https://, ou ftp://... SKEL_CUSTOMDOWNLOAD_PROPERTY_URL_LABEL=URL # *************** *** 146,147 **** --- 146,153 ---- </ul><h2>Support utilisateurs</h2> \ Si vous rencontrez un bug, merci de le soumettre au <a href="http://sourceforge.net/tracker/?group_id=86730">tracker de jsmooth</a>. Si vous avez des questions sur l'utilisation de JSmooth, n'hésitez pas à utiliser <a href="http://sourceforge.net/forum/?group_id=86730">le forum</a> (anglais) sur sourceforge. + # + # + SKEL_GENERIC_SINGLEINSTANCE=Instance unique de l'application + SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION=Si cette option est activée, une seule instance de l'application peut être démarrée. <p> Si l'instance unique de l'application est déjà lancée, sa fenêtre (s'il y en a une) s'affiche au premier plan. + + When this option is enabled, only one instance of the application can run at any time. <p> If another application is running, it is requested to bring its window (if any) to the front. |
From: Rodrigo R. <re...@us...> - 2007-05-16 22:04:29
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/util-net In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18780 Modified Files: Makefile.win httpdownload.cpp httpdownload.h testmain.cpp Added Files: WinHttpClient.cpp WinHttpClient.h Log Message: added wininet download class Index: Makefile.win =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/util-net/Makefile.win,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.win 30 Apr 2007 20:54:32 -0000 1.4 --- Makefile.win 16 May 2007 22:04:19 -0000 1.5 *************** *** 10,15 **** FLTK-CXXFLAGS = $(shell fltk-config --cxxflags) RES = ! OBJ = HttpClient.o URL.o downloadgui.o httpdownload.o $(RES) ! LIBS = -L"$(MINGW)/lib" -L"/lib" -lws2_32 $(FLTK-LDFLAGS) CXXINCS = -Os -I"../util-core" -I"$(MINGW)/include/c++" -I"$(MINGW)/include/c++/mingw32" -I"$(MINGW)/include/c++/backward" -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" $(FLTK-CXXFLAGS) BIN = $(PROJECTNAME).a --- 10,15 ---- FLTK-CXXFLAGS = $(shell fltk-config --cxxflags) RES = ! OBJ = WinHttpClient.o HttpClient.o URL.o downloadgui.o httpdownload.o $(RES) ! LIBS = -L"$(MINGW)/lib" -L"/lib" -lws2_32 -lwininet $(FLTK-LDFLAGS) CXXINCS = -Os -I"../util-core" -I"$(MINGW)/include/c++" -I"$(MINGW)/include/c++/mingw32" -I"$(MINGW)/include/c++/backward" -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" $(FLTK-CXXFLAGS) BIN = $(PROJECTNAME).a Index: httpdownload.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/util-net/httpdownload.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** httpdownload.cpp 28 Apr 2007 08:49:33 -0000 1.3 --- httpdownload.cpp 16 May 2007 22:04:19 -0000 1.4 *************** *** 26,30 **** Fl_Window *httpWindow ; ! HttpClient httpClient; char downloadLabel[256]; unsigned long downloadThread; --- 26,30 ---- Fl_Window *httpWindow ; ! WinHttpClient httpClient; char downloadLabel[256]; unsigned long downloadThread; *************** *** 42,45 **** --- 42,47 ---- sprintf(downloadLabel, "Downloading..."); + printf("%s\n", downloadLabel); + hcg_progressbar->label(downloadLabel); hcg_progressbar->redraw(); *************** *** 91,94 **** --- 93,97 ---- } + // // Callback for the cancel button Index: testmain.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/util-net/testmain.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testmain.cpp 4 Mar 2007 22:23:24 -0000 1.2 --- testmain.cpp 16 May 2007 22:04:19 -0000 1.3 *************** *** 70,76 **** // string file = httpDownload("http://localhost/jinstall-1_4_2-windows-i586.cab"); // string file = httpDownload("http://java.sun.com/products/plugin/autodl/jinstall-1_3_0_05-win.cab"); ! string file= httpDownload("http://downloads.sourceforge.net/filezilla/FileZilla_2_2_31_setup.exe?use_mirror=osdn"); printf("Downloaded: %s\n", file.c_str()); --- 70,80 ---- // string file = httpDownload("http://localhost/jinstall-1_4_2-windows-i586.cab"); + // string file = httpDownload("http://127.0.0.1/test.msi"); + // string file = httpDownload("http://travel.state.gov/passport/forms/forms_847.html"); // string file = httpDownload("http://java.sun.com/products/plugin/autodl/jinstall-1_3_0_05-win.cab"); ! string file = httpDownload("ftp://ftp.free.fr/pub/freeplayer/Freeplayer-Win32-20050905.zip"); ! ! //string file= httpDownload("http://downloads.sourceforge.net/filezilla/FileZilla_2_2_31_setup.exe?use_mirror=osdn"); printf("Downloaded: %s\n", file.c_str()); --- NEW FILE: WinHttpClient.cpp --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "WinHttpClient.h" #include "StringUtils.h" WinHttpClient::WinHttpClient() { m_connection = InternetOpen("JSmooth wrapper", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); // INTERNET_FLAG_ASYNC); printf("Got connection: %d\n", m_connection); m_file = NULL; m_contentlength = -1; m_cancelled = false; } WinHttpClient::~WinHttpClient() { if (m_file != NULL) InternetCloseHandle(m_file); if (m_connection != NULL) InternetCloseHandle(m_connection); } bool WinHttpClient::sendGet() { if (m_connection != NULL) { m_file = InternetOpenUrl(m_connection, m_url.toString().c_str(), NULL, 0, 0, //INTERNET_FLAG_PASSIVE, 0); if (m_file != NULL) { std::string protocol = StringUtils::toLowerCase(m_url.getProtocol()); m_contentlength = -1; if (protocol == "http") { DWORD size; DWORD sizesize = sizeof(DWORD); if (HttpQueryInfo(m_file, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &size, &sizesize, NULL)) m_contentlength = size; } else if (protocol == "ftp") { DWORD size; m_contentlength = FtpGetFileSize(m_file, &size); } } } return m_file != NULL; } bool WinHttpClient::saveResponseBody() { if (m_file == NULL) return false; // // Create a temporary filename string filebase = m_url.getFileName(); string extension = FileUtils::getFileExtension(filebase); string filepath = FileUtils::createTempFileName(".httpdl."+extension); m_receivedFilePath = filepath; ofstream output(filepath.c_str(), ios::out | ios::binary); char buffer[1024]; DWORD readbytes = 0; bool result; int currentlength = 0; do { result = InternetReadFile(m_file, buffer, 1023, &readbytes); if (readbytes > 0) { output.write(buffer, readbytes); currentlength += readbytes; updateListeners(currentlength, m_contentlength); } } while (result && (readbytes > 0) && (m_cancelled == false)); output.close(); if (m_cancelled) { DeleteFile(filepath.c_str()); return false; } // // Assume that if we downloaded nothing, something went wrong... // if (currentlength <= 0) return false; return true; } void WinHttpClient::addListener(WinHttpClientListener& listener) { m_listeners.push_back(&listener); } void WinHttpClient::updateListeners(int current, int total) { for (vector<WinHttpClientListener*>::iterator i = m_listeners.begin(); i != m_listeners.end(); i++) { (*i)->httpDownloadUpdate(current, total); } } bool WinHttpClient::cancel() { m_cancelled = true; } bool WinHttpClient::isCancelled() { return m_cancelled; } void WinHttpClient::setURL(const URL& url) { m_url = url; } std::string WinHttpClient::getTemporaryFile() { return m_receivedFilePath; } --- NEW FILE: WinHttpClient.h --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __WINHTTPCLIENT_H_ #define __WINHTTPCLIENT_H_ #include <string> #include <vector> #include <winsock2.h> #include <wininet.h> #include <fstream> #include <iostream> using namespace std; #include "FileUtils.h" #include "URL.h" /** * This listener class provides a way to get the download * status. Implements this class and use HttpClient::addListener() to * keep track of the status. */ class WinHttpClientListener { public: virtual void httpDownloadUpdate(int current, int total) = 0; }; /** * A simplistic HTTP client class that manages chunked content and can * only save GET request on disk. * * To use it, one should typicall call the following methods: * * HttpClient client; // creates an instance * client.addListener(updater); // to add a listener, if any * client.setURL(anUrl); * client.sendGet(); // Send the request * bool result = httpClient.saveResponseBody(); // Did it work ? * string file = httpClient.getTemporaryFile(); // Get the filepath */ class WinHttpClient { public: WinHttpClient(); ~WinHttpClient(); void addListener(WinHttpClientListener& listener); void setURL(const URL& url); bool sendGet(); bool saveResponseBody(); bool cancel(); bool isCancelled(); std::string getTemporaryFile(); protected: HINTERNET m_connection; HINTERNET m_file; int m_contentlength; bool m_cancelled; URL m_url; std::string m_receivedFilePath; vector<WinHttpClientListener*> m_listeners; void updateListeners(int current, int total); }; #endif Index: httpdownload.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/util-net/httpdownload.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** httpdownload.h 4 Mar 2007 23:21:44 -0000 1.2 --- httpdownload.h 16 May 2007 22:04:19 -0000 1.3 *************** *** 36,44 **** #include "downloadgui.h" #include "HttpClient.h" // // The listener that keeps track of the download progress and update // the progress bar. ! class HttpUpdater : public HttpClientListener { void httpDownloadUpdate(int current, int total); --- 36,45 ---- #include "downloadgui.h" #include "HttpClient.h" + #include "WinHttpClient.h" // // The listener that keeps track of the download progress and update // the progress bar. ! class HttpUpdater : public WinHttpClientListener { void httpDownloadUpdate(int current, int total); |
From: Rodrigo R. <re...@us...> - 2007-05-13 20:08:58
|
Update of /cvsroot/jsmooth/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17486 Modified Files: build.xml Log Message: update version Index: build.xml =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/build.xml,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** build.xml 1 May 2007 19:56:51 -0000 1.38 --- build.xml 13 May 2007 20:08:55 -0000 1.39 *************** *** 30,34 **** <!-- set here the properties specific to the release --> ! <property name="VERSION" value="0.9.9-5"/> <!-- You don't need to modify the properties below --> --- 30,34 ---- <!-- set here the properties specific to the release --> ! <property name="VERSION" value="0.9.9-6"/> <!-- You don't need to modify the properties below --> |
From: Rodrigo R. <re...@us...> - 2007-05-13 20:07:50
|
Update of /cvsroot/jsmooth/jsmooth/sample In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17022/sample Modified Files: sample.jsmooth Log Message: minor changes Index: sample.jsmooth =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/sample/sample.jsmooth,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** sample.jsmooth 1 May 2007 19:56:51 -0000 1.12 --- sample.jsmooth 13 May 2007 20:07:43 -0000 1.13 *************** *** 1,11 **** <?xml version="1.0" encoding="ISO-8859-1"?> <jsmoothproject> - <JVMSearchPath>exepath</JVMSearchPath> <JVMSearchPath>registry</JVMSearchPath> <JVMSearchPath>javahome</JVMSearchPath> <JVMSearchPath>jrepath</JVMSearchPath> <JVMSearchPath>jdkpath</JVMSearchPath> <JVMSearchPath>jview</JVMSearchPath> <arguments></arguments> <embeddedJar>true</embeddedJar> <executableName>Sample.exe</executableName> --- 1,12 ---- <?xml version="1.0" encoding="ISO-8859-1"?> <jsmoothproject> <JVMSearchPath>registry</JVMSearchPath> <JVMSearchPath>javahome</JVMSearchPath> <JVMSearchPath>jrepath</JVMSearchPath> <JVMSearchPath>jdkpath</JVMSearchPath> + <JVMSearchPath>exepath</JVMSearchPath> <JVMSearchPath>jview</JVMSearchPath> <arguments></arguments> + <currentDirectory>..\classes</currentDirectory> <embeddedJar>true</embeddedJar> <executableName>Sample.exe</executableName> *************** *** 40,52 **** <maximumVersion></maximumVersion> <minimumVersion>1.3</minimumVersion> ! <skeletonName>WinService Wrapper</skeletonName> ! <skeletonProperties> ! <key>ServiceName</key> ! <value>aTEST</value> ! </skeletonProperties> ! <skeletonProperties> ! <key>ServiceDisplayName</key> ! <value>aTEST</value> ! </skeletonProperties> <skeletonProperties> <key>Message</key> --- 41,45 ---- <maximumVersion></maximumVersion> <minimumVersion>1.3</minimumVersion> ! <skeletonName>Console Wrapper</skeletonName> <skeletonProperties> <key>Message</key> *************** *** 55,72 **** </skeletonProperties> <skeletonProperties> ! <key>Autostart</key> <value>0</value> </skeletonProperties> <skeletonProperties> - <key>Logfile</key> - <value></value> - </skeletonProperties> - <skeletonProperties> - <key>Interactive</key> - <value>1</value> - </skeletonProperties> - <skeletonProperties> <key>Debug</key> ! <value>0</value> </skeletonProperties> </jsmoothproject> --- 48,57 ---- </skeletonProperties> <skeletonProperties> ! <key>PressKey</key> <value>0</value> </skeletonProperties> <skeletonProperties> <key>Debug</key> ! <value>1</value> </skeletonProperties> </jsmoothproject> |
From: Rodrigo R. <re...@us...> - 2007-05-13 20:07:50
|
Update of /cvsroot/jsmooth/jsmooth/sample/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17022/sample/src Modified Files: JSmoothPropertiesDisplayer.java Log Message: minor changes Index: JSmoothPropertiesDisplayer.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/sample/src/JSmoothPropertiesDisplayer.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** JSmoothPropertiesDisplayer.java 1 May 2007 19:56:51 -0000 1.9 --- JSmoothPropertiesDisplayer.java 13 May 2007 20:07:43 -0000 1.10 *************** *** 84,88 **** private void exitForm(java.awt.event.WindowEvent evt)//GEN-FIRST:event_exitForm { ! System.exit(0); }//GEN-LAST:event_exitForm --- 84,88 ---- private void exitForm(java.awt.event.WindowEvent evt)//GEN-FIRST:event_exitForm { ! System.exit(87); }//GEN-LAST:event_exitForm |
From: Rodrigo R. <re...@us...> - 2007-05-13 20:07:50
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/autodownload In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17022/skeletons/autodownload Modified Files: Makefile.win Log Message: minor changes Index: Makefile.win =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/Makefile.win,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.win 28 Apr 2007 08:50:44 -0000 1.4 --- Makefile.win 13 May 2007 20:07:43 -0000 1.5 *************** *** 14,19 **** LINKOBJ = main.o execcab.o execexe.o $(RES) OBJ = main.o execcab.o execexe.o $(libmscabd_la_OBJS) $(RES) ! FLTK-LDFLAGS = $(shell fltk-config --ldflags) ! FLTK-CXXFLAGS = $(shell fltk-config --cxxflags) ##LINKLIBS = ../commonjava/CommonJava.a ../util-core/util-core.a mspack.a ../util-net/util-net.a LINKLIBS = ../commonjava/CommonJava.a ../util-net/util-net.a ../util-core/util-core.a --- 14,19 ---- LINKOBJ = main.o execcab.o execexe.o $(RES) OBJ = main.o execcab.o execexe.o $(libmscabd_la_OBJS) $(RES) ! FLTK-LDFLAGS = $(shell fltk-config --ldflags --use-images) ! FLTK-CXXFLAGS = $(shell fltk-config --cxxflags --use-images) ##LINKLIBS = ../commonjava/CommonJava.a ../util-core/util-core.a mspack.a ../util-net/util-net.a LINKLIBS = ../commonjava/CommonJava.a ../util-net/util-net.a ../util-core/util-core.a |
From: Rodrigo R. <re...@us...> - 2007-05-13 20:07:50
|
Update of /cvsroot/jsmooth/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17022 Modified Files: Changelog build.number Log Message: minor changes Index: build.number =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/build.number,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** build.number 1 May 2007 19:56:51 -0000 1.35 --- build.number 13 May 2007 20:07:43 -0000 1.36 *************** *** 1,3 **** #Build Number for ANT. Do not edit! ! #Tue May 01 21:49:49 CEST 2007 ! build.number=221 --- 1,3 ---- #Build Number for ANT. Do not edit! ! #Sun May 13 21:33:45 CEST 2007 ! build.number=224 Index: Changelog =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/Changelog,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Changelog 1 May 2007 19:56:51 -0000 1.37 --- Changelog 13 May 2007 20:07:43 -0000 1.38 *************** *** 1,2 **** --- 1,19 ---- + 0.9.9-6 + - Fixed a DOS console appearing for a fraction of second when + running a CreateProcess to guess the version of the JVM. + - Return code now correctly returned for the console wrapper. + - Now the jsmooth wrappers configured to work with a bundled VM + accept the SingleProcess argument correctly. If no java.exe is + available in the bin/ folder of the bundled VM, JSmooth runs the + DLL and uses the "minimum JVM version" defined in the project, or + assumes 1.2+ if no minimum version is defined. NOTE: Some JRE do + not accept to be instanciated directly with their DLL when they + are not properly installed (which is often the case for a bundled + JRE). For instance, I've found that 1.3.1_02 works fine when + calling the java[w].exe, but crash when calling the jvm.dll. On + the other hand, the same test on a 1.5.0_11 works fine. + - Removed the doctype in the docbook doc file, so that it can + compile without an internet connection + 0.9.9-5 (2007-05-01) - Adds new wrapper for windows services |
From: Rodrigo R. <re...@us...> - 2007-05-13 20:06:29
|
Update of /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16576/net/charabia/jsmoothgen/application Modified Files: JSmoothModelBean.java PropertiesBuilder.java Log Message: (very) minor changes Index: PropertiesBuilder.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/PropertiesBuilder.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PropertiesBuilder.java 2 Apr 2007 22:02:06 -0000 1.16 --- PropertiesBuilder.java 13 May 2007 20:06:25 -0000 1.17 *************** *** 162,165 **** --- 162,169 ---- static public String getRenormalizedPathIfNeeded(String value, File previousbasedir, File newbasedir) { + // File f = new File(value); + // if (f.isAbsolute()) + // return value; + if (newbasedir == null) return value; Index: JSmoothModelBean.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/JSmoothModelBean.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** JSmoothModelBean.java 4 Apr 2007 19:47:08 -0000 1.15 --- JSmoothModelBean.java 13 May 2007 20:06:25 -0000 1.16 *************** *** 382,385 **** --- 382,386 ---- public String[] normalizePaths(java.io.File filebase, boolean toRelativePath) { + // System.out.println("Normalize Path " + filebase + " / " + toRelativePath); Vector result = new Vector(); |
From: Rodrigo R. <re...@us...> - 2007-05-13 20:06:29
|
Update of /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/gui In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16576/net/charabia/jsmoothgen/application/gui Modified Files: Main.java Log Message: (very) minor changes Index: Main.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/gui/Main.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Main.java 7 Apr 2007 11:54:12 -0000 1.7 --- Main.java 13 May 2007 20:06:25 -0000 1.8 *************** *** 67,71 **** }); - setTitle("Untitled"); loadWindowSettings(); --- 67,70 ---- |
From: Rodrigo R. <re...@us...> - 2007-05-13 20:01:50
|
Update of /cvsroot/jsmooth/jsmooth/docs In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14631/docs Modified Files: jsmooth-doc.xml Log Message: removed a url reference so that the xml can be compiled without an internet connection Index: jsmooth-doc.xml =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/docs/jsmooth-doc.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** jsmooth-doc.xml 12 Apr 2007 20:01:50 -0000 1.20 --- jsmooth-doc.xml 13 May 2007 20:01:46 -0000 1.21 *************** *** 1,5 **** <?xml version="1.0"?> - <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> <article> --- 1,3 ---- |
From: Rodrigo R. <re...@us...> - 2007-05-13 19:59:00
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/simplewrap In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13388/simplewrap Modified Files: main.cpp Log Message: return code propagation Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/main.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** main.cpp 1 May 2007 19:40:16 -0000 1.28 --- main.cpp 13 May 2007 19:58:57 -0000 1.29 *************** *** 96,99 **** --- 96,100 ---- man.setUseConsole(false); man.setPreferDLL(globalResMan->getBooleanProperty("skel_SingleProcess")); + int retvalue = 0; if (man.run() == false) *************** *** 107,110 **** --- 108,115 ---- } } + else + { + retvalue = man.getExitCode(); + } DEBUG("NORMAL EXIT"); *************** *** 112,116 **** /* The program return-value is 0 - The value that PostQuitMessage() gave */ ! return 0; } --- 117,121 ---- /* The program return-value is 0 - The value that PostQuitMessage() gave */ ! return retvalue; } |
From: Rodrigo R. <re...@us...> - 2007-05-13 19:56:39
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/commonjava In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12151 Modified Files: JavaMachineManager.cpp SunJVMDLL.cpp SunJVMLauncher.cpp SunJVMLauncher.h Log Message: adds return code propagation Index: SunJVMLauncher.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMLauncher.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** SunJVMLauncher.cpp 1 May 2007 19:40:16 -0000 1.28 --- SunJVMLauncher.cpp 13 May 2007 19:56:35 -0000 1.29 *************** *** 47,123 **** DEBUG("Running now " + this->toString() + ", instanciate=" + (justInstanciate?"yes":"no")); ! if (VmVersion.isValid() == false) ! { ! DEBUG("No version identified for " + toString()); ! SunJVMExe exe(this->JavaHome); ! VmVersion = exe.guessVersion(); ! DEBUG("Version found: " + VmVersion.toString()); ! } ! ! if (VmVersion.isValid() == false) ! { ! DEBUG("No version found, can't instanciate DLL without it"); ! return false; ! } // patch proposed by zregvart: if you're using bundeled JVM, you // apriori know the version bundled and we can trust. The version // check is therefore unrequired. ! if (origin != "bundled") { ! Version max(resource.getProperty(ResourceManager:: KEY_MAXVERSION)); ! Version min(resource.getProperty(ResourceManager:: KEY_MINVERSION)); ! if (min.isValid() && (VmVersion < min)) ! return false; ! if (max.isValid() && (max < VmVersion)) ! return false; ! } ! DEBUG("Launching " + toString()); ! // ! // search for the dll if it's not set in the registry, or if the ! // file doesn't exist ! // ! if ( (this->JavaHome.size()>0) ! && ((this->RuntimeLibPath.size() == 0) || (!FileUtils::fileExists(this->RuntimeLibPath))) ) ! { ! std::string assump = FileUtils::concFile(this->JavaHome, "jre\\bin\\jvm.dll"); ! std::string assump2 = FileUtils::concFile(this->JavaHome, "jre\\bin\\server\\jvm.dll"); // for JRE 1.5+ ! std::string assump3 = FileUtils::concFile(this->JavaHome, "jre\\bin\\client\\jvm.dll"); // for JRE 1.5+ ! std::string assump4 = FileUtils::concFile(this->JavaHome, "bin\\javai.dll"); // For JRE 1.1 ! if (FileUtils::fileExists(assump)) ! this->RuntimeLibPath = assump; ! else if (FileUtils::fileExists(assump2)) ! this->RuntimeLibPath = assump2; ! else if (FileUtils::fileExists(assump3)) ! this->RuntimeLibPath = assump3; ! else if (FileUtils::fileExists(assump4)) ! this->RuntimeLibPath = assump4; ! else ! { ! vector<string> dlls = FileUtils::recursiveSearch(this->JavaHome, string("jvm.dll")); ! if (dlls.size() > 0) ! this->RuntimeLibPath = dlls[0]; ! } ! } ! if (FileUtils::fileExists(this->RuntimeLibPath)) ! { ! m_dllrunner = new SunJVMDLL(this->RuntimeLibPath, this->VmVersion); ! // set up the vm parameters... ! setupVM(resource, m_dllrunner); ! if (justInstanciate) ! return m_dllrunner->instanciate(); ! else ! return m_dllrunner->run(resource.getProperty(ResourceManager::KEY_MAINCLASSNAME), ! true); ! } ! return false; } --- 47,133 ---- DEBUG("Running now " + this->toString() + ", instanciate=" + (justInstanciate?"yes":"no")); ! Version max(resource.getProperty(ResourceManager:: KEY_MAXVERSION)); ! Version min(resource.getProperty(ResourceManager:: KEY_MINVERSION)); // patch proposed by zregvart: if you're using bundeled JVM, you // apriori know the version bundled and we can trust. The version // check is therefore unrequired. ! if (origin != "bundled") { ! if (VmVersion.isValid() == false) ! { ! DEBUG("No version identified for " + toString()); ! SunJVMExe exe(this->JavaHome); ! VmVersion = exe.guessVersion(); ! DEBUG("Version found: " + VmVersion.toString()); ! } ! ! if (VmVersion.isValid() == false) ! { ! DEBUG("No version found, can't instanciate DLL without it"); ! return false; ! } ! if (min.isValid() && (VmVersion < min)) ! return false; ! if (max.isValid() && (max < VmVersion)) ! return false; ! } ! DEBUG("Launching " + toString()); ! // ! // search for the dll if it's not set in the registry, or if the ! // file doesn't exist ! // ! if ( (this->JavaHome.size()>0) ! && ((this->RuntimeLibPath.size() == 0) || (!FileUtils::fileExists(this->RuntimeLibPath))) ) ! { ! std::string assump = FileUtils::concFile(this->JavaHome, "jre\\bin\\jvm.dll"); ! std::string assump2 = FileUtils::concFile(this->JavaHome, "jre\\bin\\server\\jvm.dll"); // for JRE 1.5+ ! std::string assump3 = FileUtils::concFile(this->JavaHome, "jre\\bin\\client\\jvm.dll"); // for JRE 1.5+ ! std::string assump4 = FileUtils::concFile(this->JavaHome, "bin\\javai.dll"); // For JRE 1.1 ! if (FileUtils::fileExists(assump)) ! this->RuntimeLibPath = assump; ! else if (FileUtils::fileExists(assump2)) ! this->RuntimeLibPath = assump2; ! else if (FileUtils::fileExists(assump3)) ! this->RuntimeLibPath = assump3; ! else if (FileUtils::fileExists(assump4)) ! this->RuntimeLibPath = assump4; ! else ! { ! vector<string> dlls = FileUtils::recursiveSearch(this->JavaHome, string("jvm.dll")); ! if (dlls.size() > 0) ! this->RuntimeLibPath = dlls[0]; ! } ! } ! if (FileUtils::fileExists(this->RuntimeLibPath)) ! { ! DEBUG("RuntimeLibPath used: " + this->RuntimeLibPath); ! Version v = this->VmVersion; ! if (!v.isValid()) ! { ! v = min; ! if (!v.isValid()) ! v = Version("1.2.0"); ! DEBUG("No version, trying with " + v.toString()); ! } ! m_dllrunner = new SunJVMDLL(this->RuntimeLibPath, v); ! // set up the vm parameters... ! setupVM(resource, m_dllrunner); ! if (justInstanciate) ! return m_dllrunner->instanciate(); ! else ! return m_dllrunner->run(resource.getProperty(ResourceManager::KEY_MAINCLASSNAME), ! true); ! } ! ! return false; } *************** *** 214,948 **** } - - // bool SunJVMLauncher::setupVM12DLL(ResourceManager& resource, const string& origin) - // { - // std::string jarpath = resource.saveJarInTempFile(); - // HINSTANCE vmlib = LoadLibrary(this->RuntimeLibPath.c_str()); - - // if (vmlib != 0) - // { - // DEBUG("v1.2+ type VM loaded from " +this->RuntimeLibPath); - - // CreateJavaVM_t CreateJavaVM = (CreateJavaVM_t)GetProcAddress(vmlib, "JNI_CreateJavaVM"); - // GetDefaultJavaVMInitArgs_t GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t)GetProcAddress(vmlib, "JNI_GetDefaultJavaVMInitArgs"); - - // if ((CreateJavaVM != NULL) && (GetDefaultJavaVMInitArgs != NULL)) - // { - // DEBUG("VM Created successfully"); - // JavaVM *vm = new JavaVM(); - // JNIEnv *env = new JNIEnv(); - - // // - // // create the properties array - // // - // const vector<JavaProperty>& jprops = resource.getJavaProperties(); - // vector<string> jpropstrv; - // for (int i=0; i<jprops.size(); i++) - // { - // const JavaProperty& jp = jprops[i]; - // string value = jp.getValue(); - - // value = StringUtils::replace(value, "${VMSELECTION}", origin); - // value = StringUtils::replace(value, "${VMSPAWNTYPE}", "JVMDLL"); - - // // jpropstrv.push_back("-D" + jp.getName() + "=" + StringUtils::fixQuotes(value)); - - // jpropstrv.push_back( "-D" + jp.getName() + "=" + value); - // } - - // if (resource.getProperty("maxheap") != "") - // { - // jpropstrv.push_back("-Xmx" + sizeToString(resource.getProperty("maxheap"))); // the extra space at the end would cause JNI_EINVAL return code in CreateJavaVM - - // } - // if (resource.getProperty("initialheap") != "") - // { - // jpropstrv.push_back("-Xms" + sizeToString(resource.getProperty("initialheap"))); // the extra space at the end would cause JNI_EINVAL return code in CreateJavaVM - // } - - // JavaVMInitArgs vm_args; - // GetDefaultJavaVMInitArgs(&vm_args); - - // JavaVMOption options[1 + jpropstrv.size()]; - // std::string cpoption = "-Djava.class.path="; - // string cpath = jarpath; - // string additionalcpath = resource.getNormalizedClassPath(); - // if ((cpath.size()>0) && (additionalcpath.size()>0)) - // cpath += ';'; - // if (additionalcpath.size()>0) - // cpath += additionalcpath; - // // cpoption += StringUtils::fixQuotes(cpath); - // cpoption += cpath; - // cpoption += ""; - - // DEBUG("Classpath: " + cpoption); - // options[0].optionString = (char*)cpoption.c_str(); - // vm_args.version = 0x00010002; - // vm_args.version = JNI_VERSION_1_2; - // vm_args.options = options; - // vm_args.nOptions = 1 + jpropstrv.size(); - - // for (int i=0; i<jpropstrv.size(); i++) - // { - // options[1 + i].optionString = (char*)jpropstrv[i].c_str(); - // } - // for (int i=0; i< 1+jpropstrv.size(); i++) - // { - // DEBUG(string("Option added:") + options[i].optionString); - // } - - // vm_args.ignoreUnrecognized = JNI_TRUE; - - // // - // // Create the VM - // if (CreateJavaVM( &vm, &env, &vm_args) != 0) - // { - // DEBUG("Can't create VM"); - // return false; - // } - // DEBUG("VM Created !!"); - - // jclass clstest = env->FindClass("java/lang/System"); - // if (clstest != 0) - // { - // DEBUG("Found java.lang.system !"); - // } - // else - // { - // DEBUG("java.lang.system not found"); - // return false; - // } - - // m_javavm = vm; - // m_javaenv = env; - - // this->LaunchingStatus = JVM_DLL_INSTANCIATED; - // return true; - // } - // } - // else - // { - // DEBUG("Warning: can't even load the DLL: " + this->RuntimeLibPath); - // } - - // return false; - // } - - // bool SunJVMLauncher::runVMDLL(ResourceManager& resource, const string& origin, bool justInstanciate) - // { - // DEBUG("DLL set up " + this->toString() + ", instanciate=" + (justInstanciate?"yes":"no")); - - // std::string classname = resource.getProperty(string(ResourceManager::KEY_MAINCLASSNAME)); - // classname = StringUtils::replace(classname,".", "/"); - // DEBUG("Check if " + classname + " is available"); - // jclass cls = (m_javaenv)->FindClass(classname.c_str()); - // if (cls == 0) - // { - // DEBUG(std::string("Can't Find CLASS <") + classname + std::string("> (probably a classpath issue)")); - // return false; - // } - // else - // DEBUG("OK, class " + classname + " is available"); - - // char strbuf[255]; - // sprintf(strbuf, ""); - // jstring jstr = (m_javaenv)->NewStringUTF(strbuf); - // jmethodID mid = (m_javaenv)->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V"); - - // vector<string> pargs = StringUtils::split(resource.getProperty(ResourceManager::KEY_ARGUMENTS), " \t\n\r", "\"\'"); - // for (int i=0; i<pargs.size(); i++) - // DEBUG("Argument " + StringUtils::toString(i)+" : <" + pargs[i] + ">"); - - // jobjectArray args; - - // if (pargs.size() > 0) - // { - // args = (m_javaenv)->NewObjectArray(pargs.size(), (m_javaenv)->FindClass("java/lang/String"), jstr); - // for (int i=0; i<pargs.size(); i++) - // { - // jstr = (m_javaenv)->NewStringUTF(pargs[i].c_str()); - // (m_javaenv)->SetObjectArrayElement(args, i, jstr); - // } - // } - // else - // { - // args = (m_javaenv)->NewObjectArray(0, (m_javaenv)->FindClass("java/lang/String"), jstr); - // } - - // if ((mid != 0) && (args != 0)) - // { - // DEBUG(std::string("VM OK, instanciate ? ") + (justInstanciate?"yes":"no")); - // if (justInstanciate) - // { - // return true; - // } - - // DEBUG("Calling static void main(String[]) method from " + classname); - // m_javaenv->CallStaticVoidMethod(cls, mid, args); - // DEBUG(classname + " call complete"); - // m_javavm->DestroyJavaVM(); - // DEBUG("VM destroyed"); - // return true; - // } - // else - // { - // DEBUG("Can't find method !"); - // return false; - // } - // } - - - - // bool SunJVMLauncher::setupVM11DLL(ResourceManager& resource, const string& origin) - // { - // DEBUG("Setting up a 1.1-type JVM from the DLL " + this->RuntimeLibPath); - - // std::string jarpath = resource.saveJarInTempFile(); - // std::string extracp = resource.getNormalizedClassPath(); - - // HINSTANCE vmlib = LoadLibrary(this->RuntimeLibPath.c_str()); - - // if (vmlib != 0) - // { - // DEBUG("DLL successfully loaded from " + this->RuntimeLibPath ); - // CreateJavaVM_t CreateJavaVM = (CreateJavaVM_t)GetProcAddress(vmlib, "JNI_CreateJavaVM"); - // GetDefaultJavaVMInitArgs_t GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t)GetProcAddress(vmlib, "JNI_GetDefaultJavaVMInitArgs"); - - // if ((CreateJavaVM != NULL) && (GetDefaultJavaVMInitArgs != NULL)) - // { - // DEBUG("Found the CreateJavaVM and GetDefaultJavaVMInitArgs methods in the DLL... that's good"); - - // JavaVM *javavm = new JavaVM(); - // JNIEnv *env = new JNIEnv(); - - // jint res; - // jclass cls; - // jmethodID mid; - // jstring jstr; - // jobjectArray args; - - // JDK1_1InitArgs vm_args; - // //vm_args.exit = myexit; - // vm_args.version = 0x00010001; - // GetDefaultJavaVMInitArgs(&vm_args); - - // if (resource.getProperty("maxheap") != "") - // { - // vm_args.maxHeapSize = StringUtils::parseInt(resource.getProperty("maxheap")); - // } - // if (resource.getProperty("initialheap") != "") - // { - // vm_args.minHeapSize = StringUtils::parseInt(resource.getProperty("initialheap")); - // } - - // // - // // create the properties array - // // - // const vector<JavaProperty>& jprops = resource.getJavaProperties(); - // vector<string> jpropstrv; - // for (int i=0; i<jprops.size(); i++) - // { - // const JavaProperty& jp = jprops[i]; - // string value = jp.getValue(); - - // value = StringUtils::replace(value, "${VMSELECTION}", origin); - // value = StringUtils::replace(value, "${VMSPAWNTYPE}", "JVMDLL"); - - // // jpropstrv.push_back(jp.getName() + "=" + StringUtils::fixQuotes(value)); - // jpropstrv.push_back(jp.getName() + "=" + value); - // } - - // char const * props[jprops.size()+1]; - // for (int i=0; i<jpropstrv.size(); i++) - // { - // props[i] = jpropstrv[i].c_str(); - // } - // props[jprops.size()] = NULL; - - // vm_args.properties = (char**)props; - - // /* Append USER_CLASSPATH to the default system class path */ - - // std::string classpath = vm_args.classpath; - // classpath += ";" + jarpath; - // classpath += ";" + extracp; - // DEBUG("Classpath = " + classpath); - // vm_args.classpath = (char*)classpath.c_str(); - - // /* Create the Java VM */ - // if ((res = CreateJavaVM( &javavm, &env, &vm_args)) < 0) - // { - // DEBUG("Can't create VM " + this->RuntimeLibPath); - // return false; - // } - - // DEBUG("VM 1.1 successfully created"); - - // // - // // Test java.lang.system - // if (env->FindClass("java/lang/System") == 0) - // { - // DEBUG("java.lang.system not found... aborting the VM setup"); - // return false; - // } - - // m_javavm = javavm; - // m_javaenv = env; - - // this->LaunchingStatus = JVM_DLL_INSTANCIATED; - - // return true; - // } - // } - - // return false; - // } - - // bool SunJVMLauncher::runVM11proc(ResourceManager& resource, bool noConsole, const string& origin) - // { - // DEBUG("Running process with 1.1 compatibility mode"); - - // string javapath = "bin\\java.exe"; - // string jrepath = "bin\\jre.exe"; - // if (noConsole) - // { - // javapath = "bin\\javaw.exe"; - // jrepath = "bin\\jrew.exe"; - // } - - // std::string exepath = StringUtils::requote( FileUtils::concFile(this->JavaHome, javapath) ); - // if (FileUtils::fileExists(exepath) == false) - // exepath = StringUtils::requote( FileUtils::concFile(this->JavaHome, jrepath) ); - - // if (FileUtils::fileExists(exepath)) - // { - // if (runExe(exepath, true, resource, noConsole, "1.1", origin)) - // { - // this->LaunchingStatus = JVM_PROCESS_LAUNCHED; - // return true; - // } - // } - - // return false; - // } - - // bool SunJVMLauncher::runVM12proc(ResourceManager& resource, bool noConsole, const string& origin) - // { - // string javapath = "bin\\java.exe"; - // string jrepath = "bin\\jre.exe"; - // if (noConsole) - // { - // javapath = "bin\\javaw.exe"; - // jrepath = "bin\\jrew.exe"; - // } - - // std::string exepath = StringUtils::requote( FileUtils::concFile(this->JavaHome, javapath) ); - // if (FileUtils::fileExists(exepath) == false) - // exepath = StringUtils::requote( FileUtils::concFile(this->JavaHome, jrepath) ); - - // if (FileUtils::fileExists(exepath)) - // { - // if (runExe(exepath, false, resource, noConsole, "1.2+", origin)) - // { - // this->LaunchingStatus = JVM_PROCESS_LAUNCHED; - // return true; - // } - // } - - // return false; - // } - - // bool SunJVMLauncher::runExe(const string& exepath, bool forceFullClasspath, ResourceManager& resource, bool noConsole, const string& version, const string& origin) - // { - // DEBUG("Running new proc for " + exepath); - - // string embeddedjar = resource.saveJarInTempFile(); - // DEBUG("Embedded jar saved at " + embeddedjar); - // string classpath = embeddedjar; - - // if (forceFullClasspath && (JavaHome != "")) - // { - // DEBUG("Forcing full classpath"); - // vector<string> cpzips = FileUtils::recursiveSearch(JavaHome, "*.zip"); - // for (vector<string>::iterator i=cpzips.begin(); i!=cpzips.end(); i++) - // DEBUG("ZIP FILE: " + *i); - // vector<string> cpjars = FileUtils::recursiveSearch(JavaHome, "*.jar"); - // for (vector<string>::iterator i=cpjars.begin(); i!=cpjars.end(); i++) - // DEBUG("JAR FILE: " + *i); - // vector<string> fullcp; - // fullcp.insert(fullcp.end(), cpzips.begin(), cpzips.end()); - // fullcp.insert(fullcp.end(), cpjars.begin(), cpjars.end()); - // for (vector<string>::iterator i=fullcp.begin(); i!=fullcp.end(); i++) - // DEBUG("FULL CP FILE: " + *i); - // string lcp = StringUtils::join(fullcp, ";"); - - // classpath += string(";") + lcp; - // } - - // string addcp = resource.getNormalizedClassPath(); - // classpath += ";" + addcp; - - // string addargs = resource.getProperty(ResourceManager::KEY_ARGUMENTS); - - // string javaproperties = ""; - // const vector<JavaProperty>& jprops = resource.getJavaProperties(); - // for (vector<JavaProperty>::const_iterator i=jprops.begin(); i != jprops.end(); i++) - // { - // JavaProperty jp = *i; - // string v = jp.getValue(); - - // v = StringUtils::replace(v, "${VMSELECTION}", origin); - // v = StringUtils::replace(v, "${VMSPAWNTYPE}", "PROC"); - - // string::iterator t = v.end(); - // if (*(--t) == '\\') - // v += "\\"; - - // javaproperties += " \"-D" + jp.getName() + "\"=" + StringUtils::fixQuotes(v); - // } - - // if (resource.getProperty("maxheap") != "") - // { - // if (version == "1.1") - // javaproperties += " -mx" + sizeToString(resource.getProperty("maxheap")) + " "; - // else - // javaproperties += " -Xmx" + sizeToString(resource.getProperty("maxheap")) + " "; - // } - - // if (resource.getProperty("initialheap") != "") - // { - // if (version == "1.1") - // javaproperties += " -ms" + sizeToString(resource.getProperty("initialheap")) + " "; - // else - // javaproperties += " -Xms" + sizeToString(resource.getProperty("initialheap")) + " "; - // } - - // string classname = resource.getProperty(string(ResourceManager::KEY_MAINCLASSNAME)); - // string arguments = javaproperties + " -classpath \"" + classpath + "\" " + classname + " " + addargs; - - // DEBUG("CLASSNAME = <" + classname + ">"); - // STARTUPINFO info; - // GetStartupInfo(&info); - // int creationFlags = 0; - // int inheritsHandle; - // if (noConsole == false) - // { - // info.dwFlags = STARTF_USESHOWWINDOW|STARTF_USESTDHANDLES; - // info.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); - // info.hStdError = GetStdHandle(STD_ERROR_HANDLE); - // info.hStdInput = GetStdHandle(STD_INPUT_HANDLE); - // creationFlags = NORMAL_PRIORITY_CLASS; - // inheritsHandle = TRUE; - // } - // else - // { - // info.dwFlags = STARTF_USESHOWWINDOW; - // creationFlags = NORMAL_PRIORITY_CLASS | DETACHED_PROCESS; - // inheritsHandle = FALSE; - // } - - // PROCESS_INFORMATION procinfo; - // string exeline = StringUtils::fixQuotes(exepath) + " " + arguments; - // int res = CreateProcess(NULL, (char*)exeline.c_str(), NULL, NULL, inheritsHandle, creationFlags, NULL, NULL, &info, &procinfo); - - // DEBUG("---------------------------------------------------"); - // DEBUG("COMMAND LINE: " +exeline); - // DEBUG("RESULT: " + StringUtils::toString(res)); - // if (res != 0) - // { - // DEBUG("WAITING: " + StringUtils::toString(res)); - // WaitForSingleObject(procinfo.hProcess, INFINITE); - // DEBUG("WAIT ENDED"); - - // if (embeddedjar.size()>0) - // { - // DEBUG("DELETING " + embeddedjar); - // DeleteFile(embeddedjar.c_str()); - // } - // return true; - // } - // else - // { - // DEBUG("Can't run " + exeline); - // } - - // if (embeddedjar.size()>0) - // { - // DEBUG("DELETING " + embeddedjar); - // DeleteFile(embeddedjar.c_str()); - // } - - // return false; - // } - - // Version SunJVMLauncher::guessVersionByProcess(const string& exepath) - // { - // Version result; - - // // Return immediatly if the exe does not exist - // if (!FileUtils::fileExists(exepath)) - // return result; - - // string tmpfilename = FileUtils::createTempFileName(".tmp"); - // SECURITY_ATTRIBUTES secattrs; - // secattrs.nLength = sizeof(SECURITY_ATTRIBUTES); - // secattrs.lpSecurityDescriptor = NULL; - // secattrs.bInheritHandle = TRUE; - - // HANDLE tmph = CreateFile(tmpfilename.c_str(), GENERIC_WRITE, - // FILE_SHARE_WRITE, &secattrs, - // CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - - // if (tmph == NULL) - // { - // DEBUG("TEMPH == NULL"); - // } - - // DEBUG("REDIRECTED TMP TO " + tmpfilename); - // STARTUPINFO info; - // GetStartupInfo(&info); - // info.hStdOutput = tmph; - // info.hStdError = tmph; - // info.wShowWindow = TRUE; - // info.dwFlags = STARTF_USESTDHANDLES; - // PROCESS_INFORMATION procinfo; - - // string exeline = exepath + " -version"; - // DEBUG("Running: " + exeline); - // int res = CreateProcess(NULL, (char*)exeline.c_str(), NULL, NULL, - // TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, &info, &procinfo); - - // if (res != 0) - // { - // WaitForSingleObject(procinfo.hProcess, INFINITE); - // CloseHandle(tmph); - - // tmph = CreateFile(tmpfilename.c_str(), GENERIC_READ, - // FILE_SHARE_READ, NULL, - // OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - - // if (tmph != NULL) - // { - // DEBUG("Reading temp..."); - // char buffer[128]; - // DWORD hasread; - // buffer[127] = 0; - // if (ReadFile(tmph, buffer, 127, &hasread, NULL)) - // { - // DEBUG(string("DATA READ: ") + buffer); - // vector<string> split = StringUtils::split(buffer, " \t\n\r", "\""); - // for (vector<string>::iterator i=split.begin(); i != split.end(); i++) - // { - // Version v(*i); - // if (v.isValid()) - // { - // result = v; - // break; - // } - // } - // } - // CloseHandle(tmph); - // } - // else - // { - // DEBUG("Can't open temporary file for result"); - // } - // } - // else - // { - // DEBUG("Can't run process"); - // } - - // FileUtils::deleteOnReboot(tmpfilename); - // return result; - // } - - // std::string SunJVMLauncher::sizeToString(std::string size) - // { - // if ( (size.find('m') != string::npos) - // || (size.find('M') != string::npos) - // || (size.find('k') != string::npos) - // || (size.find('K') != string::npos) ) - // { - // return size; - // } - // else - // return sizeToString(StringUtils::parseInt(size)); - // } - - // std::string SunJVMLauncher::sizeToString(int size) - // { - // if (size > (1024*1024)) - // { - // return StringUtils::toString(size / (1024*1024)) + "m"; - // } else if (size > 1024) - // { - // return StringUtils::toString(size / 1024) + "k"; - // } else - // { - // return StringUtils::toString(size); - // } - // } - - // bool SunJVMLauncher::dllInstanciate(ResourceManager& resource, const std::string& origin) - // { - // return runVMDLL(resource, origin); - // } - - // bool SunJVMLauncher::callDLLStaticMethod(const std::string& clazz, const std::string& methodname, const std::string& signature) - // { - // JNIEnv *env = new JNIEnv(); - // jint result = m_javavm->AttachCurrentThread((void**)&env, 0); - // DEBUG("Attached thread to the VM: " + StringUtils::toString(result)); - - // // if (result != 0) - // // { - // // DEBUG("Can't attach the thread to the VM!"); - // // return false; - // // } - - // JNIEnv* jenv = env; - - // std::string classname = StringUtils::replace(clazz,".", "/"); - // DEBUG("Calling " + classname + "::" + methodname + signature); - // DEBUG("Check if " + classname + " is available"); - // jclass cls = (jenv)->FindClass(classname.c_str()); - // if (cls == 0) - // { - // DEBUG(std::string("Can't Find CLASS <") + classname + std::string("> (probably a classpath issue)")); - // return false; - // } - // else - // DEBUG("OK, class " + classname + " is available"); - - // char strbuf[255]; - // sprintf(strbuf, ""); - // jstring jstr = (jenv)->NewStringUTF(strbuf); - // jmethodID mid = (jenv)->GetStaticMethodID(cls, methodname.c_str(), signature.c_str()); - - // if (mid != 0) - // { - // DEBUG("Calling static method from " + classname); - // jenv->CallStaticVoidMethod(cls, mid); - // return true; - // } - // else - // { - // DEBUG("Can't find method !"); - // return false; - // } - - // } - - // bool SunJVMLauncher::callDLLStaticMethodInt(const std::string& clazz, const std::string& methodname, const std::string& signature, int value) - // { - // JNIEnv *env = new JNIEnv(); - // jint result = m_javavm->AttachCurrentThread((void**)&env, 0); - // DEBUG("Attached thread to the VM: " + StringUtils::toString(result)); - // JNIEnv* jenv = env; - - // std::string classname = StringUtils::replace(clazz,".", "/"); - // DEBUG("Calling " + classname + "::" + methodname + signature); - // DEBUG("Check if " + classname + " is available"); - // jclass cls = (jenv)->FindClass(classname.c_str()); - // if (cls == 0) - // { - // DEBUG(std::string("Can't Find CLASS <") + classname + std::string("> (probably a classpath issue)")); - // return false; - // } - // else - // DEBUG("OK, class " + classname + " is available"); - - // char strbuf[255]; - // sprintf(strbuf, ""); - // jstring jstr = (jenv)->NewStringUTF(strbuf); - // jmethodID mid = (jenv)->GetStaticMethodID(cls, methodname.c_str(), signature.c_str()); - - // if (mid != 0) - // { - // DEBUG("Calling static method " + methodname + " from " + classname + " (" + StringUtils::toString((int)cls) + "," + StringUtils::toString((int)mid) +")" ); - // jvalue args[5]; - // args[0].i = value; - // jint val = value; - // jenv->CallStaticVoidMethod(cls, mid, (jint)value); - // return true; - // } - // else - // { - // DEBUG("Can't find method !"); - // return false; - // } - - // } - - // int SunJVMLauncher::destroyVM() - // { - // if (m_javavm != 0) - // return m_javavm->DestroyJavaVM(); - // return -1; - // } - - // jclass SunJVMLauncher::findClass(const std::string& clazz) - // { - // JNIEnv* env = new JNIEnv(); - // jint result = m_javavm->AttachCurrentThread((void**)&env, 0); - // DEBUG("Attached thread to the VM: " + StringUtils::toString(result)); - - // JNIEnv* jenv = env; - - // std::string classname = StringUtils::replace(clazz,".", "/"); - // jclass cls = (jenv)->FindClass(classname.c_str()); - // return cls; - // } - - // jmethodID SunJVMLauncher::findMethod(jclass& cls, const std::string& methodname, const std::string& signature, bool isStatic) - // { - // JNIEnv* env = new JNIEnv(); - // jint result = m_javavm->AttachCurrentThread((void**)&env, 0); - // DEBUG("Attached thread to the VM: " + StringUtils::toString(result)); - - // JNIEnv* jenv = env; - - // jmethodID mid; - // if (isStatic) - // mid = (jenv)->GetStaticMethodID(cls, methodname.c_str(), signature.c_str()); - // else - // mid = (jenv)->GetMethodID(cls, methodname.c_str(), signature.c_str()); - - // return mid; - // } - - // JavaVM* SunJVMLauncher::getJavaVM() - // { - // return m_javavm; - // } - - // void SunJVMLauncher::invokeVoidStatic(jclass clazz, jmethodID& methodid, jvalue arguments[]) - // { - // JNIEnv *env = new JNIEnv(); - // jint result = m_javavm->AttachCurrentThread((void**)&env, 0); - // DEBUG("Attached thread to the VM: " + StringUtils::toString(result)); - // JNIEnv* jenv = env; - - // jenv->CallStaticVoidMethodA(clazz, methodid, arguments); - // } - - // jint SunJVMLauncher::invokeIntStatic(jclass clazz, jmethodID& methodid, jvalue arguments[]) - // { - // JNIEnv *env = new JNIEnv(); - // jint result = m_javavm->AttachCurrentThread((void**)&env, 0); - // DEBUG("Attached thread to the VM: " + StringUtils::toString(result)); - // JNIEnv* jenv = env; - - // return jenv->CallStaticIntMethodA(clazz, methodid, arguments); - // } - - // jlong SunJVMLauncher::invokeLongStatic(jclass clazz, jmethodID& methodid, jvalue arguments[]) - // { - // JNIEnv *env = new JNIEnv(); - // jint result = m_javavm->AttachCurrentThread((void**)&env, 0); - // DEBUG("Attached thread to the VM: " + StringUtils::toString(result)); - // JNIEnv* jenv = env; - - // return jenv->CallStaticLongMethodA(clazz, methodid, arguments); - // } --- 224,225 ---- Index: SunJVMLauncher.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMLauncher.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** SunJVMLauncher.h 1 May 2007 19:40:16 -0000 1.14 --- SunJVMLauncher.h 13 May 2007 19:56:35 -0000 1.15 *************** *** 121,125 **** std::string toString() const; - Version guessVersionByProcess(const string& exepath); friend bool operator < (const SunJVMLauncher& v1, const SunJVMLauncher& v2); --- 121,124 ---- *************** *** 128,140 **** ! bool runExe(const string& exepath, bool forceFullClasspath, ResourceManager& resource, bool noConsole, const std::string& version, const string& origin); ! bool dllInstanciate(ResourceManager& resource, const string& origin); ! bool callDLLStaticMethod(const std::string& classname, const std::string& methodname, const std::string& signature); ! bool callDLLStaticMethodInt(const std::string& classname, const std::string& methodname, const std::string& signature, int value); ! int destroyVM(); ! JavaVM* getJavaVM(); // jclass findClass(const std::string& clazz); --- 127,145 ---- + + + + // Version guessVersionByProcess(const string& exepath); + + ! // bool runExe(const string& exepath, bool forceFullClasspath, ResourceManager& resource, bool noConsole, const std::string& version, const string& origin); ! // bool dllInstanciate(ResourceManager& resource, const string& origin); ! // bool callDLLStaticMethod(const std::string& classname, const std::string& methodname, const std::string& signature); ! // bool callDLLStaticMethodInt(const std::string& classname, const std::string& methodname, const std::string& signature, int value); ! // int destroyVM(); ! // JavaVM* getJavaVM(); // jclass findClass(const std::string& clazz); *************** *** 148,158 **** private: ! bool runVMDLL(ResourceManager& resource, const string& origin, bool justInstanciate=false); ! bool setupVM12DLL(ResourceManager& resource, const string& origin); ! bool setupVM11DLL(ResourceManager& resource, const string& origin); ! bool runVM11proc(ResourceManager& resource, bool noConsole, const string& origin); ! bool runVM12proc(ResourceManager& resource, bool noConsole, const string& origin); }; --- 153,163 ---- private: ! // bool runVMDLL(ResourceManager& resource, const string& origin, bool justInstanciate=false); ! // bool setupVM12DLL(ResourceManager& resource, const string& origin); ! // bool setupVM11DLL(ResourceManager& resource, const string& origin); ! // bool runVM11proc(ResourceManager& resource, bool noConsole, const string& origin); ! // bool runVM12proc(ResourceManager& resource, bool noConsole, const string& origin); }; Index: JavaMachineManager.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/JavaMachineManager.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** JavaMachineManager.cpp 1 May 2007 19:40:16 -0000 1.18 --- JavaMachineManager.cpp 13 May 2007 19:56:35 -0000 1.19 *************** *** 21,24 **** --- 21,25 ---- #include "JavaMachineManager.h" + JavaMachineManager::JavaMachineManager(ResourceManager& resman): m_resman(resman) { *************** *** 29,33 **** m_jrepathVm = JVMEnvVarLookup::lookupJVM("JRE_HOME"); m_jdkpathVm = JVMEnvVarLookup::lookupJVM("JDK_HOME"); ! m_exitCode = -1; m_useConsole = true; m_acceptExe = true; --- 30,34 ---- m_jrepathVm = JVMEnvVarLookup::lookupJVM("JRE_HOME"); m_jdkpathVm = JVMEnvVarLookup::lookupJVM("JDK_HOME"); ! m_exitCode = 0; m_useConsole = true; m_acceptExe = true; *************** *** 40,44 **** DEBUG("Found a vm bundled with the application: (" + bjvm + ")"); m_localVMenabled = true; ! m_localVM.JavaHome = FileUtils::concFile(resman.getCurrentDirectory(), bjvm); } else { --- 41,46 ---- DEBUG("Found a vm bundled with the application: (" + bjvm + ")"); m_localVMenabled = true; ! std::string home = FileUtils::concFile(resman.getCurrentDirectory(), bjvm); ! m_localVM.JavaHome = home; } else { *************** *** 54,66 **** if (m_localVMenabled) { ! DEBUG("Trying to use bundled VM " + m_localVM.JavaHome); ! if (m_localVM.runProc(m_resman, m_useConsole, "bundled")) { - m_exitCode = m_localVM.getExitCode(); return true; } ! if (m_localVM.run(m_resman, "bundled")) ! return true; } --- 56,72 ---- if (m_localVMenabled) { ! if (internalRun(m_localVM, "bundled")) { return true; } ! // DEBUG("Trying to use bundled VM " + m_localVM.JavaHome); ! // if (m_localVM.runProc(m_resman, m_useConsole, "bundled")) ! // { ! // m_exitCode = m_localVM.getExitCode(); ! // return true; ! // } ! // if (m_localVM.run(m_resman, "bundled")) ! // return true; } *************** *** 153,157 **** if (launcher.runProc(m_resman, m_useConsole, org)) { ! m_exitCode = m_localVM.getExitCode(); return true; } --- 159,163 ---- if (launcher.runProc(m_resman, m_useConsole, org)) { ! m_exitCode = launcher.getExitCode(); return true; } Index: SunJVMDLL.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMDLL.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SunJVMDLL.cpp 30 Apr 2007 20:54:32 -0000 1.2 --- SunJVMDLL.cpp 13 May 2007 19:56:35 -0000 1.3 *************** *** 96,99 **** --- 96,100 ---- m_javaenv = new JNIEnv(); + DEBUG("DLL Setup on " + m_version.toString()); bool res; if ((m_version.getMajor() == 1) && (m_version.getMinor() == 1)) *************** *** 102,105 **** --- 103,107 ---- res = setupVM12DLL(CreateJavaVM, GetDefaultJavaVMInitArgs); + DEBUG("Result code on DLL: " + StringUtils::toString(res)); if (res) { |
From: Rodrigo R. <re...@us...> - 2007-05-13 19:51:04
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/consolewrapper In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10077 Modified Files: main.cpp Log Message: using ResourceManager::getBooleanProperty instead of a kludgy int parsing Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/consolewrapper/main.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** main.cpp 1 May 2007 19:40:16 -0000 1.19 --- main.cpp 13 May 2007 19:51:00 -0000 1.20 *************** *** 62,72 **** // // sets up the debug mode, if requested ! std::string dodebug = globalResMan->getProperty("skel_Debug"); ! if (StringUtils::parseInt(dodebug) != 0) { enableDebug = true; globalResMan->printDebug(); } ! string newcurdir = globalResMan->getCurrentDirectory(); SetCurrentDirectory(newcurdir.c_str()); --- 62,72 ---- // // sets up the debug mode, if requested ! ! if (globalResMan->getBooleanProperty("skel_Debug")) { enableDebug = true; globalResMan->printDebug(); } ! string newcurdir = globalResMan->getCurrentDirectory(); SetCurrentDirectory(newcurdir.c_str()); *************** *** 90,95 **** } ! int waitkey = atoi(globalResMan->getProperty("skel_PressKey").c_str()); ! if (waitkey != 0) { system("PAUSE"); --- 90,94 ---- } ! if (globalResMan->getBooleanProperty("skel_PressKey")) { system("PAUSE"); |
From: Rodrigo R. <re...@us...> - 2007-05-13 19:32:42
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/util-core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2771 Modified Files: FileUtils.cpp Log Message: enhanced concfile to handle absolute files Index: FileUtils.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/util-core/FileUtils.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FileUtils.cpp 28 Apr 2007 08:47:27 -0000 1.4 --- FileUtils.cpp 13 May 2007 19:32:38 -0000 1.5 *************** *** 145,148 **** --- 145,151 ---- std::string FileUtils::concFile(std::string path, std::string file) { + if (FileUtils::isAbsolute(file)) + return file; + if (path.length() > 0) { |
From: Rodrigo R. <re...@us...> - 2007-05-04 20:54:18
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/util-core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9552 Modified Files: Process.cpp testmain.cpp Log Message: Fixes the Process class opening a DOS console when redirection is enabled Index: Process.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/util-core/Process.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Process.cpp 1 May 2007 19:40:16 -0000 1.2 --- Process.cpp 4 May 2007 20:53:28 -0000 1.3 *************** *** 77,82 **** info.hStdOutput = m_redirectHandle; info.hStdError = m_redirectHandle; ! info.dwFlags = STARTF_USESTDHANDLES; } // string exeline = StringUtils::fixQuotes(exepath) + " " + arguments; int res = CreateProcess(NULL, (char*)m_commandline.c_str(), --- 77,85 ---- info.hStdOutput = m_redirectHandle; info.hStdError = m_redirectHandle; ! info.dwFlags = STARTF_USESHOWWINDOW|STARTF_USESTDHANDLES; ! info.lpTitle = NULL; ! info.wShowWindow = SW_HIDE; // OR SW_SHOWMINIMIZED? SW_SHOWMINNOACTIVE? } + // string exeline = StringUtils::fixQuotes(exepath) + " " + arguments; int res = CreateProcess(NULL, (char*)m_commandline.c_str(), Index: testmain.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/util-core/testmain.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testmain.cpp 28 Apr 2007 08:47:57 -0000 1.3 --- testmain.cpp 4 May 2007 20:53:28 -0000 1.4 *************** *** 25,28 **** --- 25,29 ---- #include <winnls.h> #include "FileUtils.h" + #include "Process.h" void _debugOutput(const std::string& text) *************** *** 37,57 **** int main(int argc, char *argv[]) { ! char buffer[256]; ! buffer[0] = 0; ! int res = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVLANGNAME, ! buffer, 255); ! if (res > 0) ! printf("result: %s\n", buffer); ! std::string cmdlinetest = " \"this is my\ test\\\" \"here and then\""; ! cmdlinetest = " \"this is my\ test here\\\" \"and\" \"then\""; ! printf("splitting line <%s>\n", cmdlinetest.c_str()); ! std::vector<std::string> args = StringUtils::split(cmdlinetest, " \t\n\r", "\"'", false, false); ! for (int i=0; i<args.size(); i++) ! { ! printf("ARG[%d]=%s\n", i, args[i].c_str(), false, false); ! } // std::string fqmethod = "void mytest1(java.lang.String test[ ] ) "; --- 38,68 ---- int main(int argc, char *argv[]) { ! // char buffer[256]; ! // buffer[0] = 0; ! // int res = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVLANGNAME, ! // buffer, 255); ! // if (res > 0) ! // printf("result: %s\n", buffer); + std::string exeline = "C:\\Program Files\\Java\\jdk1.5.0_11\\bin\\java.exe -version"; + string tmpfilename = FileUtils::createTempFileName(".tmp"); ! Process proc(exeline, true); ! proc.setRedirect(tmpfilename); ! proc.run(); ! proc.join(); ! ! std::string voutput = FileUtils::readFile(tmpfilename); ! // printf("GOT: %s\n", voutput.c_str()); ! ! // std::string cmdlinetest = " \"this is my\ test\\\" \"here and then\""; ! // cmdlinetest = " \"this is my\ test here\\\" \"and\" \"then\""; ! // printf("splitting line <%s>\n", cmdlinetest.c_str()); ! // std::vector<std::string> args = StringUtils::split(cmdlinetest, " \t\n\r", "\"'", false, false); ! // for (int i=0; i<args.size(); i++) ! // { ! // printf("ARG[%d]=%s\n", i, args[i].c_str(), false, false); ! // } // std::string fqmethod = "void mytest1(java.lang.String test[ ] ) "; |
From: Rodrigo R. <re...@us...> - 2007-05-01 19:56:55
|
Update of /cvsroot/jsmooth/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15899 Modified Files: Changelog build.number build.xml Log Message: Index: build.number =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/build.number,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** build.number 30 Apr 2007 21:00:43 -0000 1.34 --- build.number 1 May 2007 19:56:51 -0000 1.35 *************** *** 1,3 **** #Build Number for ANT. Do not edit! ! #Sun Apr 29 22:58:14 CEST 2007 ! build.number=213 --- 1,3 ---- #Build Number for ANT. Do not edit! ! #Tue May 01 21:49:49 CEST 2007 ! build.number=221 Index: build.xml =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/build.xml,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** build.xml 28 Apr 2007 09:07:31 -0000 1.37 --- build.xml 1 May 2007 19:56:51 -0000 1.38 *************** *** 352,355 **** --- 352,360 ---- <param name="target" value="all"/> </antcall> + <antcall target="compileskel"> + <param name="skelname" value="winservice"/> + <param name="skelflags" value="${skelflags}"/> + <param name="target" value="all"/> + </antcall> </target> *************** *** 393,396 **** --- 398,406 ---- <param name="target" value="clean"/> </antcall> + <antcall target="compileskel"> + <param name="skelname" value="winservice"/> + <param name="skelflags" value="${skelflags}"/> + <param name="target" value="clean"/> + </antcall> <delete file="jsmoothgen.exe"/> Index: Changelog =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/Changelog,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Changelog 28 Apr 2007 09:07:31 -0000 1.36 --- Changelog 1 May 2007 19:56:51 -0000 1.37 *************** *** 1,6 **** ! 0.9.9-5 - Adds new wrapper for windows services - Refactored the Sun JVM launcher, now 3 specialized class are available: JVMBase, SunJVMExe, SunJVMDLL 0.9.9-4 (2007-04-07) --- 1,10 ---- ! 0.9.9-5 (2007-05-01) - Adds new wrapper for windows services - Refactored the Sun JVM launcher, now 3 specialized class are available: JVMBase, SunJVMExe, SunJVMDLL + - Added latest 1.5.xx and 1.6.0 releases of the JRE for + autodownload, now defaulting to JRE 1.6.0 (should be better for + Vista end-users). + - Improved some inline help texts (english and french) 0.9.9-4 (2007-04-07) |
From: Rodrigo R. <re...@us...> - 2007-05-01 19:56:55
|
Update of /cvsroot/jsmooth/jsmooth/sample In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15899/sample Modified Files: sample.jsmooth Log Message: Index: sample.jsmooth =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/sample/sample.jsmooth,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** sample.jsmooth 30 Apr 2007 20:58:11 -0000 1.11 --- sample.jsmooth 1 May 2007 19:56:51 -0000 1.12 *************** *** 1,11 **** <?xml version="1.0" encoding="ISO-8859-1"?> <jsmoothproject> <JVMSearchPath>registry</JVMSearchPath> <JVMSearchPath>javahome</JVMSearchPath> <JVMSearchPath>jrepath</JVMSearchPath> <JVMSearchPath>jdkpath</JVMSearchPath> - <JVMSearchPath>exepath</JVMSearchPath> <JVMSearchPath>jview</JVMSearchPath> ! <arguments>${EXECUTABLEPATH}</arguments> <embeddedJar>true</embeddedJar> <executableName>Sample.exe</executableName> --- 1,11 ---- <?xml version="1.0" encoding="ISO-8859-1"?> <jsmoothproject> + <JVMSearchPath>exepath</JVMSearchPath> <JVMSearchPath>registry</JVMSearchPath> <JVMSearchPath>javahome</JVMSearchPath> <JVMSearchPath>jrepath</JVMSearchPath> <JVMSearchPath>jdkpath</JVMSearchPath> <JVMSearchPath>jview</JVMSearchPath> ! <arguments></arguments> <embeddedJar>true</embeddedJar> <executableName>Sample.exe</executableName> *************** *** 40,44 **** <maximumVersion></maximumVersion> <minimumVersion>1.3</minimumVersion> ! <skeletonName>Console Wrapper</skeletonName> <skeletonProperties> <key>Message</key> --- 40,52 ---- <maximumVersion></maximumVersion> <minimumVersion>1.3</minimumVersion> ! <skeletonName>WinService Wrapper</skeletonName> ! <skeletonProperties> ! <key>ServiceName</key> ! <value>aTEST</value> ! </skeletonProperties> ! <skeletonProperties> ! <key>ServiceDisplayName</key> ! <value>aTEST</value> ! </skeletonProperties> <skeletonProperties> <key>Message</key> *************** *** 47,56 **** </skeletonProperties> <skeletonProperties> ! <key>PressKey</key> <value>0</value> </skeletonProperties> <skeletonProperties> ! <key>Debug</key> <value>1</value> </skeletonProperties> </jsmoothproject> --- 55,72 ---- </skeletonProperties> <skeletonProperties> ! <key>Autostart</key> <value>0</value> </skeletonProperties> <skeletonProperties> ! <key>Logfile</key> ! <value></value> ! </skeletonProperties> ! <skeletonProperties> ! <key>Interactive</key> <value>1</value> </skeletonProperties> + <skeletonProperties> + <key>Debug</key> + <value>0</value> + </skeletonProperties> </jsmoothproject> |
From: Rodrigo R. <re...@us...> - 2007-05-01 19:56:55
|
Update of /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/gui/skeleditors In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15899/src/net/charabia/jsmoothgen/application/gui/skeleditors Modified Files: AutoDownloadURLEditor.java Log Message: Index: AutoDownloadURLEditor.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/gui/skeleditors/AutoDownloadURLEditor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AutoDownloadURLEditor.java 3 Apr 2007 20:24:30 -0000 1.1 --- AutoDownloadURLEditor.java 1 May 2007 19:56:51 -0000 1.2 *************** *** 30,33 **** --- 30,41 ---- { protected String[] m_autourls = new String[] { + "JRE 1.6.0", "http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab", + "JRE 1.5.0_11", "http://java.sun.com/update/1.5.0/jinstall-1_5_0_11-windows-i586.cab", + "JRE 1.5.0_10", "http://java.sun.com/update/1.5.0/jinstall-1_5_0_10-windows-i586.cab", + "JRE 1.5.0_07", "http://java.sun.com/update/1.5.0/jinstall-1_5_0_07-windows-i586.cab", + "JRE 1.5.0_06", "http://java.sun.com/update/1.5.0/jinstall-1_5_0_06-windows-i586.cab", + "JRE 1.5.0_03", "http://java.sun.com/update/1.5.0/jinstall-1_5_0_03-windows-i586.cab", + "JRE 1.5.0_02", "http://java.sun.com/update/1.5.0/jinstall-1_5_0_02-windows-i586.cab", + "JRE 1.5.0_01", "http://java.sun.com/update/1.5.0/jinstall-1_5_0_01-windows-i586.cab", "JRE 1.5.0", "http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab", "JRE 1.4.2_03", "http://java.sun.com/update/1.4.2/jinstall-1_4_2_03-windows-i586.cab", |
From: Rodrigo R. <re...@us...> - 2007-05-01 19:56:54
|
Update of /cvsroot/jsmooth/jsmooth/sample/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15899/sample/src Modified Files: JSmoothPropertiesDisplayer.java Log Message: Index: JSmoothPropertiesDisplayer.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/sample/src/JSmoothPropertiesDisplayer.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** JSmoothPropertiesDisplayer.java 1 Apr 2007 22:19:48 -0000 1.8 --- JSmoothPropertiesDisplayer.java 1 May 2007 19:56:51 -0000 1.9 *************** *** 90,96 **** * @param args the command line arguments */ ! public static void main(String args[]) { ! new JSmoothPropertiesDisplayer(args).setVisible(true); } --- 90,97 ---- * @param args the command line arguments */ ! public static void main(String args[]) throws Exception { ! new JSmoothPropertiesDisplayer(args).setVisible(true); ! // Thread.currentThread().sleep(1000*60); } |
From: Rodrigo R. <re...@us...> - 2007-05-01 19:40:25
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/autodownload In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9102/autodownload Modified Files: autodownload.skel main.cpp Log Message: adds exit code propagation when exe-run Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/main.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** main.cpp 28 Apr 2007 08:50:44 -0000 1.7 --- main.cpp 1 May 2007 19:40:16 -0000 1.8 *************** *** 78,87 **** } ! std::string dodebug = globalResMan->getProperty("skel_Debug"); ! if (StringUtils::parseInt(dodebug) != 0) ! { ! DEBUGCONSOLE = new DebugConsole("JSmooth Debug"); ! globalResMan->printDebug(); ! } DEBUG(string("Main class: ") + globalResMan->getMainName()); --- 78,88 ---- } ! bool dodebug = globalResMan->getBooleanProperty("skel_Debug"); ! ! if (dodebug) ! { ! DEBUGCONSOLE = new DebugConsole("JSmooth Debug"); ! globalResMan->printDebug(); ! } DEBUG(string("Main class: ") + globalResMan->getMainName()); *************** *** 95,105 **** JavaMachineManager man(*globalResMan); ! std::string preferDLLstr = globalResMan->getProperty("skel_SingleProcess"); ! ! bool preferDLL = false; ! if (StringUtils::parseInt(preferDLLstr) > 0) ! preferDLL = true; ! ! if (man.run(true, preferDLL) == false) { DEBUG("Displaying error message to user..."); --- 96,108 ---- JavaMachineManager man(*globalResMan); ! man.setAcceptExe(true); ! man.setAcceptDLL(true); ! if (dodebug) ! man.setUseConsole(true); ! else ! man.setUseConsole(false); ! man.setPreferDLL(globalResMan->getBooleanProperty("skel_SingleProcess")); ! ! if (man.run() == false) { DEBUG("Displaying error message to user..."); *************** *** 110,114 **** if ((url != "") && (MessageBox(NULL, errmsg.c_str(), "No Java?", MB_OKCANCEL|MB_ICONQUESTION|MB_APPLMODAL) == IDOK)) { - // string file = httpDownload("http://java.sun.com/products/plugin/autodl/jinstall-1_3_0_05-win.cab"); DEBUG("Now downloading " + url); string file = httpDownload(url); --- 113,116 ---- Index: autodownload.skel =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/autodownload.skel,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** autodownload.skel 29 Mar 2007 21:21:15 -0000 1.4 --- autodownload.skel 1 May 2007 19:40:16 -0000 1.5 *************** *** 20,24 **** <label>SKEL_AUTODOWNLOAD_PROPERTY_DLURL_LABEL</label> <type>autodownloadurl</type> ! <value>http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab</value> </skeletonProperties> <skeletonProperties> --- 20,24 ---- <label>SKEL_AUTODOWNLOAD_PROPERTY_DLURL_LABEL</label> <type>autodownloadurl</type> ! <value>http://java.sun.com/update/1.5.0/jinstall-1_5_0_11-windows-i586.cab</value> </skeletonProperties> <skeletonProperties> |
From: Rodrigo R. <re...@us...> - 2007-05-01 19:40:25
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9102/winservice Modified Files: WinService.cpp Log Message: adds exit code propagation when exe-run Index: WinService.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/WinService.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WinService.cpp 30 Apr 2007 20:54:32 -0000 1.5 --- WinService.cpp 1 May 2007 19:40:16 -0000 1.6 *************** *** 287,290 **** --- 287,295 ---- JavaMachineManager man(*globalResMan); + man.setAcceptExe(false); + man.setAcceptDLL(true); + man.setUseConsole(false); + man.setPreferDLL(true); + setStatus(SERVICE_RUNNING); SunJVMLauncher* launcher = man.runDLLFromRegistry(true); *************** *** 300,304 **** if (jdll != 0) { ! jdll->run( globalResMan->getProperty(ResourceManager::KEY_MAINCLASSNAME), false); } else --- 305,309 ---- if (jdll != 0) { ! jdll->run( globalResMan->getProperty(ResourceManager::KEY_MAINCLASSNAME), true); } else |
From: Rodrigo R. <re...@us...> - 2007-05-01 19:40:23
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/simplewrap In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9102/simplewrap Modified Files: main.cpp Log Message: adds exit code propagation when exe-run Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/main.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** main.cpp 30 Apr 2007 20:54:32 -0000 1.27 --- main.cpp 1 May 2007 19:40:16 -0000 1.28 *************** *** 68,76 **** } ! std::string dodebug = globalResMan->getProperty("skel_Debug"); ! if ((StringUtils::parseInt(dodebug) != 0) && (DEBUGCONSOLE==0)) ! { ! DEBUGCONSOLE = new DebugConsole("JSmooth Debug"); ! } if (DEBUGCONSOLE!=0) --- 68,78 ---- } ! ! bool dodebug = globalResMan->getBooleanProperty("skel_Debug"); ! ! if (dodebug) ! { ! DEBUGCONSOLE = new DebugConsole("JSmooth Debug"); ! } if (DEBUGCONSOLE!=0) *************** *** 87,96 **** JavaMachineManager man(*globalResMan); ! std::string preferDLLstr = globalResMan->getProperty("skel_SingleProcess"); ! bool preferDLL = false; ! if (StringUtils::parseInt(preferDLLstr) > 0) ! preferDLL = true; ! if (man.run(true, preferDLL) == false) { DEBUG("Displaying error message to user..."); --- 89,101 ---- JavaMachineManager man(*globalResMan); ! man.setAcceptExe(true); ! man.setAcceptDLL(true); ! if (dodebug) ! man.setUseConsole(true); ! else ! man.setUseConsole(false); ! man.setPreferDLL(globalResMan->getBooleanProperty("skel_SingleProcess")); ! if (man.run() == false) { DEBUG("Displaying error message to user..."); |
Update of /cvsroot/jsmooth/jsmooth/skeletons/commonjava In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9102/commonjava Modified Files: JavaMachineManager.cpp JavaMachineManager.h ResourceManager.cpp SunJVMExe.cpp SunJVMExe.h SunJVMLauncher.cpp SunJVMLauncher.h Log Message: adds exit code propagation when exe-run Index: SunJVMExe.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMExe.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SunJVMExe.h 28 Apr 2007 08:43:43 -0000 1.1 --- SunJVMExe.h 1 May 2007 19:40:16 -0000 1.2 *************** *** 41,44 **** --- 41,45 ---- std::string m_jrehome; Version m_version; + int m_exitCode; public: *************** *** 53,56 **** --- 54,59 ---- std::string getClassPath(bool full); + int getExitCode(); + private: }; Index: SunJVMLauncher.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMLauncher.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** SunJVMLauncher.h 30 Apr 2007 20:54:32 -0000 1.13 --- SunJVMLauncher.h 1 May 2007 19:40:16 -0000 1.14 *************** *** 81,84 **** --- 81,86 ---- SunJVMExe* m_exerunner; SunJVMDLL* m_dllrunner; + + int m_exitCode; /** *************** *** 122,125 **** --- 124,131 ---- friend bool operator < (const SunJVMLauncher& v1, const SunJVMLauncher& v2); + + int getExitCode(); + + bool runExe(const string& exepath, bool forceFullClasspath, ResourceManager& resource, bool noConsole, const std::string& version, const string& origin); Index: JavaMachineManager.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/JavaMachineManager.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JavaMachineManager.h 9 Apr 2007 17:18:16 -0000 1.5 --- JavaMachineManager.h 1 May 2007 19:40:16 -0000 1.6 *************** *** 54,57 **** --- 54,64 ---- ResourceManager& m_resman; + int m_exitCode; + + bool m_useConsole; + bool m_acceptExe; + bool m_acceptDLL; + bool m_preferDLL; + public: /** *************** *** 63,66 **** --- 70,77 ---- JavaMachineManager(ResourceManager& resman) ; + void setUseConsole(bool useConsole); + void setAcceptExe(bool acceptExe); + void setAcceptDLL(bool acceptDLL); + void setPreferDLL(bool prefDLL); /** *************** *** 88,97 **** * @return true if the application is successfully started, false otherwise. */ ! bool run(bool noConsole, bool preferSingleProcess); SunJVMLauncher* runDLLFromRegistry(bool justInstanciate=false); protected: ! bool internalRun(SunJVMLauncher& launcher, bool noConsole, bool preferSingleProcess, const string& org); }; --- 99,110 ---- * @return true if the application is successfully started, false otherwise. */ ! bool run(); SunJVMLauncher* runDLLFromRegistry(bool justInstanciate=false); + int getExitCode(); + protected: ! bool internalRun(SunJVMLauncher& launcher, const string& org); }; Index: JavaMachineManager.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/JavaMachineManager.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** JavaMachineManager.cpp 28 Apr 2007 08:43:43 -0000 1.17 --- JavaMachineManager.cpp 1 May 2007 19:40:16 -0000 1.18 *************** *** 29,32 **** --- 29,37 ---- m_jrepathVm = JVMEnvVarLookup::lookupJVM("JRE_HOME"); m_jdkpathVm = JVMEnvVarLookup::lookupJVM("JDK_HOME"); + m_exitCode = -1; + m_useConsole = true; + m_acceptExe = true; + m_acceptDLL = true; + m_preferDLL = false; if (resman.getProperty("bundledvm").length() > 0) *************** *** 43,47 **** } ! bool JavaMachineManager::run(bool dontUseConsole, bool preferSingleProcess) { string vmorder = m_resman.getProperty(ResourceManager::KEY_JVMSEARCH); --- 48,52 ---- } ! bool JavaMachineManager::run() { string vmorder = m_resman.getProperty(ResourceManager::KEY_JVMSEARCH); *************** *** 49,58 **** if (m_localVMenabled) { ! DEBUG("Trying to use bundled VM " + m_localVM.JavaHome); ! if (m_localVM.runProc(m_resman, dontUseConsole, "bundled")) ! return true; ! ! if (m_localVM.run(m_resman, "bundled")) ! return true; } --- 54,66 ---- if (m_localVMenabled) { ! DEBUG("Trying to use bundled VM " + m_localVM.JavaHome); ! if (m_localVM.runProc(m_resman, m_useConsole, "bundled")) ! { ! m_exitCode = m_localVM.getExitCode(); ! return true; ! } ! ! if (m_localVM.run(m_resman, "bundled")) ! return true; } *************** *** 88,141 **** DEBUG("- Trying registry: " + m_registryVms[i].toString()); ! if (internalRun(m_registryVms[i], dontUseConsole, preferSingleProcess, "registry") == true) return true; DEBUG("Couldn't use this VM, now trying something else"); } ! } else if (*i == "jview") ! { ! DEBUG("- Trying to launch the application with JVIEW"); ! if (m_jviewVm.runProc(m_resman, dontUseConsole)) ! { ! return true; ! } ! ! } else if (*i == "javahome") { ! DEBUG("- Trying to use JAVAHOME"); ! if (m_javahomeVm.size()>0) ! { ! DEBUG("JAVAHOME exists..." + m_javahomeVm[0].toString()); ! if (internalRun(m_javahomeVm[0], dontUseConsole, preferSingleProcess, "jrehome")) ! return true; ! } ! } else if (*i == "jrepath") ! { ! DEBUG("- Trying to use JRE_HOME"); ! if (m_jrepathVm.size()>0) ! { ! if (internalRun(m_jrepathVm[0], dontUseConsole, preferSingleProcess, "jrehome")) ! return true; ! } ! } else if (*i == "exepath") ! { ! DEBUG("- Trying to use PATH"); ! SunJVMLauncher launcher; ! return launcher.runProc(m_resman, ! dontUseConsole, "path"); ! ! // string exename = dontUseConsole?"javaw.exe":"java.exe"; ! // SunJVMLauncher launcher; ! // launcher.VmVersion = launcher.guessVersionByProcess("java.exe"); ! // if (launcher.VmVersion.isValid() ! // && (!min.isValid() || (min <= launcher.VmVersion)) ! // && (!max.isValid() || (launcher.VmVersion <= max))) ! // { ! // DEBUG("Found valid java machine " + exename + " on PATH (" + launcher.VmVersion.toString() + ")"); ! // Version v12("1.2.0"); ! // if (launcher.runExe(exename, false, m_resman, dontUseConsole, (launcher.VmVersion<v12)?"1.1":"1.2", "path")) ! // return true; ! // } ! } } --- 96,137 ---- DEBUG("- Trying registry: " + m_registryVms[i].toString()); ! if (internalRun(m_registryVms[i], "registry") == true) return true; + DEBUG("Couldn't use this VM, now trying something else"); } ! } ! else if ((*i == "jview") && m_acceptExe) ! { ! DEBUG("- Trying to launch the application with JVIEW"); ! if (m_jviewVm.runProc(m_resman, ! m_useConsole)) { ! return true; ! } ! } ! else if ((*i == "javahome") && (m_javahomeVm.size()>0)) ! { ! DEBUG("- Trying to use JAVAHOME"); ! if (internalRun(m_javahomeVm[0], "jrehome")) ! return true; ! } ! else if ((*i == "jrepath") && (m_jrepathVm.size()>0)) ! { ! DEBUG("- Trying to use JRE_HOME"); ! if (internalRun(m_jrepathVm[0], "jrehome")) ! return true; ! } ! else if (*i == "exepath") ! { ! DEBUG("- Trying to use PATH"); ! SunJVMLauncher launcher; ! if (launcher.runProc(m_resman, m_useConsole, "path")) ! { ! m_exitCode = m_localVM.getExitCode(); ! return true; ! } ! } } *************** *** 145,185 **** ! bool JavaMachineManager::internalRun(SunJVMLauncher& launcher, bool noConsole, bool preferSingleProcess, const string& org) { ! // Need a console, and spawning a process is OK ? Then exec ! // [java/jre].exe. ! if ((noConsole == false) && (preferSingleProcess==false)) ! { ! return launcher.runProc(m_resman, noConsole, org); ! } ! ! // No need for a console, and need a single process ? Use the DLL ! // and create a JVM with it ! if (noConsole && preferSingleProcess) { ! DEBUG("Trying to run the JVM as a DLL call (executing in this process)..."); ! if (launcher.run(m_resman, org) == true) return true; - - DEBUG("Couldn't use the DLL at " + launcher.RuntimeLibPath); } ! // If we have an embedded jar, always prefer the exec process ! // launching, as it garantees that the temporary jar is cleaned up ! // on exit (due to a bug in the JVM DLL that prevents it to ! // terminate nicely). ! if (m_resman.useEmbeddedJar()) { ! if (launcher.runProc(m_resman, noConsole, org) == false) ! return launcher.run(m_resman, org); } ! else // Otherwise, preferring the JVM DLL call first is better ! // (it spares a new process) { ! if (launcher.run(m_resman, org) == false) ! return launcher.runProc(m_resman, noConsole, org); } ! ! return true; } --- 141,168 ---- ! bool JavaMachineManager::internalRun(SunJVMLauncher& launcher, const string& org) { ! if (m_acceptDLL && m_preferDLL) { ! if (launcher.run(m_resman, org)) return true; } ! if (m_acceptExe) { ! if (launcher.runProc(m_resman, m_useConsole, org)) ! { ! m_exitCode = m_localVM.getExitCode(); ! return true; ! } } ! ! if (m_acceptDLL && !m_preferDLL) { ! if (launcher.run(m_resman, org)) ! return true; } ! ! return false; } *************** *** 208,209 **** --- 191,217 ---- return NULL; } + + void JavaMachineManager::setUseConsole(bool useConsole) + { + m_useConsole = useConsole; + } + + void JavaMachineManager::setAcceptExe(bool acceptExe) + { + m_acceptExe = acceptExe; + } + + void JavaMachineManager::setAcceptDLL(bool acceptDLL) + { + m_acceptDLL = acceptDLL;; + } + + void JavaMachineManager::setPreferDLL(bool prefDLL) + { + m_preferDLL = prefDLL; + } + + int JavaMachineManager::getExitCode() + { + return m_exitCode; + } Index: ResourceManager.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/ResourceManager.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ResourceManager.cpp 28 Apr 2007 08:43:43 -0000 1.22 --- ResourceManager.cpp 1 May 2007 19:40:16 -0000 1.23 *************** *** 191,198 **** bool ResourceManager::getBooleanProperty(const std::string& key) const { ! std::string prop = getProperty(key); if (StringUtils::parseInt(prop)==1) return true; return false; } --- 191,202 ---- bool ResourceManager::getBooleanProperty(const std::string& key) const { ! std::string prop = getProperty(key, "0"); ! if (StringUtils::parseInt(prop)==1) return true; + if (StringUtils::toLowerCase(prop) == "true") + return true; + return false; } Index: SunJVMLauncher.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMLauncher.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** SunJVMLauncher.cpp 30 Apr 2007 20:54:32 -0000 1.27 --- SunJVMLauncher.cpp 1 May 2007 19:40:16 -0000 1.28 *************** *** 122,126 **** } ! bool SunJVMLauncher::runProc(ResourceManager& resource, bool noConsole, const string& origin) { std::string classname = resource.getProperty(string(ResourceManager::KEY_MAINCLASSNAME)); --- 122,126 ---- } ! bool SunJVMLauncher::runProc(ResourceManager& resource, bool useConsole, const string& origin) { std::string classname = resource.getProperty(string(ResourceManager::KEY_MAINCLASSNAME)); *************** *** 151,155 **** SunJVMExe exe(this->JavaHome, VmVersion); setupVM(resource, &exe); ! return exe.run(classname, !noConsole); } --- 151,160 ---- SunJVMExe exe(this->JavaHome, VmVersion); setupVM(resource, &exe); ! if (exe.run(classname, useConsole)) ! { ! m_exitCode = exe.getExitCode(); ! return true; ! } ! return false; } *************** *** 204,207 **** --- 209,217 ---- } + int SunJVMLauncher::getExitCode() + { + return m_exitCode; + } + // bool SunJVMLauncher::setupVM12DLL(ResourceManager& resource, const string& origin) Index: SunJVMExe.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMExe.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SunJVMExe.cpp 28 Apr 2007 08:43:43 -0000 1.1 --- SunJVMExe.cpp 1 May 2007 19:40:16 -0000 1.2 *************** *** 94,97 **** --- 94,98 ---- DEBUG("Started successfully"); proc.join(); + m_exitCode = proc.getExitCode(); return true; } *************** *** 210,211 **** --- 211,217 ---- return StringUtils::join(cp, ";"); } + + int SunJVMExe::getExitCode() + { + return m_exitCode; + } |
From: Rodrigo R. <re...@us...> - 2007-05-01 19:40:21
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/consolewrapper In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9102/consolewrapper Modified Files: main.cpp Log Message: adds exit code propagation when exe-run Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/consolewrapper/main.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** main.cpp 30 Apr 2007 20:54:32 -0000 1.18 --- main.cpp 1 May 2007 19:40:16 -0000 1.19 *************** *** 72,77 **** SetCurrentDirectory(newcurdir.c_str()); JavaMachineManager man(*globalResMan); ! if (man.run(false, false) == false) { std::string errmsg = globalResMan->getProperty("skel_Message"); --- 72,83 ---- SetCurrentDirectory(newcurdir.c_str()); + int retvalue = -1; + JavaMachineManager man(*globalResMan); ! man.setAcceptExe(true); ! man.setAcceptDLL(false); ! man.setUseConsole(true); ! ! if (man.run() == false) { std::string errmsg = globalResMan->getProperty("skel_Message"); *************** *** 79,82 **** --- 85,92 ---- cerr << "\r\n"; } + else + { + retvalue = man.getExitCode(); + } int waitkey = atoi(globalResMan->getProperty("skel_PressKey").c_str()); *************** *** 87,91 **** delete globalResMan; ! return 0; } --- 97,101 ---- delete globalResMan; ! return retvalue; } |