Use Joinpoint to get Notified method parameters and pass to notification methods

Source: Internet
Author: User

    • Provides access to the target object, proxy object, method parameter, and other data for the currently notified method
Package Org.aspectj.lang;Import org.aspectj.lang.reflect.SourceLocation;PublicInterfaceJoinpoint {StringTostring();Information about where the connection point is locatedStringToshortstring();Brief information about where the connection point is locatedStringTolongstring();All relevant information about where the connection point is locatedObjectGetthis();//return AOP proxy object object getTarget< Span class= "Hljs-params" > (); //return to target object object[] Getargs (); //returns the list of methods parameters that are notified signature  Getsignature (); //returns the current connection point signature sourcelocation  Getsourcelocationstring getkind (); //connection point type staticpart getStaticPart  (); //return connection point static part}            
    • For wrapping notifications, use the proceed () method to execute the target method
public interface ProceedingJoinPoint extends JoinPoint { public Object proceed() throws Throwable; public Object proceed(Object[] args) throws Throwable;}
    • Access static parts of a connection point, such as the notification method signature, connection point type, and so on
PublicInterfaceStaticpart {Signaturegetsignature (); //returns the current connection point signature string getKind (); //connection point type int getid (); //unique identity string toString (); //information about the location of the connection point string  Toshortstring (); //A brief information about the location of the connection point string  Tolongstring (); //all relevant information about where the connection point is located}            

Special Note: Joinpoint must be the first parameter

Use Joinpoint to get Notified method parameters and pass to notification methods

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.