org.wicketstuff.push.timer
Class TimerPushService

java.lang.Object
  extended by org.wicketstuff.push.timer.TimerPushService
All Implemented Interfaces:
java.io.Serializable, IPushService

public class TimerPushService
extends java.lang.Object
implements IPushService

An implementation of IPushService based on a polling mechanism. This class is thread safe, and can be safely reused.

Author:
Xavier Hanin
See Also:
Serialized Form

Constructor Summary
TimerPushService(org.apache.wicket.util.time.Duration duration)
          Constructs a TimerPushService with the given polling interval.
 
Method Summary
 org.apache.wicket.util.time.Duration getDuration()
          Returns the polling interval
 IPushTarget installPush(org.apache.wicket.Component component)
          Installs a push facility on the given component.
 void uninstallPush(org.apache.wicket.Component component)
          Uninstalls a push installer which has previously been installed on a component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerPushService

public TimerPushService(org.apache.wicket.util.time.Duration duration)
Constructs a TimerPushService with the given polling interval.

Parameters:
duration - the polling interval, must not be null
Method Detail

installPush

public IPushTarget installPush(org.apache.wicket.Component component)
Description copied from interface: IPushService
Installs a push facility on the given component.

The component on which the push facility is installed doesn't really matter as soon as it is visible, except that only one push service can be installed by component.

Usually the page is used as component.

Specified by:
installPush in interface IPushService
Parameters:
component - the component on which the push facility must be installed

uninstallPush

public void uninstallPush(org.apache.wicket.Component component)
Description copied from interface: IPushService
Uninstalls a push installer which has previously been installed on a component.

Calling this method after calling #installPush(Component, IPushInstaller) is mandatory if you use a different push installer instance for each component instance.

Specified by:
uninstallPush in interface IPushService
Parameters:
component - the component on which push service must be uninstalled

getDuration

public org.apache.wicket.util.time.Duration getDuration()
Returns the polling interval

Returns:
the polling interval


Copyright © 2010. All Rights Reserved.