Package org.idempiere.ui.zk.websocket
Class WebSocketServerPush
java.lang.Object
org.idempiere.ui.zk.websocket.WebSocketServerPush
- All Implemented Interfaces:
org.zkoss.zk.ui.sys.ServerPush
Server push implementation using web socket
- Author:
- hengsin
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
activate
(long timeout) boolean
deactivate
(boolean stop) static ServerPushEndPoint
getEndPoint
(String dtid) Get web socket end point for desktopboolean
isActive()
static boolean
isValidDesktopId
(String dtid) void
static void
registerEndPoint
(String dtid, ServerPushEndPoint endpoint) Register web socket end point for desktopvoid
resume()
<T extends org.zkoss.zk.ui.event.Event>
voidschedule
(org.zkoss.zk.ui.event.EventListener<T> task, T event, org.zkoss.zk.ui.sys.Scheduler<T> scheduler) void
start
(org.zkoss.zk.ui.Desktop desktop) void
stop()
static boolean
unregisterEndPoint
(String dtid) Remove web socket end point for desktop
-
Constructor Details
-
WebSocketServerPush
public WebSocketServerPush()
-
-
Method Details
-
activate
public boolean activate(long timeout) throws InterruptedException, org.zkoss.zk.ui.DesktopUnavailableException - Specified by:
activate
in interfaceorg.zkoss.zk.ui.sys.ServerPush
- Throws:
InterruptedException
org.zkoss.zk.ui.DesktopUnavailableException
-
deactivate
public boolean deactivate(boolean stop) - Specified by:
deactivate
in interfaceorg.zkoss.zk.ui.sys.ServerPush
-
isActive
public boolean isActive()- Specified by:
isActive
in interfaceorg.zkoss.zk.ui.sys.ServerPush
-
onPiggyback
public void onPiggyback()- Specified by:
onPiggyback
in interfaceorg.zkoss.zk.ui.sys.ServerPush
-
schedule
public <T extends org.zkoss.zk.ui.event.Event> void schedule(org.zkoss.zk.ui.event.EventListener<T> task, T event, org.zkoss.zk.ui.sys.Scheduler<T> scheduler) - Specified by:
schedule
in interfaceorg.zkoss.zk.ui.sys.ServerPush
-
start
public void start(org.zkoss.zk.ui.Desktop desktop) - Specified by:
start
in interfaceorg.zkoss.zk.ui.sys.ServerPush
-
stop
public void stop()- Specified by:
stop
in interfaceorg.zkoss.zk.ui.sys.ServerPush
-
resume
public void resume()- Specified by:
resume
in interfaceorg.zkoss.zk.ui.sys.ServerPush
-
registerEndPoint
Register web socket end point for desktop- Parameters:
dtid
- Desktop idendpoint
- Connected web socket end point
-
unregisterEndPoint
Remove web socket end point for desktop- Parameters:
dtid
- Desktop id- Returns:
- true if there's end point register previously for desktop, false otherwise
-
getEndPoint
Get web socket end point for desktop- Parameters:
dtid
- Desktop id- Returns:
- Web socket end point
-
isValidDesktopId
- Parameters:
dtid
- desktop id- Returns:
- true if serverpush started for dtid, false otherwise
-