com.icesoft.faces.async.render
Class IntervalRenderer

java.lang.Object
  extended bycom.icesoft.faces.async.render.GroupAsyncRenderer
      extended bycom.icesoft.faces.async.render.OnDemandRenderer
          extended bycom.icesoft.faces.async.render.IntervalRenderer
All Implemented Interfaces:
AsyncRenderer, java.lang.Runnable

public class IntervalRenderer
extends OnDemandRenderer
implements java.lang.Runnable

The IntervalRenderer is type of GroupAsyncRenderer that is used to request a single render pass on a group of Renderables. The render pass is executed repeatedly on a set interval. The interval is measured from the start of one render pass to the start of the next render pass so does not take the time to complete the render pass into account. If the time to complete the render pass exceeds the interval then the next render pass is done on a best effort basis. IntervalRenderers can be created and used directly but it is recommended to use the RenderManager to create and managed named render groups.

Author:
ICEsoft Technologies, Inc.
See Also:
RenderManager, GroupAsyncRenderer

Field Summary
 
Fields inherited from class com.icesoft.faces.async.render.GroupAsyncRenderer
group, name, renderManager, stopRequested
 
Constructor Summary
IntervalRenderer()
           
 
Method Summary
 void dispose()
          Remove all Renderables from the group and removes the reference to the RenderHub.
 long getInterval()
          Get the currently specified interval.
 void requestRender()
          Schedules a render pass on the group of Renderables using the interval value specified using this.setInterval.
 void run()
           
 void setInterval(long interval)
          Set the interval to wait before executing the next render pass.
 
Methods inherited from class com.icesoft.faces.async.render.GroupAsyncRenderer
add, clear, getName, remove, requestStop, setName, setRenderManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntervalRenderer

public IntervalRenderer()
Method Detail

getInterval

public long getInterval()
Get the currently specified interval. If no interval has been explicitly set, then the default interval value (60000 ms) is used.

Returns:
The current interval value in ms.

setInterval

public void setInterval(long interval)
Set the interval to wait before executing the next render pass. Once the rendering has been started, setting the interval has no effect.

Parameters:
interval - The time in ms to wait before starting the next render pass.

requestRender

public void requestRender()
Schedules a render pass on the group of Renderables using the interval value specified using this.setInterval.

Specified by:
requestRender in interface AsyncRenderer
Overrides:
requestRender in class GroupAsyncRenderer

run

public void run()
Specified by:
run in interface java.lang.Runnable

dispose

public void dispose()
Description copied from class: GroupAsyncRenderer
Remove all Renderables from the group and removes the reference to the RenderHub. Once disposed, a GroupAsyncRenderer cannot be re-used. This method is typically used by the RenderManager to cleanly dispose of all managed Renderers when the application is shutting down.

Specified by:
dispose in interface AsyncRenderer
Overrides:
dispose in class GroupAsyncRenderer