Package org.apache.tapestry5.services
Interface Heartbeat
- All Known Implementing Classes:
HeartbeatImpl
public interface Heartbeat
Allows for deferred execution of logic, useful when trying to get multiple components to coordinate behavior. A
component may add a command to be executed "at the end of the heartbeat". The classic example of
this is a Label and the field it labels; since we don't know which order the two will render, we can't tell if the
field's id is correct until after both have rendered.
The Heartbeat is injected into components via the
Environmental
annotation.-
Method Summary
-
Method Details
-
begin
void begin()Begins a new Heartbeat. Heartbeats nest. Every call to begin() should be matched by a call toend()
. -
end
void end()Executes all commands since the most recentbegin()
. -
defer
Adds a new command to the current Heartbeat. The command will be executed byend()
.- Parameters:
command
- command to be executed at the end of the heartbeat- See Also:
-