For Programmers: Free Programming Magazines  


Home > Archive > Smalltalk > May 2005 > Accessing JAVA code from Smalltalk









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Accessing JAVA code from Smalltalk
jtzecher

2005-05-10, 4:00 pm

I am using VA Smalltalk 6.0.2. A project request I have just received
is to have my application interface with CTI which is a vendor supplied
application that lets you connect your telephone system with your
computer applications. It has a JAVA API but no Smalltalk API.

What I would like to do is write a few JAVA classes as a kind of
wrapper to CTI and then call those classes from my Smalltalk app. The
IBM documentation points me to the PlatformFunction class which really
seems designed to only interface with C or maybe Pascal. I've thought
of writing a C wrapper around the JAVA wrapper and then calling that
from Smalltalk but that is starting to sound a little kludgy and I
don't even know C.

I found a reference mentioned in here to a website that actually does
exactly what I'm asking for:
http://www.metagnostic.org/Dol=ADph...lk/JNIPort.html
BUT it is only good for the Dolphin dialect of Smalltalk. There is no
"contact us" information on the website so I can't get to the author
directly.

My question: does anybody know if JNIPort, or any other tool, will work
with VA to allow JAVA and VA Smalltalk to interact?

Thomas Koschate

2005-05-10, 8:59 pm

jtzecher wrote:

> What I would like to do is write a few JAVA classes as a kind of
> wrapper to CTI and then call those classes from my Smalltalk app. The
> IBM documentation points me to the PlatformFunction class which really
> seems designed to only interface with C or maybe Pascal. I've thought
> of writing a C wrapper around the JAVA wrapper and then calling that
> from Smalltalk but that is starting to sound a little kludgy and I
> don't even know C.


You might want to load the Server Smalltalk extensions and have a look
at RMI as a possibility.

Tom
-=-=-
.... No matter what happens, somebody will find a way to take it too
seriously.
Chris Uppal

2005-05-11, 8:58 am

[x-post to ibm.software.vasmalltalk removed because that ng doesn't exist
on my server]

jtzecher wrote:

> I found a reference mentioned in here to a website that actually does
> exactly what I'm asking for:
> http://www.metagnostic.org/Dol_phin...lk/JNIPort.html
> BUT it is only good for the Dolphin dialect of Smalltalk. There is no
> "contact us" information on the website so I can't get to the author
> directly.
>
> My question: does anybody know if JNIPort, or any other tool, will work
> with VA to allow JAVA and VA Smalltalk to interact?


JNIPort doesn't have a VA port -- at least not that /I/ know of (and I wrote
JNIPort). Nor -- as far as I know -- is there anything else similar in
concept.

You /could/ port JNIPort to VA, but I wouldn't advise it for your purposes. It
would be a fairly large bit of work (although I'd be happy to help a bit),
almost certainly more than it would be worth just to get access to one
product's API.

Since you don't know C, I wouldn't advise going anywhere near using raw JNI to
talk to Java (not trivial, and very very easy to get wrong). I find it hard to
believe that any CTI vendor only has Java APIs available, /surely/ there's at
least a C binding too, and possible more (I'd expect to find a COM or ActiveX
binding if its a Windows product, for instance). Still, if Java is the only
available API, then my first impulse would be to separate out the Java logic
into an independent program and communicate with that via TCP/IP. I don't know
anything about the "Server Smalltalk extensions" that Tom mentioned, but if
they allow VA to talk RMI to Java objects, then that might be a relatively
painless way of setting up such a communication path. I don't suppose it would
be particularly difficult, though, just to roll-your-own communication
protocol.

-- chris




jtzecher

2005-05-26, 4:00 pm

Hi Chris,

Thanks for the information. I would like to ask you several more
questions about JNIPort including whether you would be interested in
doing a little consulting. Please respond to joel.zecher@ge.com so we
can talk some more offline.

Thanks
Joel

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com