Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Status of Ruby<->Java Interfaces

Reply
Thread Tools

Status of Ruby<->Java Interfaces

 
 
Jeff
Guest
Posts: n/a
 
      10-07-2004
Hi,

I have a Java program that I'd like to access with Ruby, and I'm
looking for the 'right tool for the job'. The Java program is an API
collection of classes that implement a network/socket protocol, and
I'd like to find a way to have Ruby make the calls, e.g.
Java:
public class MySocket {
private Socket m_socket; // the socket
private DataOutputStream m_dos; // the socket
output stream
/////more stuff here....
private void send( String str) throws IOException {
m_dos.write( str.getBytes() );
m_dos.write( EOL);
}
}

and I'd like to be able to do something like:
Ruby:
mysock=Java.Class.MySockect.new (or something along these lines)
mysock.send("Hello there")

So what is the state of the world with the various options that exist
in Ruby for this sort of thing? I've had a brief look at rjni, rjava
and rjb. Each of which seem to be quite 'alpha'. Any comments,
suggestions on which is best? Any other options in terms of design?
Will these work with network/socket classes in Java?

Thanks in advance!
Jeff
 
Reply With Quote
 
 
 
 
James Edward Gray II
Guest
Posts: n/a
 
      10-07-2004
On Oct 7, 2004, at 3:44 PM, Jeff wrote:

> So what is the state of the world with the various options that exist
> in Ruby for this sort of thing? I've had a brief look at rjni, rjava
> and rjb. Each of which seem to be quite 'alpha'. Any comments,
> suggestions on which is best? Any other options in terms of design?
> Will these work with network/socket classes in Java?


I have know experience with any Java <-> Ruby bridges, but sine I know
it exists and I didn't see you mention it, have you checked out JRuby?
Just a thought.

James Edward Gray II



 
Reply With Quote
 
 
 
 
Mauricio Fernández
Guest
Posts: n/a
 
      10-07-2004
On Fri, Oct 08, 2004 at 06:24:42AM +0900, James Edward Gray II wrote:
> On Oct 7, 2004, at 3:44 PM, Jeff wrote:
>
> >So what is the state of the world with the various options that exist
> >in Ruby for this sort of thing? I've had a brief look at rjni, rjava
> >and rjb.


rjb is the only one actively developed atm., so it's probably the best
option.

I stopped working on rjni when I discovered that the JVM was interacting
with the signals ruby uses to implement threads (so that Ruby threads
wouldn't work) and realized that the non-reentrancy of ruby 1.x made
this all quite hard...

> Each of which seem to be quite 'alpha'. Any comments,
> >suggestions on which is best? Any other options in terms of design?
> >Will these work with network/socket classes in Java?


The main problem would be when you have multiple Java threads; that's
hard to handle in 1.x, at least if you're using JNI directly.

--
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com



 
Reply With Quote
 
Randy W. Sims
Guest
Posts: n/a
 
      10-08-2004
On 10/7/2004 4:44 PM, Jeff wrote:
> Hi,
>
> I have a Java program that I'd like to access with Ruby, and I'm
> looking for the 'right tool for the job'. The Java program is an API
> collection of classes that implement a network/socket protocol, and
> I'd like to find a way to have Ruby make the calls, e.g.


Is there any particular reason you can't use the ruby sockets interface
in this case?

Randy.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BRI interfaces status check geoar75@gmail.com Cisco 8 04-24-2010 10:15 AM
Monitoring line status where interfaces won't go down Gr!scha S+egemann Cisco 6 06-09-2008 07:56 PM
Recommend a free 'Status Monitor' or 'Dashboard' to report overnight tasks status? Shug Java 13 12-15-2006 06:22 PM
Recommend a free 'Status Monitor' or 'Dashboard' to report overnight tasks status? Shug C++ 13 12-15-2006 06:22 PM
POST problem - IIS sc-win32-status:64; sc-status:400 saha ASP .Net 0 07-14-2005 07:10 AM



Advertisments