[jboss-user] [Javassist] - How can I instrument access only to a specific array

susanin do-not-reply at jboss.com
Fri Jun 8 08:30:09 EDT 2012


susanin [https://community.jboss.org/people/susanin] created the discussion

"How can I instrument access only to a specific array"

To view the discussion, visit: https://community.jboss.org/message/740677#740677

--------------------------------------------------------------
Hi,

I have a class which has one field of an array type, e.g.
class Pojo {
     int[] ids = new int[100];
     ....
}

I'd like to replace only accesses to this specific array by means of Javassist. 

>From what I see so far in the replaceArrayAccess API, one can only replace access to all arrays of a certain type, e.g. to all int arrays. Does it mean that there is no way to instrument only access to a sepecific array? Is there some sort of a technical limitation related to this?

What can be workarounds or approaches to instrument only something specific? Or may be instrument all accesses but determine at runtime if this is something specific being accessed (how this can be done effectively?) and reacting differently only in this case?

Thanks,
   Leo
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/740677#740677]

Start a new discussion in Javassist at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2062]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120608/1ed6fb12/attachment.html 


More information about the jboss-user mailing list