4, metadata properties
(1) Metadata of the source level level
l Attributes or annotations for programming elements: usually class or / and methods
/ **
* NORMAL Comments
* @@ org.springframework.transaction.interceptor.defaulttransactionAttribute ()
* /
Public Class PetStoreImpl Implements PetStoreFacade, ORDERSERVICE {
...
}
/ **
* NORMAL Comments
* @@ org.springframework.transaction.interceptor.rulebasedTransactionAttribute ()
* @@ org.springframework.transaction.interceptor.rollbackruleAttribute (Exception.class)
* @@ org.springframework.transaction.interceptor.NorollbackRuleAttribute ("servletexception")
* /
Public void echoexception (Exception ex) throws exception {
....
}
l Spring provides metadata implementation:
• Using Jakarta Commons Attributes (Create Procedure Requires Compilation Procedure)
? JSR-175 (JDK 1.5) program
l Usage:
? AOP: Property to specify aspects
? Minimize web layer configuration: to the URL mapping of the controller
Verification