/**
 * CancelTimer.java
 * Created Feb 15, 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.service.ServiceRegistry;
import com.tandbergtv.workflow.driver.timer.ITimerService;

/**
 * Removes a timer for a token
 * 
 * @author Sahil Verma
 */
public class CancelTimer implements ActionHandler {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2279989262196597583L;

	/* (non-Javadoc)
	 * @see org.jbpm.graph.def.ActionHandler#execute(org.jbpm.graph.exe.ExecutionContext)
	 */
	public void execute(ExecutionContext context) throws Exception {
		ServiceRegistry.getDefault().lookup(ITimerService.class).deleteTimer(context.getToken());
	}
}
