/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.firstejbmodule.calculatrice;

import java.util.logging.Logger;
import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;

/**
 *
 * @author Hoss
 */
@Interceptor
public class LoggingInterceptor {
     Logger logger=Logger .getLogger(this.getClass().getName());
    @AroundInvoke
    public Object Intercept(InvocationContext ctx) throws Exception{
        logger.info("Un traitement avant de faire le calcul");
        Object result=ctx.proceed();
        logger.info("Un traitement aprés le calcul");
        return result;
    }
    }

