package eu.dnetlib.contract.event;

import org.aspectj.lang.JoinPoint;

/**
 * Exception contract event.
 * @author mhorst
 *
 */
public class ExceptionContractEvent extends AbstractContractEvent implements
		IContractEvent {

	public static final String TYPE = "exception";
	
	private Exception exception;

	/**
	 * Default constructor.
	 * @param joinPoint
	 * @param exception
	 */
	public ExceptionContractEvent(JoinPoint joinPoint, Exception exception) {
		super(joinPoint);
		this.exception = exception;
	}

	/* (non-Javadoc)
	 * @see eu.dnetlib.contract.ctx.IContractContext#getType()
	 */
	public String getType() {
		return TYPE;
	}
	
	/**
	 * Returns exception for contract event.
	 * @return exception for contract event
	 */
	public Exception getException() {
		return exception;
	}

	/**
	 * Sets exception for contract event.
	 * @param exception
	 */
	public void setException(Exception exception) {
		this.exception = exception;
	}

}
