Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
JSR223 Access Python class instances through Java
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jared Klumpp  
View profile  
 More options Nov 12, 4:25 pm
Newsgroups: comp.lang.python
From: Jared Klumpp <jaredatwo...@gmail.com>
Date: Thu, 12 Nov 2009 13:25:41 -0800 (PST)
Local: Thurs, Nov 12 2009 4:25 pm
Subject: JSR223 Access Python class instances through Java
I am trying to access (from Java) a python class that extends a Java
interface. The following program runs fine in the jython console (I
can instantiate Tada, call t.getName() and everything prints
correctly.) However, if I invoke test1() from Java using JSR223, the
returned object is inaccessible (proxy type) and none of the "in
init", "in getName" strings will print.

Furthermore, none of the lines print unless I convert ITest to a
concrete class, but then the getName methods return the concrete
implementation's string.

Has anyone successfully had this situation work, and how did you do
it?

Thanks in advance

Code:
===========
import ITest

class Tada(ITest):
        def __init__(self):
                print "In Init"

        def getName(self):
                print "In getName"
                return "Joe Schmoe"

def test1():
        t = Tada()
        print t.getName()
        print "Hello, World"
        return t


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google