The code example seems to be outdated.
should be :
final TimerExtension timerExtension = TimerExtension.create(extendedComponent);
timerExtension.setIntervalInMs(1000); // polling interval in milliseconds
timerExtension.addTimerListener(e -> { /* handle polling event */ });
layout.addComponent(extendedComponent);
// ...
timerExtension.start(); // start the polling explicitly, it is stopped when the extended component is detached from the UI