Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Embedding
-
Labels:None
-
Number of attachments :
Description
In working with Jenkins <http://jenkins-ci.org/> & JRuby integration, I've identified the following problem.
As a part of this effort, I'm serializing object graph (that includes both Java objects and Ruby objects) into an XML format via XStream. When I de-serialize Java proxy objects that implements InternalJavaProxy, there's currently no portable way to set the JavaProxyInvocationHandler. This is forcing me to use reflection to directly set the field, but it should be possible to do this via InternalJavaProxy.
Thinking more about it, maybe the proper method isn't __setInvocationHandler(JavaProxyInvocationHandler) (which also requires JRuby to expose JavaProxyInvocationHandler implementations) but perhaps it should be _setRubyPeer(JavaProxy), because that's really what I'm trying to do — I got a JavaProxy instance and the corresponding Java object already instantiated, and all I want to do is to establish relationships between them.
In this way, I don't need to think about which implementations of JavaProxyInvocationHandler I'm supposed to be using (there are 3 implementations in JavaProxyConstructor and I don't understand the difference.)