/* ActionBridge.java

	Purpose:
		
	Description:
		
	History:
		2013/6/27, Dennis

Copyright (C) 2010 Potix Corporation. All Rights Reserved.

*/
package org.zkoss.zss.jsf;


/**
 * The bridge to wrap and execute a {@link Action} inside zk context
 * @author Dennis
 *
 */
public interface ActionBridge {
	/**
	 * Execute the action in zk lifecycle, and update the result to client, it throws ComponentNotFoundException if zk desktop not found (e.g you run
	 * the action in JSF post-back, so desktop was removed)
	 * @param action
	 */
	public void execute(Action action);
	
	/**
	 * Execute the action in zk lifecycle, and update the result to client. 
	 * It will call {@link Action#execute()} directly if there has no zk desktop to wrap lice-cycle and you set <code>auto<code> to true.
	 * It will throw ComponentNotFoundException if there has no zk desktop and you set <code>auto<code> to false. 
	 * @param action
	 * @param auto true wrap the execution in zk desktop lifecycle automatically, 
	 * @since 3.5.0
	 */
	public void execute(Action action,boolean auto);
}
