1 15 package org.apache.tapestry.link; 16 17 import org.apache.tapestry.IAction; 18 import org.apache.tapestry.IActionListener; 19 import org.apache.tapestry.IBinding; 20 import org.apache.tapestry.IRequestCycle; 21 import org.apache.tapestry.RenderRewoundException; 22 import org.apache.tapestry.Tapestry; 23 import org.apache.tapestry.engine.ActionServiceParameter; 24 import org.apache.tapestry.engine.ILink; 25 import org.apache.tapestry.listener.ListenerInvoker; 26 27 33 34 public abstract class ActionLink extends AbstractLinkComponent implements IAction 35 { 36 public abstract boolean isStateful(); 37 38 45 46 public boolean getRequiresSession() 47 { 48 return isStateful(); 49 } 50 51 public ILink getLink(IRequestCycle cycle) 52 { 53 String actionId = cycle.getNextActionId(); 54 55 if (cycle.isRewound(this)) 56 { 57 getListenerInvoker().invokeListener(getListener(), this, cycle); 58 59 throw new RenderRewoundException(this); 60 } 61 62 return getLink(cycle, Tapestry.ACTION_SERVICE, new ActionServiceParameter(this, actionId)); 63 } 64 65 public abstract IActionListener getListener(); 66 67 public abstract ListenerInvoker getListenerInvoker(); 68 } | Popular Tags |