All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.linkare.zas.aspectj.logging.Logger.aj Maven / Gradle / Ivy

Go to download

The AspectJ based implementation of the Zas project. This is the new version of the implementation of Zas which, initially, started as a M.Sc. thesis project by Paulo Zenida at ISCTE.

The newest version!
package com.linkare.zas.aspectj.logging;

import static com.linkare.zas.LoggerSingleton.LOGGER;

import org.aspectj.lang.annotation.SuppressAjWarnings;

import com.linkare.pointcuts.AspectJPointcuts;
import com.linkare.zas.api.EnforcerAdvise;
import com.linkare.zas.api.InvokerControllerAdvise;
import com.linkare.zas.api.StackOfSubjectsBuilderAdvise;
import com.linkare.zas.api.TrusterAdvise;
import com.linkare.zas.api.ZasInitializer;

/**
 * This aspect will be responsible for the logging within the framework, in what concerns the security aspects from Zás.
 * 
 * @author Paulo Zenida - Linkare TI
 */
public abstract aspect Logger {

    before(final ZasInitializer zasInitializer) :
	execution(@ZasInitializer protected *..*.*.new(..)) && 
	@annotation(zasInitializer) {
	LOGGER.info("Initializing " + thisJoinPoint.getSignature().getDeclaringTypeName());
    }

    @SuppressAjWarnings("adviceDidNotMatch")
    before(final EnforcerAdvise enforcerAdvise) : 
	AspectJPointcuts.aspectAdvice() && 
	@annotation(enforcerAdvise) {
	LOGGER.debug("Before executing advice on enforcer " + thisJoinPoint);
    }

    @SuppressAjWarnings("adviceDidNotMatch")
    before(final StackOfSubjectsBuilderAdvise stackOfSubjectsBuilderAdvise) : 
	AspectJPointcuts.aspectAdvice() && 
	@annotation(stackOfSubjectsBuilderAdvise) {
	LOGGER.debug("Before executing advice on stack of subjects builder " + thisJoinPoint);
    }

    @SuppressAjWarnings("adviceDidNotMatch")
    before(final TrusterAdvise trusterAdvise) : 
	AspectJPointcuts.aspectAdvice() && 
	@annotation(trusterAdvise) {
	LOGGER.debug("Before executing advice on truster " + thisJoinPoint);
    }

    @SuppressAjWarnings("adviceDidNotMatch")
    before(final InvokerControllerAdvise invokerControllerAdvise) : AspectJPointcuts.aspectAdvice() && @annotation(invokerControllerAdvise) {
	LOGGER.debug("Before executing advice on invoker controller " + thisJoinPoint);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy