/**
 * FireTimer.java
 * Created Jan 17, 2007
 * Copyright (C) Tandberg Television 2007
 */
package com.tandbergtv.workflow.exe.timer;

import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;

import com.tandbergtv.workflow.core.event.DefaultMediator;
import com.tandbergtv.workflow.driver.event.NodeTimeoutEvent;

/**
 * This action is executed when the JBPM timer goes off
 * 
 * @author Sahil Verma
 */
public class FireTimer implements ActionHandler {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1608207967715463354L;

	/**
	 * Creates a FireTimer
	 */
	public FireTimer() {
		super();
	}

	/* (non-Javadoc)
	 * @see org.jbpm.graph.def.ActionHandler#execute(org.jbpm.graph.exe.ExecutionContext)
	 */
	public void execute(ExecutionContext context) throws Exception {
		DefaultMediator.getInstance().sendAsync(
			new NodeTimeoutEvent(this, context.getToken(), context.getNode()));
	}
}
