jsmooth-cvs Mailing List for JSmooth (Page 6)
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-04-12 20:01:57
|
Update of /cvsroot/jsmooth/jsmooth/src/locale In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12205/src/locale Modified Files: Texts.properties Texts_fr.properties Log Message: Windows service wrapper update Index: Texts.properties =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/locale/Texts.properties,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Texts.properties 7 Apr 2007 21:26:44 -0000 1.11 --- Texts.properties 12 Apr 2007 20:01:50 -0000 1.12 *************** *** 113,116 **** --- 113,137 ---- SKEL_SIMPLEWRAPPER_PROPERTY_URL_LABEL=URL # + + # + # + SKEL_WINSERVICE_DESCRIPTION=This skeleton wraps <b>Windows Services</b>.\ + <ul><li>The wrapper is a standard Windows Service <li>The JVM is instanciated with the native DLL, which means that the service does not appear as a generic "java" process in the task list, but with the name of the executable <li>No console I/O is displayed, but a logfile is available <li>If no Java VM is found, a pop-up alert is displayed to the user. </ul> \ + This wrapper turns your java application into a Windows service. The behaviour of this wrapper is very simple, the main class of your application is called when the service starts, and the application exits when the service is stopped. <p> When the application stops, a call to System.exit() is done by the wrapper, so that your program can save its state (if necessary) by using a shutdown hook (see <tt>Runtime.addShutdownHook()</tt>). + SKEL_WINSERVICE_NAME_LABEL=Service name + SKEL_WINSERVICE_NAME_DESCRIPTION=An internal name for the windows service. Its maximum length is 256 characters, and must not contain slash or backslash characters. This field is mandatory. + SKEL_WINSERVICE_DISPLAYNAME_LABEL=Display name + SKEL_WINSERVICE_DISPLAYNAME_DESCRIPTION=The name displayed for this service by user interface programs. If not set, the internal name is used. + SKEL_WINSERVICE_DESCRIPTION_LABEL=Description + SKEL_WINSERVICE_DESCRIPTION_DESCRIPTION=Specify here a description of the service, to be displayed by user interface programs. + SKEL_WINSERVICE_PROPERTY_MESSAGE_LABEL=JVM-not-found message + SKEL_WINSERVICE_PROPERTY_MESSAGE_DESCRIPTION=This message is displayed as an alert box to the user if no JVM is found on the user's computer. <p> This message is only displayed when the service starts, as the installation process does not required any JVM. + SKEL_WINSERVICE_AUTOSTART_LABEL=Autostart service + SKEL_WINSERVICE_AUTOSTART_DESCRIPTION=Enable this option to have the service started automatically at system startup. <p>If this option is disabled, the service must be started manually by the user. + SKEL_WINSERVICE_LOGFILE_LABEL=Logfile + SKEL_WINSERVICE_LOGFILE_DESCRIPTION=Specify here a name for the logfile of the service. This logfile is located in the same directory than the executable binary. + SKEL_WINSERVICE_INTERACTIVE_LABEL=Interactive service + SKEL_WINSERVICE_INTERACTIVE_DESCRIPTION=Enable this value if the service shall be allowed by Windows to operate interactions with the desktop. <p> For security reasons, Microsoft recommands to use a client-server approach to add a GUI to a service. <p> If this option is not enabled, the application will not be able to create windows or use the desktop. Note also that if your service starts at startup, the desktop may not be available. + # GENERAL_CANTOPENFILE=The JSmooth application couldn't open the file specified Index: Texts_fr.properties =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/locale/Texts_fr.properties,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Texts_fr.properties 7 Apr 2007 09:51:50 -0000 1.6 --- Texts_fr.properties 12 Apr 2007 20:01:50 -0000 1.7 *************** *** 111,114 **** --- 111,135 ---- SKEL_SIMPLEWRAPPER_PROPERTY_URL_DESCRIPTION=Si l'utilisateur répond positivement, son navigateur est lancé sur cette URL. L'URL doit commencer par <tt>http://...</tt> SKEL_SIMPLEWRAPPER_PROPERTY_URL_LABEL=URL + + # + # + SKEL_WINSERVICE_DESCRIPTION=Ce squelette permet de lancer des <b>Services Windows</b> \ + <ul><li>Le lanceur est un service Windows standard <li>La JVM est instanciée en utilisant la DLL native, par conséquent le service apparait sous son nom d'exécutable dans la liste des tâches de Windows (et non sous une appellation générique "java.exe") <li> Aucune console d'E/S n'est affichée, mais un fichier de logs est disponible <li> Si java n'est pas trouvé, une alerte de type pop-up est affichée à l'utilisateur. </ul> \ + Ce lanceur transforme votre application java en service windows. Son comportement est très simple, la classe principale (contenant une méthode statique "main") est appelé lorsque le service démarre, et l'application se termine lorsque le service se met à l'arret. <p> Lors de l'arret, le lanceur appelle la méthode <tt>java.lang.System.exit()</tt>, ce qui permet à l'application de quitter proprement en utilisant un hook d'arrêt (voir <tt>Runtime.addShutdownHook()</tt>). + SKEL_WINSERVICE_NAME_LABEL=Nom du service + SKEL_WINSERVICE_NAME_DESCRIPTION=Un nom interne utilisé pour le service Windows. La taille maximale du nom est de 256 caractères, et il ne doit comporter ni slash ni anti-slash. Ce champ est obligatoire. + SKEL_WINSERVICE_DISPLAYNAME_LABEL=Nom d'affichage + SKEL_WINSERVICE_DISPLAYNAME_DESCRIPTION=Le contenu de ce champ est affiché par les interfaces graphiques de Windows qui listent les services. S'il n'est pas défini, c'est le nom interne du service qui est utilisé. + SKEL_WINSERVICE_DESCRIPTION_LABEL=Description + SKEL_WINSERVICE_DESCRIPTION_DESCRIPTION=Specify here a description of the service, to be displayed by user interface programs. + SKEL_WINSERVICE_PROPERTY_MESSAGE_LABEL=Message Java non-trouvé + SKEL_WINSERVICE_PROPERTY_MESSAGE_DESCRIPTION=Ce message s'affiche dans une pop-up d'alerte lorsque le lanceur tente de démarrer l'application, mais qu'aucune JVM n'est disponible sur l'ordinateur de l'utilisateur. <p> The message ne s'affiche qu'au démarrage du service, l'installation ne nécessitant pas de JVM pour fonctionner. + SKEL_WINSERVICE_AUTOSTART_LABEL=Démarrage auto + SKEL_WINSERVICE_AUTOSTART_DESCRIPTION=Activez cette option si vous souhaitez que votre service soit automatiquement démarré par Windows lors du démarrage du système. <p> Si cette option est déactivée, le service devra être lancé manuellement. + SKEL_WINSERVICE_LOGFILE_LABEL=Fichier de logs + SKEL_WINSERVICE_LOGFILE_DESCRIPTION=Définissez ici le nom du fichier de logs du service. The fichier est toujours situé dans le même répertoire que l'exécutable. + SKEL_WINSERVICE_INTERACTIVE_LABEL=Service interactif + SKEL_WINSERVICE_INTERACTIVE_DESCRIPTION=Activez cette option si votre service doit être autorisé par Windows à effectuer des interactions graphiques avec le bureau de l'utilisateur. <p> Pour des raisons des sécurité, Microsoft recommande de plutôt utiliser une approche client-serveur pour rajouter une interface graphique au service. Notez également que si votre service se lance automatiquement au démarrage du système, le bureau peut ne pas être disponible pour l'application. + # GENERAL_CANTOPENFILE=JSmooth n'a pas pu ouvrir le fichier demandé |
From: Rodrigo R. <re...@us...> - 2007-04-12 20:01:57
|
Update of /cvsroot/jsmooth/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12205 Modified Files: Changelog build.number build.xml Log Message: Windows service wrapper update Index: build.number =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/build.number,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** build.number 7 Apr 2007 21:43:37 -0000 1.32 --- build.number 12 Apr 2007 20:01:49 -0000 1.33 *************** *** 1,3 **** #Build Number for ANT. Do not edit! ! #Sat Apr 07 23:33:08 CEST 2007 ! build.number=191 --- 1,3 ---- #Build Number for ANT. Do not edit! ! #Thu Apr 12 21:58:32 CEST 2007 ! build.number=202 Index: build.xml =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/build.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** build.xml 6 Apr 2007 16:27:10 -0000 1.35 --- build.xml 12 Apr 2007 20:01:49 -0000 1.36 *************** *** 30,34 **** <!-- set here the properties specific the release --> ! <property name="VERSION" value="0.9.9-4"/> <!-- You should need to modify the properties below --> --- 30,34 ---- <!-- set here the properties specific the release --> ! <property name="VERSION" value="0.9.9-5"/> <!-- You should need to modify the properties below --> *************** *** 233,236 **** --- 233,237 ---- <include name="**/*.properties"/> </replace> + <antcall target="docs"> <param name="docs" value="${tmp}/docs"/> *************** *** 261,264 **** --- 262,266 ---- <mkdir dir="${dist}/skeletons/console-wrapper"/> <mkdir dir="${dist}/skeletons/autodownload-wrapper"/> + <mkdir dir="${dist}/skeletons/winservice-wrapper"/> <antcall target="compileskels"> <param name="skelflags" value=""/> *************** *** 271,274 **** --- 273,278 ---- <copy todir="${dist}/skeletons/autodownload-wrapper" file="skeletons/autodownload/customdownload.skel"/> <copy todir="${dist}/skeletons/autodownload-wrapper" file="skeletons/autodownload/autodownload.exe"/> + <copy todir="${dist}/skeletons/winservice-wrapper" file="skeletons/winservice/description.skel"/> + <copy todir="${dist}/skeletons/winservice-wrapper" file="skeletons/winservice/winservice.exe"/> <exec executable="${mingw-strip}" dir="${dist}/skeletons/console-wrapper"> *************** *** 281,284 **** --- 285,291 ---- <arg value="autodownload.exe"/> </exec> + <exec executable="${mingw-strip}" dir="${dist}/skeletons/winservice-wrapper"> + <arg value="winservice.exe"/> + </exec> <!-- Builds the jsmooth executable --> *************** *** 398,406 **** <pathelement path="${jsmoothjar}"/> </classpath> ! <arg value="sample/sample.jsmooth"/> </java> </target> - <target name="runskeletoneditor" depends="jar"> <java classname="net.charabia.jsmoothgen.skeleton.SkeletonEditor" fork="yes" > --- 405,412 ---- <pathelement path="${jsmoothjar}"/> </classpath> ! <arg value="c:/temp/test/testservice.jsmooth"/> </java> </target> <target name="runskeletoneditor" depends="jar"> <java classname="net.charabia.jsmoothgen.skeleton.SkeletonEditor" fork="yes" > Index: Changelog =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/Changelog,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Changelog 7 Apr 2007 21:26:44 -0000 1.34 --- Changelog 12 Apr 2007 20:01:49 -0000 1.35 *************** *** 1,2 **** --- 1,5 ---- + 0.9.9-5 + - Adds new wrapper for windows services + 0.9.9-4 (2007-04-07) - Fixed bug #1694330: Working directory handled incorrectly. |
From: Rodrigo R. <re...@us...> - 2007-04-12 20:01:57
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/samplejar In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12205/skeletons/samplejar Modified Files: sample.props Log Message: Windows service wrapper update Index: sample.props =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/samplejar/sample.props,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sample.props 1 Apr 2007 22:18:06 -0000 1.3 --- sample.props 12 Apr 2007 20:01:50 -0000 1.4 *************** *** 3,7 **** classpath= jvmsearch=registry;jview;javahome;jrepath;jdkpath;exepath; ! minversion=1.9 maxversion= currentdir= --- 3,7 ---- classpath= jvmsearch=registry;jview;javahome;jrepath;jdkpath;exepath; ! minversion=1.1 maxversion= currentdir= |
From: Rodrigo R. <re...@us...> - 2007-04-12 20:01:57
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice/sample/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12205/skeletons/winservice/sample/src Modified Files: AlertServer.java Log Message: Windows service wrapper update Index: AlertServer.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/sample/src/AlertServer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AlertServer.java 9 Apr 2007 22:21:23 -0000 1.2 --- AlertServer.java 12 Apr 2007 20:01:50 -0000 1.3 *************** *** 33,37 **** fw.write(line + "\n"); if (line.startsWith("EXIT")) ! System.exit(0); fw.close(); JOptionPane.showMessageDialog(null, line, "alert", JOptionPane.ERROR_MESSAGE); --- 33,41 ---- fw.write(line + "\n"); if (line.startsWith("EXIT")) ! { ! System.out.println("calling System.exit(0);"); ! System.exit(0); ! return; ! } fw.close(); JOptionPane.showMessageDialog(null, line, "alert", JOptionPane.ERROR_MESSAGE); *************** *** 63,67 **** { try { - while (true) { --- 67,70 ---- *************** *** 95,103 **** public void run() { System.out.println("SHUTDOWN..."); a.shutdown(); } }); ! a.setup(); a.listen(); --- 98,115 ---- public void run() { + // JOptionPane.showMessageDialog(null, "TERMINATING!", "alert", JOptionPane.ERROR_MESSAGE); + try { + FileWriter fw = new FileWriter("shutdown1.log", true); + fw.write("END NOW " + System.currentTimeMillis() + "\n"); + fw.close(); + } catch (Exception exc) + { + exc.printStackTrace(); + } System.out.println("SHUTDOWN..."); a.shutdown(); } }); ! a.setup(); a.listen(); |
From: Rodrigo R. <re...@us...> - 2007-04-12 20:01:56
|
Update of /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/gui In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12205/src/net/charabia/jsmoothgen/application/gui Modified Files: Editor.java Log Message: Windows service wrapper update Index: Editor.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/gui/Editor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Editor.java 6 Apr 2007 16:27:10 -0000 1.3 --- Editor.java 12 Apr 2007 20:01:51 -0000 1.4 *************** *** 70,74 **** return false; } ! public boolean useDescription() { --- 70,74 ---- return false; } ! public boolean useDescription() { |
From: Rodrigo R. <re...@us...> - 2007-04-12 20:01:55
|
Update of /cvsroot/jsmooth/jsmooth/sample In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12205/sample Modified Files: sample.jsmooth Log Message: Windows service wrapper update Index: sample.jsmooth =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/sample/sample.jsmooth,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sample.jsmooth 1 Mar 2007 22:08:32 -0000 1.9 --- sample.jsmooth 12 Apr 2007 20:01:50 -0000 1.10 *************** *** 7,11 **** <JVMSearchPath>exepath</JVMSearchPath> <JVMSearchPath>jview</JVMSearchPath> - <arguments></arguments> <embeddedJar>true</embeddedJar> <executableName>Sample.exe</executableName> --- 7,10 ---- *************** *** 40,44 **** <maximumVersion></maximumVersion> <minimumVersion>1.1</minimumVersion> ! <skeletonName>Console Wrapper</skeletonName> <skeletonProperties> <key>Message</key> --- 39,43 ---- <maximumVersion></maximumVersion> <minimumVersion>1.1</minimumVersion> ! <skeletonName>Autodownload Wrapper</skeletonName> <skeletonProperties> <key>Message</key> *************** *** 47,51 **** </skeletonProperties> <skeletonProperties> ! <key>PressKey</key> <value>0</value> </skeletonProperties> --- 46,54 ---- </skeletonProperties> <skeletonProperties> ! <key>DownloadURL</key> ! <value>http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab</value> ! </skeletonProperties> ! <skeletonProperties> ! <key>SingleProcess</key> <value>0</value> </skeletonProperties> |
From: Rodrigo R. <re...@us...> - 2007-04-12 20:01:54
|
Update of /cvsroot/jsmooth/jsmooth/docs In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12205/docs Modified Files: jsmooth-doc.xml Log Message: Windows service wrapper update Index: jsmooth-doc.xml =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/docs/jsmooth-doc.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** jsmooth-doc.xml 2 Apr 2007 19:42:50 -0000 1.19 --- jsmooth-doc.xml 12 Apr 2007 20:01:50 -0000 1.20 *************** *** 1305,1308 **** --- 1305,1370 ---- + <qandaentry> + <question> + <para> + How do I convert my java application into a Windows service ? + </para> + </question> + + <answer> + <para> + There is nothing much to do to make a service from a java + application. Just select the "Windows Service" wrapper, and + build your executable as you would do for a standard application.</para> + + <para> + The behaviour of the service wrapper is very simple: + </para> + + <itemizedlist> + <listitem> + <para> First, you have to register the service in the + Windows environement. Just run + <function>your-app.exe install</function>. Once + this is done, you can see the service added to the + list of services available on the computer (look + for a Services program in the Administration tools + of Windows). + </para> + </listitem> + + <listitem> + <para> Then you can start or stop your service, by + calling the executable with the "start" or "stop" + arguments (only the first argument of the command line + is taken into account). If the "autostart" option is + enabled, the service will be automatically when Windows + is started. + </para> + </listitem> + + <listitem> + <para> To uninstall the service, simply run the + executable as <function>your-app.exe uninstall</function>, that's all. + </para> + </listitem> + + <listitem> + + <para> The JVM is started and your application launched + when the the service starts. The JVM is stopped when the + services stops (obviously). Note however that you can + exit cleanly, as <function>System.exit(0)</function> is + called by the wrapper right before exiting: just add a + shutdown hook + (<function>Runtime.addShutdownHook()</function>) and + you're safe. </para> + </listitem> + + </itemizedlist> + + </answer> + </qandaentry> + </qandaset> </sect2> *************** *** 1321,1325 **** <para> The MSVCRT.DLL file is required by the wrapped application ! but may be missing on some Windows 95 computers that have never been upgraded. This file is often installed by third-party application, but it may happen that your users --- 1383,1387 ---- <para> The MSVCRT.DLL file is required by the wrapped application ! but may be missing on some early Windows 95 computers that have never been upgraded. This file is often installed by third-party application, but it may happen that your users *************** *** 1338,1341 **** --- 1400,1426 ---- </qandaset> + <qandaset> + <qandaentry> + <question> + <para> + Something goes wrong at launch-time, and the wrapper won't start my java application. How can I investigate? + </para> + </question> + <answer> + + <para> + The first thing to do, is to run the wrapper with the + additional argument <function>-JskelDebug=1</function> (the + option is case-sensitive). This will start the wrapper in + debug mode, displaying a console (or using the current one, + for the console wrapper), and output many useful + information. + </para> + + </answer> + </qandaentry> + + </qandaset> + </sect2> |
From: Rodrigo R. <re...@us...> - 2007-04-09 22:22:04
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2430 Modified Files: Makefile.win WinService.cpp WinService.h description.skel main.cpp Log Message: Index: description.skel =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/description.skel,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** description.skel 9 Apr 2007 17:20:46 -0000 1.1 --- description.skel 9 Apr 2007 22:21:23 -0000 1.2 *************** *** 9,25 **** <shortName>WinService Wrapper</shortName> <skeletonProperties> ! <description>SKEL_CUSTOMWRAPPER_PROPERTY_MESSAGE_DESCRIPTION</description> <idName>Message</idName> ! <label>SKEL_CUSTOMWRAPPER_PROPERTY_MESSAGE_LABEL</label> <type>textarea</type> ! <value>This program needs Java to run. ! Please download it at http://www.java.com</value> </skeletonProperties> <skeletonProperties> ! <description>SKEL_CUSTOMWRAPPER_PROPERTY_KEYPRESS_DESCRIPTION</description> ! <idName>PressKey</idName> ! <label>SKEL_CUSTOMWRAPPER_PROPERTY_KEYPRESS_LABEL</label> <type>boolean</type> ! <value>0</value> </skeletonProperties> <skeletonProperties> --- 9,52 ---- <shortName>WinService Wrapper</shortName> <skeletonProperties> ! <description>SKEL_WINSERVICE_NAME_DESCRIPTION</description> ! <idName>ServiceName</idName> ! <label>SKEL_WINSERVICE_NAME_LABEL</label> ! <type>string</type> ! <value>myservice</value> ! </skeletonProperties> ! <skeletonProperties> ! <description>SKEL_WINSERVICE_DISPLAYNAME_DESCRIPTION</description> ! <idName>ServiceDisplayName</idName> ! <label>SKEL_WINSERVICE_DISPLAYNAME_LABEL</label> ! <type>string</type> ! <value>My Service</value> ! </skeletonProperties> ! <skeletonProperties> ! <description>SKEL_WINSERVICE_DESCRIPTION_DESCRIPTION</description> ! <idName>ServiceDescription</idName> ! <label>SKEL_WINSERVICE_DESCRIPTION_LABEL</label> ! <type>textarea</type> ! <value>A description of the service</value> ! </skeletonProperties> ! <skeletonProperties> ! <description>SKEL_WINSERVICE_PROPERTY_MESSAGE_DESCRIPTION</description> <idName>Message</idName> ! <label>SKEL_WINSERVICE_PROPERTY_MESSAGE_LABEL</label> <type>textarea</type> ! <value>This program needs Java to run. Please download it at http://www.java.comf</value> </skeletonProperties> <skeletonProperties> ! <description>SKEL_WINSERVICE_AUTOSTART_DESCRIPTION</description> ! <idName>Autostart</idName> ! <label>SKEL_WINSERVICE_AUTOSTART_LABEL</label> <type>boolean</type> ! <value>1</value> ! </skeletonProperties> ! <skeletonProperties> ! <description>SKEL_WINSERVICE_LOGFILE_DESCRIPTION</description> ! <idName>Logfile</idName> ! <label>SKEL_WINSERVICE_LOGFILE_LABEL</label> ! <type>string</type> ! <value>service.log</value> </skeletonProperties> <skeletonProperties> Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.cpp 9 Apr 2007 21:46:59 -0000 1.2 --- main.cpp 9 Apr 2007 22:21:23 -0000 1.3 *************** *** 57,63 **** std::string autostart = resman.getProperty("skel_Autostart"); ! fflush(stdout); ! WinService winserv(serviceName); winserv.setDisplayName(serviceDisplayName); winserv.setDescription(serviceDescription); --- 57,65 ---- std::string autostart = resman.getProperty("skel_Autostart"); ! std::string logfile = resman.getProperty("skel_Logile"); ! if (logfile == "") ! logfile = "service.log"; ! WinService winserv(serviceName, logfile); winserv.setDisplayName(serviceDisplayName); winserv.setDescription(serviceDescription); Index: Makefile.win =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/Makefile.win,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.win 9 Apr 2007 17:15:50 -0000 1.1 --- Makefile.win 9 Apr 2007 22:21:23 -0000 1.2 *************** *** 11,15 **** LIBS = -L"/lib" -L"../commonjava" -L"../util-core" ../commonjava/CommonJava.a ../util-core/util-core.a INCS = -I"/include" -I"../util-core" -I"../commonjava" -I"$(JDK)/include" -I"$(JDK)/include/win32" ! CXXINCS = -I"/include/c++" -I"/include/c++/mingw32" -I"/include/c++/backward" -I"/include" -I"../commonjava" -I"$(JDK)/include" -I"$(JDK)/include/win32" -I../util-core BIN = winservice.exe CXXFLAGS = $(CUSTOMFLAGS) $(CXXINCS) -DJDK="$(JDK)" --- 11,15 ---- LIBS = -L"/lib" -L"../commonjava" -L"../util-core" ../commonjava/CommonJava.a ../util-core/util-core.a INCS = -I"/include" -I"../util-core" -I"../commonjava" -I"$(JDK)/include" -I"$(JDK)/include/win32" ! CXXINCS = -g -I"/include/c++" -I"/include/c++/mingw32" -I"/include/c++/backward" -I"/include" -I"../commonjava" -I"$(JDK)/include" -I"$(JDK)/include/win32" -I../util-core BIN = winservice.exe CXXFLAGS = $(CUSTOMFLAGS) $(CXXINCS) -DJDK="$(JDK)" Index: WinService.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/WinService.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WinService.cpp 9 Apr 2007 21:46:59 -0000 1.2 --- WinService.cpp 9 Apr 2007 22:21:23 -0000 1.3 *************** *** 60,66 **** } ! WinService::WinService(const std::string& name) { ! m_log = new Log("c:\\winservice.log"); m_log->out("Constructing winservice object " + name); --- 60,66 ---- } ! WinService::WinService(const std::string& name, const std::string& filename) { ! m_log = new Log(filename); m_log->out("Constructing winservice object " + name); *************** *** 78,82 **** m_dispatchTable[1].lpServiceProc = 0; winservice_ref = this; - m_log->out("Constructing winservice object " + name + " ... done!"); } --- 78,81 ---- *************** *** 91,95 **** printf("connect error %d (%d)!\n", err, ERROR_INVALID_DATA); } - printf("connection done %d!\n", handle); } --- 90,93 ---- Index: WinService.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/WinService.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WinService.h 9 Apr 2007 21:46:59 -0000 1.2 --- WinService.h 9 Apr 2007 22:21:23 -0000 1.3 *************** *** 53,57 **** public: ! WinService(const std::string& name); void connect(); --- 53,57 ---- public: ! WinService(const std::string& name, const std::string& filename); void connect(); |
From: Rodrigo R. <re...@us...> - 2007-04-09 22:21:59
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice/sample/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2430/sample/src Modified Files: AlertServer.java Log Message: Index: AlertServer.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/sample/src/AlertServer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AlertServer.java 9 Apr 2007 17:15:50 -0000 1.1 --- AlertServer.java 9 Apr 2007 22:21:23 -0000 1.2 *************** *** 32,35 **** --- 32,37 ---- System.out.println("Received: " + line); fw.write(line + "\n"); + if (line.startsWith("EXIT")) + System.exit(0); fw.close(); JOptionPane.showMessageDialog(null, line, "alert", JOptionPane.ERROR_MESSAGE); *************** *** 75,81 **** } static public void main(String[] args) { ! AlertServer a = new AlertServer(); a.setup(); a.listen(); --- 77,103 ---- } + public void shutdown() + { + try { + FileWriter fw = new FileWriter("c:/shutdown.log", true); + fw.write("END NOW " + System.currentTimeMillis() + "\n"); + fw.close(); + } catch (IOException iox) + { + iox.printStackTrace(); + } + } + static public void main(String[] args) { ! final AlertServer a = new AlertServer(); ! Runtime.getRuntime().addShutdownHook(new Thread() { ! public void run() ! { ! System.out.println("SHUTDOWN..."); ! a.shutdown(); ! } ! }); ! a.setup(); a.listen(); |
From: Rodrigo R. <re...@us...> - 2007-04-09 21:47:04
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19885 Modified Files: WinService.cpp main.cpp WinService.h Log Message: update windows service Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.cpp 9 Apr 2007 17:15:50 -0000 1.1 --- main.cpp 9 Apr 2007 21:46:59 -0000 1.2 *************** *** 38,41 **** --- 38,42 ---- void _debugOutput(const std::string& text) { + if (winservice_ref != 0) winservice_ref->log(text); } *************** *** 44,65 **** int main(int argc, char *argv[]) ! { ! WinService winserv("mytest"); if (argc>1) { ! if (strcmp(argv[1], "-i")==0) { ! winserv.install(); } ! else if (strcmp(argv[1], "-d")==0) { ! winserv.uninstall(); } } else ! { ! winserv.connect(); ! } return 0; --- 45,102 ---- int main(int argc, char *argv[]) ! { ! winservice_ref = 0; ! ResourceManager resman("JAVA", PROPID, JARID); ! ! std::string serviceName = resman.getProperty("skel_ServiceName"); ! std::string serviceDisplayName = resman.getProperty("skel_ServiceDisplayName"); ! std::string serviceDescription = resman.getProperty("skel_ServiceDescription"); ! if (serviceDisplayName == "") ! serviceDisplayName = serviceName; ! ! std::string autostart = resman.getProperty("skel_Autostart"); ! ! fflush(stdout); ! ! WinService winserv(serviceName); ! winserv.setDisplayName(serviceDisplayName); ! winserv.setDescription(serviceDescription); ! winserv.setAutostart( (StringUtils::parseInt(autostart)==1)?true:false ); ! ! winserv.setAutostart( true ); if (argc>1) { ! if ((strcmp(argv[1], "-i")==0) || (strcmp(argv[1], "install")==0)) { ! if (winserv.install()) ! printf("Service %s installed.\n", serviceName.c_str()); ! else ! printf("Failed to install service %s.\n", serviceName.c_str()); } ! else if ((strcmp(argv[1], "-d")==0) || (strcmp(argv[1], "uninstall")==0)) { ! if (winserv.uninstall()) ! printf("Service %s uninstalled.\n", serviceName.c_str()); ! else ! printf("Failed to uninstall service %s.\n", serviceName.c_str()); ! } ! else if (strcmp(argv[1], "start")==0) ! { ! if (winserv.startService()) ! printf("Service %s started.\n", serviceName.c_str()); ! else ! printf("Failed to start service %s.\n", serviceName.c_str()); ! } ! else if (strcmp(argv[1], "stop")==0) ! { ! if (winserv.stopService()) ! printf("Service %s stopped.\n", serviceName.c_str()); ! else ! printf("Failed to stop service %s.\n", serviceName.c_str()); } } else ! winserv.connect(); return 0; Index: WinService.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/WinService.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WinService.cpp 9 Apr 2007 17:15:50 -0000 1.1 --- WinService.cpp 9 Apr 2007 21:46:59 -0000 1.2 *************** *** 57,61 **** { WinService* service = (WinService*)param; ! service->stop(); } --- 57,61 ---- { WinService* service = (WinService*)param; ! service->kill(); } *************** *** 69,72 **** --- 69,75 ---- m_serviceName = name; + m_serviceDescription = ""; + m_autostart = false; + strcpy(m_cname, m_serviceName.c_str()); m_dispatchTable[0].lpServiceName = m_cname; *************** *** 75,78 **** --- 78,82 ---- m_dispatchTable[1].lpServiceProc = 0; winservice_ref = this; + m_log->out("Constructing winservice object " + name + " ... done!"); } *************** *** 99,113 **** std::string exepath = FileUtils::concFile(FileUtils::getExecutablePath(), FileUtils::getExecutableFileName()); HANDLE service = (HANDLE)CreateService((SC_HANDLE)scman, m_cname, ! m_cname, // service name to display ! SERVICE_ALL_ACCESS, // desired access ! SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS, // service type ! SERVICE_DEMAND_START, // start type ! SERVICE_ERROR_NORMAL, // error control type ! exepath.c_str(), // service's binary ! NULL, // no load ordering group ! NULL, // no tag identifier ! NULL, // no dependencies ! NULL, // LocalSystem account ! NULL); // no password CloseServiceHandle((SC_HANDLE)scman); --- 103,117 ---- std::string exepath = FileUtils::concFile(FileUtils::getExecutablePath(), FileUtils::getExecutableFileName()); HANDLE service = (HANDLE)CreateService((SC_HANDLE)scman, m_cname, ! m_serviceDisplayName.c_str(), // service name to display ! SERVICE_ALL_ACCESS, // desired access ! SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS, // service type ! m_autostart?SERVICE_AUTO_START:SERVICE_DEMAND_START, // start type ! SERVICE_ERROR_NORMAL, // error control type ! exepath.c_str(), // service's binary ! NULL, // no load ordering group ! NULL, // no tag identifier ! NULL, // no dependencies ! NULL, // LocalSystem account ! NULL); // no password CloseServiceHandle((SC_HANDLE)scman); *************** *** 228,232 **** { setStatus(SERVICE_START_PENDING); ! ResourceManager* globalResMan = new ResourceManager("JAVA", PROPID, JARID); --- 232,237 ---- { setStatus(SERVICE_START_PENDING); ! log("Run..."); ! ResourceManager* globalResMan = new ResourceManager("JAVA", PROPID, JARID); *************** *** 234,237 **** --- 239,243 ---- // sets up the debug mode, if requested std::string dodebug = globalResMan->getProperty("skel_Debug"); + dodebug = "1"; if (StringUtils::parseInt(dodebug) != 0) { *************** *** 261,265 **** } ! void WinService::stop() { log("requesting stop..."); --- 267,271 ---- } ! void WinService::kill() { log("requesting stop..."); *************** *** 274,275 **** --- 280,343 ---- } } + + bool WinService::startService() + { + HANDLE scman = OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS); + if (scman == 0) + return false; + + SC_HANDLE service = OpenService((SC_HANDLE)scman, // handle to service control manager database + m_cname, // pointer to name of service to start + SERVICE_ALL_ACCESS // type of access to service + ); + if (service != 0) + { + return StartService(service, 0, NULL); + } + + return false; + } + + bool WinService::stopService() + { + HANDLE scman = OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS); + if (scman == 0) + return false; + + SC_HANDLE service = OpenService((SC_HANDLE)scman, // handle to service control manager database + m_cname, // pointer to name of service to start + SERVICE_ALL_ACCESS // type of access to service + ); + if (service != 0) + { + SERVICE_STATUS status; + + status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + status.dwCurrentState = SERVICE_STOP_PENDING; + status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; + status.dwWin32ExitCode = NO_ERROR; + status.dwServiceSpecificExitCode = 0; + status.dwCheckPoint = m_status_checkpoint++; + status.dwWaitHint = 60*1000; + + return ControlService(service, SERVICE_CONTROL_STOP, &status); + } + + return false; + } + + + void WinService::setDescription(const std::string& description) + { + m_serviceDescription = description; + } + + void WinService::setAutostart(bool b) + { + m_autostart = b; + } + + void WinService::setDisplayName(const std::string& displayname) + { + m_serviceDisplayName = displayname; + } Index: WinService.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/WinService.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WinService.h 9 Apr 2007 17:15:50 -0000 1.1 --- WinService.h 9 Apr 2007 21:46:59 -0000 1.2 *************** *** 37,40 **** --- 37,44 ---- Log* m_log; std::string m_serviceName; + std::string m_serviceDisplayName; + std::string m_serviceDescription; + bool m_autostart; + SERVICE_TABLE_ENTRY m_dispatchTable[2]; SERVICE_STATUS_HANDLE m_serviceStatusHandle; *************** *** 57,65 **** void run(); ! void stop(); bool install(); bool uninstall(); bool setStatus(int currentState); --- 61,73 ---- void run(); ! void kill(); bool install(); bool uninstall(); + bool startService(); + bool stopService(); + + bool setStatus(int currentState); *************** *** 68,71 **** --- 76,84 ---- void log(const std::string& msg) const; void log(const char* msg) const; + + void setDisplayName(const std::string& displayname); + void setDescription(const std::string& description); + void setAutostart(bool b); + }; |
From: Rodrigo R. <re...@us...> - 2007-04-09 17:20:51
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10632 Added Files: JWrap.ico description.skel Log Message: files added --- NEW FILE: description.skel --- <?xml version="1.0" encoding="ISO-8859-1"?> <jsmoothskeleton> <debug>false</debug> <description>SKEL_WINSERVICE_DESCRIPTION</description> <executableName>winservice.exe</executableName> <resourceCategory>JAVA</resourceCategory> <resourceJarId>102</resourceJarId> <resourcePropsId>103</resourcePropsId> <shortName>WinService Wrapper</shortName> <skeletonProperties> <description>SKEL_CUSTOMWRAPPER_PROPERTY_MESSAGE_DESCRIPTION</description> <idName>Message</idName> <label>SKEL_CUSTOMWRAPPER_PROPERTY_MESSAGE_LABEL</label> <type>textarea</type> <value>This program needs Java to run. Please download it at http://www.java.com</value> </skeletonProperties> <skeletonProperties> <description>SKEL_CUSTOMWRAPPER_PROPERTY_KEYPRESS_DESCRIPTION</description> <idName>PressKey</idName> <label>SKEL_CUSTOMWRAPPER_PROPERTY_KEYPRESS_LABEL</label> <type>boolean</type> <value>0</value> </skeletonProperties> <skeletonProperties> <description>SKEL_GENERIC_PROPERTY_DEBUG_DESCRIPTION</description> <idName>Debug</idName> <label>SKEL_GENERIC_PROPERTY_DEBUG_LABEL</label> <type>boolean</type> <value>0</value> </skeletonProperties> </jsmoothskeleton> --- NEW FILE: JWrap.ico --- (This appears to be a binary file; contents omitted.) |
From: Rodrigo R. <re...@us...> - 2007-04-09 17:19:16
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/util-core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9796/util-core Modified Files: Makefile.win Log Message: adds Log and Thread classes to the makefile Index: Makefile.win =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/util-core/Makefile.win,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.win 1 Mar 2007 21:49:59 -0000 1.1 --- Makefile.win 9 Apr 2007 17:19:14 -0000 1.2 *************** *** 8,12 **** MINGW = RES = ! OBJ = FileUtils.o StringUtils.o DebugConsole.o $(RES) LIBS = -L"$(MINGW)/lib" -L"/lib" -lws2_32 INCS = -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" --- 8,12 ---- MINGW = RES = ! OBJ = Log.o Thread.o FileUtils.o StringUtils.o DebugConsole.o $(RES) LIBS = -L"$(MINGW)/lib" -L"/lib" -lws2_32 INCS = -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" |
From: Rodrigo R. <re...@us...> - 2007-04-09 17:18:20
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/commonjava In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9385 Modified Files: JavaMachineManager.cpp JavaMachineManager.h SunJVMLauncher.cpp SunJVMLauncher.h Log Message: adds methods to launch specificly a DLL JVM and call a static method Index: SunJVMLauncher.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMLauncher.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** SunJVMLauncher.cpp 1 Apr 2007 22:18:05 -0000 1.23 --- SunJVMLauncher.cpp 9 Apr 2007 17:18:16 -0000 1.24 *************** *** 38,46 **** } ! bool SunJVMLauncher::run(ResourceManager& resource, const string& origin) { // patch proposed by zregvart // if you're using bundeled JVM, you apriori ! // specified version, and the version check // would require instantiateing JVM which is // an overhead in both code and runtime --- 38,48 ---- } ! bool SunJVMLauncher::run(ResourceManager& resource, const string& origin, bool justInstanciate) { + DEBUG("Running now " + this->toString() + ", instanciate=" + (justInstanciate?"yes":"no")); + // patch proposed by zregvart // if you're using bundeled JVM, you apriori ! // specified the version, and the version check // would require instantiateing JVM which is // an overhead in both code and runtime *************** *** 123,127 **** if ((m_javavm != 0) && (m_javaenv != 0)) { ! return runVMDLL(resource, origin); } return false; --- 125,129 ---- if ((m_javavm != 0) && (m_javaenv != 0)) { ! return runVMDLL(resource, origin, justInstanciate); } return false; *************** *** 300,305 **** } ! bool SunJVMLauncher::runVMDLL(ResourceManager& resource, const string& origin) { std::string classname = resource.getProperty(string(ResourceManager::KEY_MAINCLASSNAME)); classname = StringUtils::replace(classname,".", "/"); --- 302,309 ---- } ! 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,".", "/"); *************** *** 341,344 **** --- 345,354 ---- 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); *************** *** 356,422 **** - // bool SunJVMLauncher::runVM12DLL(ResourceManager& resource, const string& origin) - // { - // if (setupVM12DLL(resource, origin) == false) - // { - // DEBUG("CAN'T LOAD DLL"); - // return false; - // } - - // std::string classname = resource.getProperty(string(ResourceManager::KEY_MAINCLASSNAME)); - // classname = StringUtils::replace(classname,".", "/"); - // DEBUG("Look for " + classname); - // jclass cls = (m_javaenv)->FindClass(classname.c_str()); - // if (cls == 0) - // { - // char tmpbuf[255]; - // sprintf(tmpbuf, "Cant find <%s> at all!", classname.c_str()); - // DEBUG(tmpbuf); - // DEBUG(std::string("Can't Find CLASS <") + classname + std::string(">")); - // return false; - // } - // else - // DEBUG("CLASS FOUND"); - - // 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("ARG:: <" + 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)) - // { - // m_javaenv->CallStaticVoidMethod(cls, mid, args); - // DEBUG("VM CALLED !!"); - // m_javavm->DestroyJavaVM(); - // DEBUG("VM DESTROYED !!"); - // return true; - // } - // else - // { - // DEBUG("Can't find method !"); - // return false; - // } - // } - bool SunJVMLauncher::setupVM11DLL(ResourceManager& resource, const string& origin) --- 366,369 ---- *************** *** 862,867 **** --- 809,859 ---- } + bool SunJVMLauncher::dllInstanciate(ResourceManager& resource, const std::string& origin) + { + return runVMDLL(resource, origin); + } + bool operator < (const SunJVMLauncher& v1, const SunJVMLauncher& v2) { return v1.VmVersion < v2.VmVersion; } + + bool SunJVMLauncher::callDLLStaticMethod(const std::string& clazz, const std::string& methodname, const std::string& signature) + { + std::string classname = StringUtils::replace(clazz,".", "/"); + DEBUG("Calling " + classname + "::" + methodname + signature); + 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, methodname.c_str(), signature.c_str()); + + if (mid != 0) + { + DEBUG("Calling static method from " + classname); + m_javaenv->CallStaticVoidMethod(cls, mid); + return true; + } + else + { + DEBUG("Can't find method !"); + return false; + } + + } + + int SunJVMLauncher::destroyVM() + { + if (m_javavm != 0) + return m_javavm->DestroyJavaVM(); + return -1; + } Index: SunJVMLauncher.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMLauncher.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SunJVMLauncher.h 1 Mar 2007 21:56:03 -0000 1.9 --- SunJVMLauncher.h 9 Apr 2007 17:18:17 -0000 1.10 *************** *** 78,82 **** * false otherwise. */ ! virtual bool run(ResourceManager& resource, const string& origin); --- 78,82 ---- * false otherwise. */ ! virtual bool run(ResourceManager& resource, const string& origin, bool justInstanciate = false); *************** *** 109,117 **** bool runExe(const string& exepath, bool forceFullClasspath, ResourceManager& resource, bool noConsole, const std::string& version, const string& origin); private: // bool runVM12DLL(ResourceManager& resource, const string& origin); // bool runVM11DLL(ResourceManager& resource, const string& origin); ! bool runVMDLL(ResourceManager& resource, const string& origin); bool setupVM12DLL(ResourceManager& resource, const string& origin); --- 109,123 ---- 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); + + int destroyVM(); + private: // bool runVM12DLL(ResourceManager& resource, const string& origin); // bool runVM11DLL(ResourceManager& resource, const string& origin); ! bool runVMDLL(ResourceManager& resource, const string& origin, bool justInstanciate=false); bool setupVM12DLL(ResourceManager& resource, const string& origin); Index: JavaMachineManager.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/JavaMachineManager.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JavaMachineManager.h 18 Feb 2007 23:29:09 -0000 1.4 --- JavaMachineManager.h 9 Apr 2007 17:18:16 -0000 1.5 *************** *** 90,93 **** --- 90,94 ---- bool run(bool noConsole, bool preferSingleProcess); + SunJVMLauncher* runDLLFromRegistry(bool justInstanciate=false); protected: Index: JavaMachineManager.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/JavaMachineManager.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** JavaMachineManager.cpp 1 Mar 2007 21:56:02 -0000 1.15 --- JavaMachineManager.cpp 9 Apr 2007 17:18:16 -0000 1.16 *************** *** 179,180 **** --- 179,205 ---- return true; } + + + + SunJVMLauncher* JavaMachineManager::runDLLFromRegistry(bool justInstanciate) + { + string vms = "DLL VM will be tried in the following order: "; + for (int i=0; i<m_registryVms.size(); i++) + { + vms += m_registryVms[i].VmVersion.toString(); + vms += ";"; + } + DEBUG(vms); + + for (int i=0; i<m_registryVms.size(); i++) + { + DEBUG("- Trying registry: " + m_registryVms[i].toString()); + + bool res = m_registryVms[i].run(m_resman, "registry", justInstanciate); + + if (res) + return &m_registryVms[i]; + } + + return NULL; + } |
From: Rodrigo R. <re...@us...> - 2007-04-09 17:17:07
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/util-core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8985 Added Files: Log.h Log.cpp Thread.cpp Thread.h Log Message: added new classes --- NEW FILE: Log.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 "Log.h" #include <windows.h> #include <winbase.h> Log::Log() { m_out = 0; } Log::Log(const std::string& filepath) { m_out = fopen(filepath.c_str(), "a"); } Log::~Log() { if (m_out != 0) fclose(m_out); m_out = 0; } void Log::out(const std::string& msg) { if (m_out != 0) { SYSTEMTIME time; GetSystemTime(&time); char timestamp[64]; sprintf(timestamp, "%02d:%02d.%02d", time.wHour, time.wMinute, time.wSecond); std::string m = std::string(timestamp) + " :" + msg; fprintf(m_out, "%s\n", m.c_str()); fflush(m_out); } } --- NEW FILE: Log.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 _LOG_H_ #define _LOG_H_ #include <string> #include <stdio.h> class Log { protected: FILE* m_out; public: Log(); Log(const std::string& filepath); ~Log(); void out(const std::string& msg); }; #endif --- NEW FILE: Thread.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 __JSMOOTHCORETHREAD_H_ #define __JSMOOTHCORETHREAD_H_ #include <process.h> #include <windows.h> #include <winbase.h> #include <stdio.h> /** * Provides basic string operations. * * @author Rodrigo Reyes <re...@ch...> */ class Thread { protected: unsigned long m_threadId; void (*m_callback)(void*); void* m_param; bool m_stopRequested; public: Thread(); /** * Starts the thread, and execute the run() method. */ void start(); /** * Starts the thread and execute the run method. If the run method * is not overloaded, it executes the callback fonction, and pass * the param as parameter to the function. */ void start(void (*callback)(void*), void* param); /** * The method executed by the thread. */ void run(); /* * Waits for the thread to complete */ void join(); /* * Waits for the thread to complete. If the timeout (millis) is * reached, returns false. Returns true if the thread ended. */ bool join(int millis); /** * Waits a number of milliseconds. */ static void sleep(int millis); bool isStopRequested(); void setStopRequested(bool stop=true); }; #endif --- NEW FILE: Thread.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 "Thread.h" void thread_support_fn(void* param) { Thread *t = (Thread*) param; try { t->run(); } catch (...) { // } _endthread(); } Thread::Thread() { m_callback = 0; } void Thread::start() { m_threadId = _beginthread((void( __cdecl * )( void * ))thread_support_fn, 0, (void*) this); } void Thread::start(void (*callback)(void*), void* param) { m_callback = callback; m_param = param; m_threadId = _beginthread((void( __cdecl * )( void * ))thread_support_fn, 0, (void*) this); } void Thread::run() { if (m_callback != 0) { (*m_callback)(m_param); } } void Thread::sleep(int millis) { Sleep(millis); } void Thread::join() { WaitForSingleObject ( (void*)m_threadId, INFINITE ); } bool Thread::join(int millis) { int result = WaitForSingleObject( (void*)m_threadId, millis); switch(result) { case WAIT_ABANDONED: printf("WAIT_ABANDONED\n"); break; case WAIT_OBJECT_0: printf("WAIT_OBJECT_0"); return true; break; case WAIT_TIMEOUT: printf("WAIT_TIMEOUT"); break; } return false; } bool Thread::isStopRequested() { return m_stopRequested; } void Thread::setStopRequested(bool stop) { m_stopRequested = stop; } |
From: Rodrigo R. <re...@us...> - 2007-04-09 17:15:55
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice/sample In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8562/winservice/sample Added Files: build.xml sample.props Log Message: adds windows service skeleton --- NEW FILE: sample.props --- arguments=arg1 arg2 arg3 mainclassname=AlertServer classpath= jvmsearch=registry;jview;javahome;jrepath;jdkpath;exepath; minversion=1.1 maxversion= currentdir= bundledvm=jre skel_Message=Java has not been found on your computer. Do you want to download it? skel_URL=http://www.java.com skel_DownloadURL=http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab javapropertiescount=1 javaproperty_name_0=nom1 javaproperty_value_0=valeur1 maxheap=98000000 initialheap=48000000 embedjar=true skel_Debug=0 --- NEW FILE: build.xml --- <?xml version="1.0" encoding="UTF-8"?> <project basedir="." default="dist" name="jsmooth-sample"> <!-- set global properties for this build --> <property name="src" value="src"/> <property name="classes" value="classes"/> <target name="init"> <!-- Create the time stamp --> <tstamp/> <!-- Create the build directory structure used by compile --> <mkdir dir="${classes}"/> </target> <target depends="init" name="compile"> <!-- Compile the java code from ${src} into ${classes} --> <javac debug="true" deprecation="yes" destdir="${classes}" srcdir="${src}"/> </target> <target depends="compile" name="dist"> <!-- Compile the java code from ${src} into ${classes} --> <jar jarfile="sample.jar" basedir="classes"/> </target> <target depends="dist" name="run"> <!-- Compile the java code from ${src} into ${classes} --> <java classname="AlertServer" fork="yes" > <classpath> <pathelement path="sample.jar"/> </classpath> </java> </target> <target name="clean"> <delete dir="${classes}"/> </target> </project> |
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8562/winservice Added Files: Makefile.win WinService.cpp WinService.h main.cpp mainres.rc resource.h winservice_private.h winservice_private.rc Log Message: adds windows service skeleton --- NEW FILE: main.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 <iostream> #include <stdlib.h> #include <windows.h> #include "resource.h" #include "common.h" #include "ResourceManager.h" #include "JVMRegistryLookup.h" #include "JavaMachineManager.h" #include "WinService.h" using namespace std; extern WinService* winservice_ref; void _debugOutput(const std::string& text) { winservice_ref->log(text); } void _debugWaitKey() { } int main(int argc, char *argv[]) { WinService winserv("mytest"); if (argc>1) { if (strcmp(argv[1], "-i")==0) { winserv.install(); } else if (strcmp(argv[1], "-d")==0) { winserv.uninstall(); } } else { winserv.connect(); } return 0; } --- NEW FILE: WinService.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 __JSMOOTHCOREWINSERVICE_H_ #define __JSMOOTHCOREWINSERVICE_H_ #include "Log.h" #include <string> #include <windows.h> #include <stdio.h> #include <stdlib.h> #include <process.h> #include "Thread.h" #include "SunJVMLauncher.h" class WinService { protected: Log* m_log; std::string m_serviceName; SERVICE_TABLE_ENTRY m_dispatchTable[2]; SERVICE_STATUS_HANDLE m_serviceStatusHandle; DWORD m_serviceCurrentStatusId; char m_cname[256]; int m_status_checkpoint; HANDLE m_stopEventHandle; Thread m_serviceThread; SunJVMLauncher* m_jvm; public: WinService(const std::string& name); void connect(); void serviceMain(DWORD argCount,LPSTR* arguments); void serviceCtrlHandler(DWORD); void run(); void stop(); bool install(); bool uninstall(); bool setStatus(int currentState); const char* getName() const; void log(const std::string& msg) const; void log(const char* msg) const; }; #endif --- NEW FILE: WinService.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 "WinService.h" #include "FileUtils.h" #include "StringUtils.h" #include "resource.h" #include "common.h" #include "ResourceManager.h" #include "JVMRegistryLookup.h" #include "JavaMachineManager.h" WinService* winservice_ref; void winservice_thread_support(void* param) { WinService* service = (WinService*)param; service->run(); } void winservice_ctrlhandler(DWORD ccode) { WinService* service = winservice_ref; service->serviceCtrlHandler(ccode); } WINAPI void *winservice_servicemain_support(DWORD argCount,LPSTR* arguments) { WinService* service = winservice_ref; service->serviceMain(argCount,arguments); } void winservice_thread_stop(void* param) { WinService* service = (WinService*)param; service->stop(); } WinService::WinService(const std::string& name) { m_log = new Log("c:\\winservice.log"); m_log->out("Constructing winservice object " + name); m_jvm = 0; m_status_checkpoint = 0; m_serviceName = name; strcpy(m_cname, m_serviceName.c_str()); m_dispatchTable[0].lpServiceName = m_cname; m_dispatchTable[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION)winservice_servicemain_support; m_dispatchTable[1].lpServiceName = 0; m_dispatchTable[1].lpServiceProc = 0; winservice_ref = this; } void WinService::connect() { log(std::string("setting up a connection with the control dispatcher (") + getName() + ")"); int handle = StartServiceCtrlDispatcher(m_dispatchTable); if (handle == 0) { int err = GetLastError(); printf("connect error %d (%d)!\n", err, ERROR_INVALID_DATA); } printf("connection done %d!\n", handle); } bool WinService::install() { log(std::string("Installation of ") + getName()); HANDLE scman = OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS); if (scman == 0) return false; std::string exepath = FileUtils::concFile(FileUtils::getExecutablePath(), FileUtils::getExecutableFileName()); HANDLE service = (HANDLE)CreateService((SC_HANDLE)scman, m_cname, m_cname, // service name to display SERVICE_ALL_ACCESS, // desired access SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS, // service type SERVICE_DEMAND_START, // start type SERVICE_ERROR_NORMAL, // error control type exepath.c_str(), // service's binary NULL, // no load ordering group NULL, // no tag identifier NULL, // no dependencies NULL, // LocalSystem account NULL); // no password CloseServiceHandle((SC_HANDLE)scman); if (service == 0) { log("Failed to install!"); return false; } log("Service installed!"); return true; } bool WinService::uninstall() { bool result = false; HANDLE scman = OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS); if (scman == 0) return result; std::string exepath = FileUtils::getExecutablePath(); SC_HANDLE service = OpenService( (SC_HANDLE)scman, // handle to service control manager database m_cname, // pointer to name of service to start SERVICE_ALL_ACCESS // type of access to service ); if (service != 0) { result = DeleteService(service ); } log("Service uninstalled!"); CloseServiceHandle((SC_HANDLE)scman); return result; } bool WinService::setStatus(int currentState) { SERVICE_STATUS status; log("set status " + StringUtils::toString(currentState)); status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; status.dwCurrentState = currentState; if ( currentState==SERVICE_START_PENDING ) status.dwControlsAccepted=0; else status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; status.dwWin32ExitCode = NO_ERROR; status.dwServiceSpecificExitCode = 0; status.dwCheckPoint = m_status_checkpoint++; status.dwWaitHint = 60*1000; return SetServiceStatus(m_serviceStatusHandle,&status); } const char* WinService::getName() const { return m_cname; } void WinService::log(const std::string& msg) const { m_log->out(msg); } void WinService::log(const char* msg) const { m_log->out(msg); } void WinService::serviceMain(DWORD argCount,LPSTR* arguments) { log(std::string("in service main... (") + StringUtils::toString(argCount) + std::string(" args)")); for (int i=0; i<argCount; i++) { log( std::string("argument ") + StringUtils::toString(i) + ": " + arguments[i]); } m_serviceStatusHandle = RegisterServiceCtrlHandler(getName(), (LPHANDLER_FUNCTION)winservice_ctrlhandler); setStatus(SERVICE_START_PENDING); m_stopEventHandle = CreateEvent(NULL,TRUE, FALSE,NULL); if (!setStatus(SERVICE_START_PENDING)) return; m_serviceThread.start(winservice_thread_support, (void*)this); setStatus(SERVICE_RUNNING); m_serviceThread.join(); setStatus(SERVICE_STOPPED); } void WinService::serviceCtrlHandler(DWORD nControlCode) { switch(nControlCode) { case SERVICE_CONTROL_SHUTDOWN: case SERVICE_CONTROL_STOP: setStatus(SERVICE_STOP_PENDING); m_serviceThread.start(winservice_thread_stop, (void*)this); setStatus(SERVICE_STOP_PENDING); return; default: break; } setStatus(SERVICE_RUNNING); } void WinService::run() { setStatus(SERVICE_START_PENDING); ResourceManager* globalResMan = new ResourceManager("JAVA", PROPID, JARID); // // sets up the debug mode, if requested std::string dodebug = globalResMan->getProperty("skel_Debug"); if (StringUtils::parseInt(dodebug) != 0) { globalResMan->printDebug(); } JavaMachineManager man(*globalResMan); SunJVMLauncher* launcher = man.runDLLFromRegistry(true); if (launcher != 0) { m_jvm = launcher; log("JVM found and instanciated successfully (" + launcher->toString() + ")"); setStatus(SERVICE_RUNNING); launcher->dllInstanciate(*globalResMan, "wsreg"); log("Launched successfully the DLL (" + launcher->toString() + ")"); } else { log("ERROR: could not launch the JVM DLL"); } setStatus(SERVICE_STOPPED); log("stopped!"); return; } void WinService::stop() { log("requesting stop..."); setStatus(SERVICE_STOP_PENDING); if (m_jvm != 0) { setStatus(SERVICE_STOPPED); m_jvm->callDLLStaticMethod("java.lang.System", "exit", "()V"); log("exit called"); m_jvm->destroyVM(); log("vm destroyed"); } } --- NEW FILE: Makefile.win --- # Project: WinService Wrapper # Makefile created by Dev-C++ 4.9.8.0 RM = cmd /C DEL CPP = g++.exe CC = gcc.exe WINDRES = windres.exe RES = winservice_private.res OBJ = main.o $(RES) LINKOBJ = WinService.o main.o $(RES) LIBS = -L"/lib" -L"../commonjava" -L"../util-core" ../commonjava/CommonJava.a ../util-core/util-core.a INCS = -I"/include" -I"../util-core" -I"../commonjava" -I"$(JDK)/include" -I"$(JDK)/include/win32" CXXINCS = -I"/include/c++" -I"/include/c++/mingw32" -I"/include/c++/backward" -I"/include" -I"../commonjava" -I"$(JDK)/include" -I"$(JDK)/include/win32" -I../util-core BIN = winservice.exe CXXFLAGS = $(CUSTOMFLAGS) $(CXXINCS) -DJDK="$(JDK)" CFLAGS = $(INCS) .PHONY: all all-before all-after clean clean-custom all: all-before winservice.exe all-after clean: clean-custom $(RM) $(OBJ) $(BIN) $(BIN): $(LINKOBJ) ../commonjava/CommonJava.a $(CPP) $(LINKOBJ) -o "winservice.exe" $(LIBS) main.o: main.cpp $(CPP) -c main.cpp -o main.o $(CXXFLAGS) winservice_private.res: winservice_private.rc mainres.rc $(WINDRES) -i winservice_private.rc -I rc -o winservice_private.res -O coff --- NEW FILE: mainres.rc --- #include "resource.h" JARID JAVA "sample/sample.jar" PROPID JAVA "sample/sample.props" A2 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "JWrap.ico" --- NEW FILE: winservice_private.rc --- // THIS FILE WILL BE OVERWRITTEN BY DEV-C++! // DO NOT EDIT! #include "mainres.rc" --- NEW FILE: resource.h --- #define JARID 102 #define PROPID 103 --- NEW FILE: winservice_private.h --- // THIS FILE WILL BE OVERWRITTEN BY DEV-C++! // DO NOT EDIT! #ifndef WINSERVICE_PRIVATE_H #define WINSERVICE_PRIVATE_H // VERSION DEFINITIONS #define VER_STRING "0.1.1.1" #define VER_MAJOR 0 #define VER_MINOR 1 #define VER_RELEASE 1 #define VER_BUILD 1 #define COMPANY_NAME "" #define FILE_VERSION "" #define FILE_DESCRIPTION "Developed using the Dev-C++ IDE" #define INTERNAL_NAME "" #define LEGAL_COPYRIGHT "" #define LEGAL_TRADEMARKS "" #define ORIGINAL_FILENAME "" #define PRODUCT_NAME "" #define PRODUCT_VERSION "" #endif //WINSERVICE_PRIVATE_H |
From: Rodrigo R. <re...@us...> - 2007-04-09 17:15:54
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice/sample/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8562/winservice/sample/src Added Files: AlertServer.java Log Message: adds windows service skeleton --- NEW FILE: AlertServer.java --- import java.net.*; import java.util.*; import java.io.*; import javax.swing.JOptionPane; public class AlertServer { private ServerSocket m_socket; public class SListener implements Runnable { public Socket m_sock; public SListener(Socket s) { m_sock = s; } public void run() { try { InputStream is = m_sock.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line; while ((line=br.readLine()) != null) { FileWriter fw = new FileWriter("c:/alertserver.log", true); System.out.println("Received: " + line); fw.write(line + "\n"); fw.close(); JOptionPane.showMessageDialog(null, line, "alert", JOptionPane.ERROR_MESSAGE); } is.close(); } catch (IOException iox) { iox.printStackTrace(); } } } public AlertServer() { } public void setup() { try { m_socket = new ServerSocket(2073); } catch (Exception ex) { ex.printStackTrace(); } } public void listen() { try { while (true) { Socket sock = m_socket.accept(); SListener sl = new SListener(sock); new Thread(sl).start(); } } catch (Exception exc) { exc.printStackTrace(); } } static public void main(String[] args) { AlertServer a = new AlertServer(); a.setup(); a.listen(); } } |
From: Rodrigo R. <re...@us...> - 2007-04-09 17:14:57
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice/sample/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8165/src Log Message: Directory /cvsroot/jsmooth/jsmooth/skeletons/winservice/sample/src added to the repository |
From: Rodrigo R. <re...@us...> - 2007-04-09 17:14:34
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice/sample In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8145/sample Log Message: Directory /cvsroot/jsmooth/jsmooth/skeletons/winservice/sample added to the repository |
From: Rodrigo R. <re...@us...> - 2007-04-09 17:13:59
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv7760/winservice Log Message: Directory /cvsroot/jsmooth/jsmooth/skeletons/winservice added to the repository |
From: Rodrigo R. <re...@us...> - 2007-04-07 21:43:40
|
Update of /cvsroot/jsmooth/jsmooth/jsprj In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17991/jsprj Modified Files: prooftest.jsmooth Log Message: fixed prooftest project (jvm 1.9 not required anymore) Index: prooftest.jsmooth =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/jsprj/prooftest.jsmooth,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** prooftest.jsmooth 6 Apr 2007 16:27:10 -0000 1.4 --- prooftest.jsmooth 7 Apr 2007 21:43:37 -0000 1.5 *************** *** 16,20 **** <maximumMemoryHeap>-1</maximumMemoryHeap> <maximumVersion></maximumVersion> ! <minimumVersion>1.9</minimumVersion> <skeletonName>Console Wrapper</skeletonName> <skeletonProperties> --- 16,20 ---- <maximumMemoryHeap>-1</maximumMemoryHeap> <maximumVersion></maximumVersion> ! <minimumVersion>1.1</minimumVersion> <skeletonName>Console Wrapper</skeletonName> <skeletonProperties> |
From: Rodrigo R. <re...@us...> - 2007-04-07 21:43:40
|
Update of /cvsroot/jsmooth/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17991 Modified Files: build.number Log Message: fixed prooftest project (jvm 1.9 not required anymore) Index: build.number =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/build.number,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** build.number 7 Apr 2007 21:17:13 -0000 1.31 --- build.number 7 Apr 2007 21:43:37 -0000 1.32 *************** *** 1,3 **** #Build Number for ANT. Do not edit! ! #Sat Apr 07 23:09:35 CEST 2007 ! build.number=190 --- 1,3 ---- #Build Number for ANT. Do not edit! ! #Sat Apr 07 23:33:08 CEST 2007 ! build.number=191 |
From: Rodrigo R. <re...@us...> - 2007-04-07 21:31:46
|
Update of /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/gui/editors In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12771/src/net/charabia/jsmoothgen/application/gui/editors Added Files: JSmoothInfo.java Log Message: added --- NEW FILE: JSmoothInfo.java --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003 Rodrigo Reyes <re...@ch...> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package net.charabia.jsmoothgen.application.gui.editors; import net.charabia.jsmoothgen.application.*; import net.charabia.jsmoothgen.application.gui.*; import net.charabia.jsmoothgen.application.gui.util.*; import javax.swing.*; import java.awt.event.*; import java.util.*; import java.io.*; import se.datadosen.component.RiverLayout; public class JSmoothInfo extends Editor implements JSmoothModelBean.SkeletonChangedListener { // private JEditorPane m_skeldesc = new JEditorPane("text/html","<html></html>"); private HTMLPane m_skeldesc = new HTMLPane(); public JSmoothInfo() { setLayout(new java.awt.BorderLayout()); add(java.awt.BorderLayout.CENTER, m_skeldesc); setBackground(java.awt.Color.red); String text = Main.MAIN.local("JSMOOTH_WELCOME_SCREEN"); m_skeldesc.setText(text); } public void dataChanged() { } private void updateSkeletonData() { } public void updateModel() { } public String getLabel() { return "SKELETONCHOOSER_LABEL"; } public String getDescription() { return "SKELETONCHOOSER_HELP"; } public void skeletonChanged() { } public boolean needsBigSpace() { return true; } public boolean needsFullSpace() { return true; } public String readFile(java.io.File f) { StringBuffer buffer = new StringBuffer(); try { FileInputStream fis = new FileInputStream(f); InputStreamReader isr = new InputStreamReader(fis); int c; while ((c=isr.read())!=-1) buffer.append((char)c); isr.close(); fis.close(); } catch (Exception ex) { ex.printStackTrace(); } return buffer.toString(); } } |
From: Rodrigo R. <re...@us...> - 2007-04-07 21:28:52
|
Update of /cvsroot/jsmooth/jsmooth/lib In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11566 Added Files: BrowserLauncher2-10.jar Log Message: added --- NEW FILE: BrowserLauncher2-10.jar --- (This appears to be a binary file; contents omitted.) |
From: Rodrigo R. <re...@us...> - 2007-04-07 21:26:48
|
Update of /cvsroot/jsmooth/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10753 Modified Files: Changelog Log Message: fixes typos Index: Changelog =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/Changelog,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Changelog 7 Apr 2007 21:08:32 -0000 1.33 --- Changelog 7 Apr 2007 21:26:44 -0000 1.34 *************** *** 1,3 **** ! 0.9.9-4 - Fixed bug #1694330: Working directory handled incorrectly. - Fixed bug #1694128: launch in exe proc: '\' in command line not --- 1,3 ---- ! 0.9.9-4 (2007-04-07) - Fixed bug #1694330: Working directory handled incorrectly. - Fixed bug #1694128: launch in exe proc: '\' in command line not |