Hi, there.
This is my first post after checking out JBossAOP, and implementing persistance and 
transaction layer for my POJOs with it.

So ...

Is it possible to intercept element-of-an-array assignment?
I mean:

  | //I'd like some code here (through Interceptor, of course)
  | myArray[5] = newElement;
  | //maybe I also would like some code 'around'..
  | //maybe sth like this: myArray[5] = getCachedMyElement;
  | //or even 'after': UPDATE OBJECT_TABLE .... WHERE ... 
  | 

And the binding in jboss-aop.xml, would look like this:

  | <aop>
  |     <bind pointcut="array-element-set(myClass.myArray)"...
  |     <bind pointcut="array-element-get(myClass.myArray)" ...
  | </aop>
  | 

If I had the functionality, then I would write persistance-layer with no limitations 
on collections classes, or whatever limitations existing persistance layers may have. 
More deeply: One would not write bindings for every collection class, i.e. 
collection.add(), collection.get(i).... 
One would write generic persistance, by: intercepting 
every-variable-change-including-array-element-assignment.

And the real example of this is: java.util.ArrayList, where it stores data internally 
in an array:

  | package java.util;
  | public class ArrayList {
  | 
  | private transient Object[] elementData
  | ...
  | public boolean add(Object o) {
  |     ensureCapacity(size + 1);  // Increments modCount!!
  |     elementData[size++] = o;
  |     return true;
  | }
  | ...
  | 

I think you know what I mean now. I'd like to have simple

  | <bind poincut="array-element-set(java.util.ArrayList->elementData)">
  | 
instead of binding, and implementing every "collection" class' method which manages 
data.

PS. Of course AspectJ also doesn't have functionality mentioned above, either

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3843602#3843602

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3843602


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to