Update of /cvsroot/jsmooth/jsmooth/skeletons/simplewrap
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14160/skeletons/simplewrap
Modified Files:
description.skel main.cpp
Log Message:
adds the single instance feature
Index: description.skel
===================================================================
RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/description.skel,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** description.skel 27 Mar 2007 20:16:58 -0000 1.8
--- description.skel 17 May 2007 10:56:16 -0000 1.9
***************
*** 36,38 ****
--- 36,45 ----
<value>0</value>
</skeletonProperties>
+ <skeletonProperties>
+ <description>SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION</description>
+ <idName>SingleInstance</idName>
+ <label>SKEL_GENERIC_SINGLEINSTANCE</label>
+ <type>boolean</type>
+ <value>0</value>
+ </skeletonProperties>
</jsmoothskeleton>
Index: main.cpp
===================================================================
RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/main.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** main.cpp 13 May 2007 19:58:57 -0000 1.29
--- main.cpp 17 May 2007 10:56:16 -0000 1.30
***************
*** 27,30 ****
--- 27,31 ----
#include "JVMRegistryLookup.h"
#include "JavaMachineManager.h"
+ #include "SingleInstanceManager.h"
ResourceManager* globalResMan;
***************
*** 57,60 ****
--- 58,62 ----
{
atexit(lastExit);
+ SingleInstanceManager instanceman;
globalResMan = new ResourceManager("JAVA", PROPID, JARID);
***************
*** 79,82 ****
--- 81,99 ----
globalResMan->printDebug();
+
+ bool singleinstance = globalResMan->getBooleanProperty("skel_SingleInstance");
+ if (singleinstance)
+ {
+ if (instanceman.alreadyExists())
+ {
+ instanceman.sendMessageInstanceShow();
+ exit(0);
+ }
+ else
+ {
+ instanceman.startMasterInstanceServer();
+ }
+ }
+
DEBUG(string("Main class: ") + globalResMan->getMainName());
|