Re: Re: JLink discover and link to an already running kernel from a Java App
- To: mathgroup at smc.vnet.net
- Subject: [mg61689] Re: [mg61651] Re: JLink discover and link to an already running kernel from a Java App
- From: j michopoulos <john.michopoulos at nrl.navy.mil>
- Date: Wed, 26 Oct 2005 01:01:42 -0400 (EDT)
- References: <43570892.3010702@nrl.navy.mil> <djd013$erb$1@smc.vnet.net> <200510250107.VAA16807@smc.vnet.net>
- Reply-to: john.michopoulos at nrl.navy.mil
- Sender: owner-wri-mathgroup at wolfram.com
Dear Jens, Please see below Jens-Peer Kuska wrote: > Hi, > > that would be a great idea. Say, you have an > Mathematica Kernel that > does a 3 week symbolic computation and during this time > several Java application connect to the kernel and hinder > it to do it's work. Though what you describe is a possible scenario where obviously what I asked does not provide bebefits (and is certainly NOT what I had in mind) there are many other scenarios that what I asked is terribly important: for instance, the running kernel gets real-time data from a hardware data-acquisition device controled by the java application (that seeks to connect to that kernel) and therefore symbolic computation performance is NOT as important. Anotehr example may be when the running kernel needs to exchange expressions with another "legacy" application wrapped by Java NAtive Interface (JNI) API enabled Java wrapper and therefore play an alternating rome of client-server for and with another program. Many other examples can be also specified when you want the running kernel to depent on other applications in order to achieve its specifications. > > Your Java application may create a link OK how can one create a link WITHOUT spawning a new kernel? How this Java app will expose its namespace to the kernel? > and you can take a running kernel and tell the kernel > to connect to the link generated by your Java > application. That would be ok if I had access of the running kernel through some other front-end application which is NOT an option in my USE CASE (ala UML) The idea is that the running kernel does not (and cannot apriori) know of the java app and the java app does not know of the running kernel's presence. The idea is how one can discover the other by running some code within its runtime env? This is supposed to happen in an asynchronous and agnostic cooperating processes semantic base fashion. If you know of any examples along these lines I would enormously appreciate your help. Thanks greatly for responding to my request, -john michopoulos > > Regards > Jens > > "j michopoulos" <john.michopoulos at nrl.navy.mil> > schrieb im Newsbeitrag > news:djd013$erb$1 at smc.vnet.net... > | Another variation of my previous posting (see > below) can be expressed as > | follows: > | > | Is it possible to detect from within a Java app > if a Mathematica Kernel > | is already running and after that connect to it? > If yes, how? > | > | I would enormously appreciate it if somebody > could point me to an > | example or document that will shed some light on > this, or, > | alternatively, share his/her experience on the > subject. > | > | Thanks greatly, > | > | -john michopoulos > | ======================================== > | John G. Michopoulos, Ph. D. > | Naval Research Laboratory, > | Center of Computational Material Science > | Special Projects Group, Code 6390.2 > | Computational Multiphysics Systems Lab. > | 4555 Overlook Ave. SW, Washington DC 20375 > | tel.202.767.2189 > | e-mail: john.michopoulos at nrl.navy.mil > | > | j michopoulos wrote: > | > While one can use the ShareKernel[] call > within mathematica to share one > | > kernel with multiple front-ends as explained > in > | > > http://support.wolfram.com/mathematica/mathlink/general/sharekernel.html, > | > I cannot find anywhere any info how to share a > kernel that was started > | > by one instance of a Java App front end via a > standard > | > MathLinkFactory.createKernelLink(...) call, > and then be discovered by > | > another application or instance of the > previous App to continue > | > expression evaluation under the original > kernel. > | > > | > I have created Mathematica actors for the > Ptolemy-II system > | > (http://ptolemy.eecs.berkeley.edu/ptolemyII/) > that open and close the > | > kernel around the designated expression > evaluation for the purpose of > | > automating theory generation, but now I need a > variant of these actors > | > that exploit the same environment and that > requires that they both > | > access the same Kernel which makes it a > special case of he problem I > | > described in the previous paragraph. > | > > | > I would enormously appreciate any help along > these lines.. > | > > | > > | > -- john m. > | > ======================================== > | > John G. Michopoulos, Ph. D. > | > Naval Research Laboratory, > | > Center of Computational Material Science > | > Special Projects Group, Code 6390.2 > | > Computational Multiphysics Systems Lab. > | > 4555 Overlook Ave. SW, Washington DC 20375 > | > tel.202.767.2189 > | > e-mail: john.michopoulos at nrl.navy.mil > | > > | > >
- References:
- Re: JLink discover and link to an already running kernel from a Java App
- From: "Jens-Peer Kuska" <kuska@informatik.uni-leipzig.de>
- Re: JLink discover and link to an already running kernel from a Java App