org.barracudamvc.core.event
Interface LongRunning


public interface LongRunning

This interface indicates an EventHandler takes a long time to run. As such, Barracuda will automatically send a response back to the browser giving the user the opportunity to a) see that its going to take a while and b) interrupt the process if they so choose.

Since:
010404_1
Author:
christianc@granitepeaks.com

Method Summary
 List getAdditionalModels()
          get any additional BTemplate models.
 int getElapsed()
          get elapsed (in secs).
 int getETA()
          get ETA (in secs).
 int getPercentComplete()
          get the percent complete (int between 0 and 100).
 BaseEvent getRedirectEvent()
          get the redirect event for this LongRunning process.
 int getRefreshRate()
          get the refresh rate (in secs).
 StateMap getStateMap()
          get the statemap (may be used for storing key/val info, which can then be retrieved from the template).
 Class getTemplateClass()
          get the custom template class.
 void reset()
          resets the start time.
 void setAdditionalModels(List imodels)
          provide a List of additional BTemplate models to make available during to the LongRunningEventGateway template.
 void setElapsed(int secs)
          set elapsed (in secs).
 void setETA(int secs)
          set ETA (in secs). -1 indicates the DEFAULT_ETA will be used
 void setPercentComplete(int percent)
          set the percent complete (int between 0 and 100).
 void setRedirectEvent(BaseEvent be)
          Specify the redirect event to be fired if the LongRunning process is cancelled
 void setRefreshRate(int secs)
          set the refresh rate (in secs). -1 indicates the DEFAULT_REFRESH_RATE will be used
 void setTemplateClass(Class cl)
          provide a different Template class instead of the default Barracuda template, This will typically be used by developers who want to override L&F of the progress screen.
 

Method Detail

setRedirectEvent

public void setRedirectEvent(BaseEvent be)
Specify the redirect event to be fired if the LongRunning process is cancelled


getRedirectEvent

public BaseEvent getRedirectEvent()
get the redirect event for this LongRunning process. Typically called by LongRunningEventGateway.


setRefreshRate

public void setRefreshRate(int secs)
set the refresh rate (in secs). -1 indicates the DEFAULT_REFRESH_RATE will be used


getRefreshRate

public int getRefreshRate()
get the refresh rate (in secs). If the refresh rate has not been set, DEFAULT_REFRESH_RATE will be returned.


setETA

public void setETA(int secs)
set ETA (in secs). -1 indicates the DEFAULT_ETA will be used


getETA

public int getETA()
get ETA (in secs). If the ETA has not been set, DEFAULT_ETA will be returned.


setElapsed

public void setElapsed(int secs)
set elapsed (in secs). This can be called by the developer's event handler code if desired to manually specify how much time has elapsed. If you don't call this method, elapsed time be determined dynamically by comparing the amount of time elapsed from object creation.


getElapsed

public int getElapsed()
get elapsed (in secs). If a elapsed time has not been programatically specified, it will be calulated dynamically. Typically called by LongRunningEventGateway.


setPercentComplete

public void setPercentComplete(int percent)
set the percent complete (int between 0 and 100). This can be called by the developer's event handler code if desired to manually specify completion percent. If you don't call this method, percent completed will be determined dynamically by comparing the amount of time elapsed with ETA.


getPercentComplete

public int getPercentComplete()
get the percent complete (int between 0 and 100). If a percentage complete has not been programatically specified, it will be calulated dynamically. Typically called by LongRunningEventGateway.


getStateMap

public StateMap getStateMap()
get the statemap (may be used for storing key/val info, which can then be retrieved from the template). Typically called by the developer's event handling code to set some kind of value, and then by LongRunningEventGateway to retrieve that value when requested by the template.


setAdditionalModels

public void setAdditionalModels(List imodels)
provide a List of additional BTemplate models to make available during to the LongRunningEventGateway template. This method would be called by the developers event handler code to provide additional models for the template to access.


getAdditionalModels

public List getAdditionalModels()
get any additional BTemplate models. Typically called by LongRunningEventGateway.


setTemplateClass

public void setTemplateClass(Class cl)
provide a different Template class instead of the default Barracuda template, This will typically be used by developers who want to override L&F of the progress screen.


getTemplateClass

public Class getTemplateClass()
get the custom template class. Typically called by LongRunningEventGateway.


reset

public void reset()
resets the start time. Typically called by ApplicationGateway prior to dispatching.



Copyright © 2004 BarracudaMVC.org All Rights Reserved.