com.vaadin.client.communication
Class Heartbeat

java.lang.Object
  extended by com.vaadin.client.communication.Heartbeat

public class Heartbeat
extends java.lang.Object

Handles sending of heartbeats to the server and reacting to the response

Since:
7.2
Author:
Vaadin Ltd

Constructor Summary
Heartbeat()
           
 
Method Summary
protected  ApplicationConnection getConnection()
          Deprecated. 
 int getInterval()
           
 void init(ApplicationConnection applicationConnection)
          Initializes the heartbeat for the given application connection
 void schedule()
          Updates the schedule of the heartbeat to match the set interval.
 void send()
          Sends a heartbeat to the server
 void setInterval(int heartbeatInterval)
          Changes the heartbeatInterval in runtime and applies it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Heartbeat

public Heartbeat()
Method Detail

init

public void init(ApplicationConnection applicationConnection)
Initializes the heartbeat for the given application connection

Parameters:
connection - the connection

send

public void send()
Sends a heartbeat to the server


getInterval

public int getInterval()
Returns:
the interval at which heartbeat requests are sent

schedule

public void schedule()
Updates the schedule of the heartbeat to match the set interval. A negative interval disables the heartbeat.


getConnection

@Deprecated
protected ApplicationConnection getConnection()
Deprecated. 

Returns:
the application connection

setInterval

public void setInterval(int heartbeatInterval)
Changes the heartbeatInterval in runtime and applies it.

Parameters:
heartbeatInterval - new interval in seconds.


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.