/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.demo;

import java.io.Serializable;
import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;

/**
 *
 * @author Administrator
 */
@Audit
@Interceptor
public class AuditInterpetor implements Serializable{
     @AroundInvoke
    public Object AuditMethodEntry(InvocationContext invocationContext)
        throws Exception {
       
        System.out.println(
                "Entering method: " + invocationContext.getMethod().getName()
                + " in class "
                + invocationContext.getMethod().getDeclaringClass().getName());
        
        return invocationContext.proceed();
    }
}
