|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zkdemo.test.DumbFailoverManager
public class DumbFailoverManager
A dumb failover manager useless but to test the failover mechanism.
To test, call dropDesktop(boolean) first to remove a desktop.
And, then clicks or enters something on the client to see
whether it behaves as usual.
It is usually tested with test/failover.zul.
| Constructor Summary | |
|---|---|
DumbFailoverManager()
|
|
| Method Summary | |
|---|---|
void |
dropDesktop(boolean recoverable)
Drops the current desktop. |
boolean |
isRecoverable(Session sess,
java.lang.String desktopId)
Tests whether the specified desktop ID is recoverable. |
void |
recover(Session sess,
Execution exec,
Desktop desktop)
Recovers the specified desktop. |
void |
start(WebApp wapp)
Starts the failover manager. |
void |
stop(WebApp wapp)
Stops the failover manager. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DumbFailoverManager()
| Method Detail |
|---|
public void start(WebApp wapp)
FailoverManager
start in interface FailoverManagerpublic void stop(WebApp wapp)
FailoverManager
stop in interface FailoverManagerpublic void dropDesktop(boolean recoverable)
recoverable - whether the dropped desktop is recovable.
public boolean isRecoverable(Session sess,
java.lang.String desktopId)
FailoverManagerNote: when this method called, no execution
(Execution) is available.
The implementation shall only check whether it is possible to
recover the specified desktop ID.
Then, do the real recovery in FailoverManager.recover(org.zkoss.zk.ui.Session, org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Desktop).
isRecoverable in interface FailoverManagersess - the sessiondesktopId - the desktop ID to recover
public void recover(Session sess,
Execution exec,
Desktop desktop)
FailoverManagerFailoverManager.isRecoverable(org.zkoss.zk.ui.Session, java.lang.String) returns true.
Before calling this method, the desktop and execution
Execution) are all prepared.
Note: ZK assumes the failover manager can recover the desktop completely, so it won't update the browser whatever have been done in this method.
During the recovering process, you have to do the following:
Recover Desktop
DesktopCtrl.setId(java.lang.String) to correct the desktop ID.Desktop.setCurrentDirectory(java.lang.String) to
correct the current directory.
It is the directory of the path of the ZUML page.Desktop.setDeviceType(java.lang.String) to correct
the device type (default: html).DesktopCtrl.setResponseId(int).Recover Page
PageImpl.PageImpl(org.zkoss.zk.ui.metainfo.LanguageDefinition, org.zkoss.zk.ui.metainfo.ComponentDefinitionMap, String, String)
(or your own implementaton) to create an instance of Page.PageCtrl.init(org.zkoss.zk.ui.sys.PageConfig) to initialized the page.
recover in interface FailoverManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||