Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » two instance of the same rcp application running at the same time..???
two instance of the same rcp application running at the same time..??? [message #459434] Fri, 01 December 2006 22:57 Go to next message
Eclipse UserFriend
Originally posted by: fermi.inetmon.com

Is it possible to prevent two instance of the same rcp application running
at the same time..?
So I'm thinking to check/detect whether another instance of this rcp
application is already running or not, if it is, then open a message dialog
inform users and then close it or (if possible) instead of opening a message
dialog, simply open the currently running rcp application.
the latter is preferable.. any helps or useful links would be greatly
appreciated.

Thanks in advance.

Regards,
--
Fermi
Re: two instance of the same rcp application running at the same time..??? [message #459499 is a reply to message #459434] Sat, 02 December 2006 17:27 Go to previous messageGo to next message
Eclipse UserFriend
Eclipse checks to see whether two applications are using the same workspace by writing out an empty file called '.lock' when starting up, and removing it when shutting down. If it's present in subsequent starts, it prompts a dialog asking for a new workspace.

You could easily perform the same behaviour for an RCP application if you wanted, or synchronise on any other unique system resource (other file on disk, network port etc.)

Alex.
Re: two instance of the same rcp application running at the same time..??? [message #459508 is a reply to message #459499] Mon, 04 December 2006 14:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fermi.inetmon.com

Yes, by utilizing file locking mechanism is a great idea to detect an
already running instance.. but I'm thinking is there any built-in eclipse
method to do this and can also further open the already running instance?
And using a socket to open a port is not the solution I want since I dont
want to open any port.

anyway, does anyone uses azureus as bittorrent client? It is implemented in
java and it can detect and instead of open a new one, it open the already
running azureus window.. is it possible to do that in java..? (since it
definitely involve two different JVM)

or is there any third party library to do that (a combination of dll and
jni)..?

Thanks in advance.

Regards,
--
Fermi

"Alex Blewitt" <alex_blewitt@yahoo.com> wrote in message
news:6523443.1165098484270.JavaMail.root@cp1.javalobby.org...
> Eclipse checks to see whether two applications are using the same
> workspace by writing out an empty file called '.lock' when starting up,
> and removing it when shutting down. If it's present in subsequent starts,
> it prompts a dialog asking for a new workspace.
>
> You could easily perform the same behaviour for an RCP application if you
> wanted, or synchronise on any other unique system resource (other file on
> disk, network port etc.)
>
> Alex.
Re: two instance of the same rcp application running at the same time..??? [message #459536 is a reply to message #459508] Mon, 04 December 2006 18:45 Go to previous messageGo to next message
Eclipse UserFriend
Some apps register themselves under Bonjour services (aka Rendezevous, aka ZeroConf) which essentially involves creation of a MDNS (multicast DNS) entry on the local host. For example, there's a website registered under _http._tcp.SlimServer on my local box registered, which is what my SlimP3s and SlimDevices look for when they boot.

http://en.wikipedia.org/wiki/Bonjour_(software)

You could use this to determine whether or not there was an app running against it.

Apple has Java clients available under an Apache License:

http://developer.apple.com/networking/bonjour/

Alex.
Re: two instance of the same rcp application running at the same time..??? [message #459623 is a reply to message #459536] Tue, 05 December 2006 16:53 Go to previous message
Eclipse UserFriend
Originally posted by: fermi.inetmon.com

Hi Alex,

Thank you for your insight.. Well what I need is just a simple one, this is
already way too complicated and might not be suitable for me. I think I'm
just going to write a dll that uses winAPI to do all these things 'natively'
for me and link it with my RCP app with JNative or JNI.

Thanks again.

Regards,
--
Fermi

"Alex Blewitt" <alex_blewitt@yahoo.com> wrote in message
news:10974678.1165275970859.JavaMail.root@cp1.javalobby.org...
> Some apps register themselves under Bonjour services (aka Rendezevous, aka
> ZeroConf) which essentially involves creation of a MDNS (multicast DNS)
> entry on the local host. For example, there's a website registered under
> _http._tcp.SlimServer on my local box registered, which is what my SlimP3s
> and SlimDevices look for when they boot.
>
> http://en.wikipedia.org/wiki/Bonjour_(software)
>
> You could use this to determine whether or not there was an app running
> against it.
>
> Apple has Java clients available under an Apache License:
>
> http://developer.apple.com/networking/bonjour/
>
> Alex.
Re: two instance of the same rcp application running at the same time..??? [message #459639 is a reply to message #459623] Tue, 05 December 2006 07:16 Go to previous message
Eclipse UserFriend
ZeroConf is cool, though, and it's implemented in pure Java in the Apple downloads (as well as others). What it will also give you is any instances of that app running on any other host in the same local subnet ;-)

I believe that the ECF has a ZeroConf implementation already for chatting.

Alex.
Previous Topic:fixed editor part size
Next Topic:Initializing data model
Goto Forum:
  


Current Time: Fri Mar 28 00:00:24 EDT 2025

Powered by FUDForum. Page generated in 0.07889 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top