Jython support in iPOJO API
---------------------------
Key: FELIX-2497
URL: https://issues.apache.org/jira/browse/FELIX-2497
Project: Felix
Issue Type: Wish
Components: iPOJO
Reporter: YANG, BongYeol
Priority: Minor
I tried to build iPOJO component dynamically using jython script and iPOJO api,
but I can't. Because iPOJO cannot find dynamically added python proxy classes
like this:
----
>>> sys.add_package('org.apache.felix.ipojo.api')
<java package org.apache.felix.ipojo.api 0x2>
>>> from org.apache.felix.ipojo.api import PrimitiveComponentType
>>> PrimitiveComponentType
<type 'org.apache.felix.ipojo.api.PrimitiveComponentType'>
>>> from java.lang import *
>>> Runnable
<type 'java.lang.Runnable'>
>>> class Test(Runnable):
... def run():
... print 'Hello'
...
>>> Test().getClass().getName()
u'org.python.proxies.__main__$Test$0'
>>> c =
>>> PrimitiveComponentType().setBundleContext(bc).setClassName(u'org.python.proxies.__main__$Test$0').createInstance()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
at
org.apache.felix.ipojo.api.PrimitiveComponentType.getClassByteArray(PrimitiveComponentType.java:473)
at
org.apache.felix.ipojo.api.PrimitiveComponentType.manipulate(PrimitiveComponentType.java:455)
at
org.apache.felix.ipojo.api.PrimitiveComponentType.createFactory(PrimitiveComponentType.java:431)
at
org.apache.felix.ipojo.api.PrimitiveComponentType.initializeFactory(PrimitiveComponentType.java:198)
at
org.apache.felix.ipojo.api.PrimitiveComponentType.getFactory(PrimitiveComponentType.java:171)
at
org.apache.felix.ipojo.api.ComponentType.ensureFactory(ComponentType.java:185)
at
org.apache.felix.ipojo.api.ComponentType.ensureAndGetFactory(ComponentType.java:177)
at
org.apache.felix.ipojo.api.ComponentType.createInstance(ComponentType.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
java.lang.IllegalStateException: java.lang.IllegalStateException: An exception
occurs during implementation class manipulation : cannot found the class file
org/python/proxies/__main__$Test$0.class
----
How about creating overloaded setClassName() method on API? for example,
setClass(Class<?>) or any idea..?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.