Issue 1 in srmi: Use Byte Code Instrumentation instead of overriding

0 views
Skip to first unread message

codesite...@google.com

unread,
Dec 23, 2007, 12:17:48 AM12/23/07
to srmi...@googlegroups.com
Issue 1: Use Byte Code Instrumentation instead of overriding
http://code.google.com/p/srmi/issues/detail?id=1

New issue report by mohammad.nabil.h:
The normal SRMI technique to forward method calls for remote objects to the
responsible RMI object is generating a class and override the method.
The problem with this technique that it's limit it the override limit.
That technique can't forward field accesses or private method invocations.
A better way is to use Byte Code Instrumentation instead. That can access
every thing, the sky's the limit.

A complete sample of using byte code instrumentation is in SRMI.Tests
package. Currently using BCEL to manipulate byte code, and using JVMTI
(java.instrument) to redefine the class. Further possibilities exits by
using the JVMTI PopFrames functions, so we can hot swap a method even
if it
is currently being executed. Another thing can be used is to find a way to
use the Java compiling facilities in Javassit to make it easier to write
the modified methods instead of writing them in plain byte code.

Other issues include if a constructor is going to use a static field to
know if it's remote or local, then synchronization needs to be done for
that static field to assure every instance gets the right value.
Also we need to think how the SRMI user can tell SRMI that he wants a
specific instance to be remoted or not.

Also we must know a way to get the byte code of an already loaded
class, so
we don't mess other setups done by other libraries -or even us- each time
we redefine that class.

Issue attributes:
Status: Accepted
Owner: mohammad.nabil.h
CC: shereef.sakr
Labels: Type-Enhancement Priority-Low Milestone-Release1.0
Component-Logic Performance

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

codesite...@google.com

unread,
Dec 23, 2007, 11:01:32 PM12/23/07
to srmi...@googlegroups.com
Issue 1: Use Byte Code Instrumentation instead of overriding
http://code.google.com/p/srmi/issues/detail?id=1

Comment #1 by mohammad.nabil.h:
We can obtain the latest class bytecode through using our agent's
callback (class
redifined) to cache the byte code.

Reply all
Reply to author
Forward
0 new messages