Hi All,

    I have tried to test the "field advise" with JBoss Server. But it didn't 
work. 

My testing sample is quite simple that when a Order Class's member field 
orderDate is accessed, an access Method will be called.

public class Order
  | {
  |   
  |   public int orderId = -1 ;
  |   public double amt = -1f;
  |   public Date orderDate;
  |   
  |   public void shipOut() throws OrderException
  |   {
  |     System.out.println("Order with Id : " + orderId + " is shipping out 
now!!");
  | 
  |     
  |   }
  | 
  | }

Advise Method :
  public Object access(FieldWriteInvocation invocation) throws Throwable
  |   {
  |     System.out.println("Write the Field");
  |     return invocation.invokeNext();  
  |   }
  |   
  |   public Object access(FieldReadInvocation invocation) throws Throwable
  |   {
  |     System.out.println("Read the field");
  |     return invocation.invokeNext();  
  |   }


jboss-aop.xml:
        <bind pointcut="field(public java.util.Date Order->orderDate)">
  |             <advice aspect="TestingOrderAspect" name="access"/>
  |     </bind>


Then, I deploy to server with *.aop. When I access the field orderDate by jsp, 
the access(..) method is not called. 

Is it any Wrong??

Alfred

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

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


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to