Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Preventing Reflection

Hi,
 
Can you tell me if it's possible to catch reflection on a specific class, and where reflection does occur get a handle on the target object?
 
Something like this, except that this doesn't work:
 
public privileged aspect BlockReflection
{

 pointcut captureReflection(apoptotic.bookTrading.BookSellerAgent seller): call(* java.lang.reflect..*.*(..))  && target(seller); 
  before(apoptotic.bookTrading.BookSellerAgent seller) : captureReflection(seller)
  {  
      // call a method on the object which was targetted by reflection
       seller.takeDown();  
  }
   
}
 
 
Really appreciate it.
 
Rob

 

 
 
 
 

Back to the top