public class EmulatorClient extends java.lang.Object implements Client, ClientCtrl
ClientCtrl.DestroyListener
Constructor and Description |
---|
EmulatorClient(Emulator emulator) |
Modifier and Type | Method and Description |
---|---|
DesktopAgent |
connect(java.lang.String zulPath)
connect to a zul file, you have to provide the path that relative to the resource root folder
|
DesktopAgent |
connectAsIncluded(java.lang.String zulPath,
java.util.Map<java.lang.String,java.lang.Object> args)
connect to a zul file, you have to provide the path that relative to the resource root folder.
|
DesktopAgent |
connectWithContent(java.lang.String content,
java.lang.String ext,
ComponentAgent parent,
java.util.Map<java.lang.String,java.lang.Object> args)
Connect to a zul content or another language from a string.
|
void |
destroy()
destroy this client, it will also destory all un-destroyed desktops that is created by this client
|
void |
destroy(DesktopAgent desktopAgent) |
void |
flush(java.lang.String desktopId)
flush the queued AU update event including piggyback events.
|
java.net.HttpURLConnection |
getConnection(java.lang.String path,
java.lang.String method)
get a connection with current session and cookie.
|
java.lang.String |
getCookie(java.lang.String key)
get value of cookie with specify name.
|
java.util.Map<java.lang.String,java.lang.String> |
getCookies()
get all cookies in an unmodifiable map.
|
EchoEventMode |
getEchoEventMode()
get the current echo event handling mode.
|
java.io.InputStream |
openConnection(java.lang.String path)
open a connection with current session and cookie.
|
void |
postPiggyback(java.lang.String desktopId,
java.lang.String targetUUID,
java.lang.String command,
java.util.Map<java.lang.String,java.lang.Object> data,
boolean ignorable)
post a piggyback asynchronous update event.
|
void |
postUpdate(java.lang.String desktopId,
java.lang.String targetUUID,
java.lang.String command,
java.util.Map<java.lang.String,java.lang.Object> data,
boolean ignorable)
post an asynchronous update event.
|
void |
setCookie(java.lang.String key,
java.lang.String value)
set cookie for the client, the cookie will be sent at every HTTP request.
|
void |
setDestroyListener(ClientCtrl.DestroyListener l) |
void |
setEchoEventMode(EchoEventMode mode)
change the echo event handling mode.
|
public EmulatorClient(Emulator emulator)
public DesktopAgent connectAsIncluded(java.lang.String zulPath, java.util.Map<java.lang.String,java.lang.Object> args)
Client
connectAsIncluded
in interface Client
zulPath
- the path of zul file.args
- the arguments to pass.ZatsEnvironment.init(String)
public DesktopAgent connectWithContent(java.lang.String content, java.lang.String ext, ComponentAgent parent, java.util.Map<java.lang.String,java.lang.Object> args)
Client
connectWithContent
in interface Client
content
- the raw content of the page. It must be a XML and
compliant to the page format (such as ZUL).parent
- the parent component, or null if you want it to be
a root component. If parent is null, the page is assumed to be
the current page, which is determined by the execution context.
In other words, the new component will be the root component
of the current page if parent is null.Executions.createComponentsDirectly(String, String, org.zkoss.zk.ui.Component, Map)
public DesktopAgent connect(java.lang.String zulPath)
Client
connect
in interface Client
ZatsEnvironment.init(String)
public void destroy()
Client
public void destroy(DesktopAgent desktopAgent)
destroy
in interface ClientCtrl
public void postUpdate(java.lang.String desktopId, java.lang.String targetUUID, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> data, boolean ignorable)
ClientCtrl
postUpdate
in interface ClientCtrl
public void postPiggyback(java.lang.String desktopId, java.lang.String targetUUID, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> data, boolean ignorable)
ClientCtrl
postPiggyback
in interface ClientCtrl
public void flush(java.lang.String desktopId)
ClientCtrl
flush
in interface ClientCtrl
public java.net.HttpURLConnection getConnection(java.lang.String path, java.lang.String method)
ClientCtrl
getConnection
in interface ClientCtrl
path
- connect to this pathmethod
- HTTP methodpublic java.io.InputStream openConnection(java.lang.String path) throws java.io.IOException
ClientCtrl
openConnection
in interface ClientCtrl
path
- connect to this pathjava.io.IOException
public void setDestroyListener(ClientCtrl.DestroyListener l)
setDestroyListener
in interface ClientCtrl
public void setCookie(java.lang.String key, java.lang.String value)
Client
public java.lang.String getCookie(java.lang.String key)
Client
public java.util.Map<java.lang.String,java.lang.String> getCookies()
Client
getCookies
in interface Client
public void setEchoEventMode(EchoEventMode mode)
Client
setEchoEventMode
in interface Client
mode
- Control echo event handling mode. If null, do nothing.EchoEventMode
public EchoEventMode getEchoEventMode()
Client
getEchoEventMode
in interface Client
EchoEventMode
Copyright © 2019 Potix Corporation. All rights reserved.