public abstract class JavaClient extends Object implements AutomationClient
When your implementation is designed for running in environment that supports
limited Java API like GWT or portable devices you may need to directly implement
the AutomationClient
interface.
Constructor and Description |
---|
JavaClient(String url,
ExecutorService executor) |
Modifier and Type | Method and Description |
---|---|
void |
asyncExec(Runnable runnable) |
<T> T |
getAdapter(Object objToAdapt,
Class<T> adapterType)
Adapts the given object to the given type.
|
AdapterManager |
getAdapterManager() |
String |
getBaseUrl()
Gets the automation service URL.
|
Session |
getSession()
Creates a new session.
|
void |
getSession(AsyncCallback<Session> cb)
Creates a new session.
|
Session |
getSession(LoginCallback cb)
Create a new session using the given login callback to gather login info.
|
void |
getSession(LoginCallback loginCb,
AsyncCallback<Session> cb)
Create asynchronously a new session using the given login callback to gather login info.
|
Session |
getSession(String username,
String password)
Creates a new session using the given login.
|
void |
getSession(String username,
String password,
AsyncCallback<Session> cb)
Creates asynchronously a new session using the given login.
|
void |
registerAdapter(AdapterFactory<?> factory)
Register an adapter for a given type.
|
void |
shutdown()
Cleanup any resources held by this client.
|
void |
shutdown(long timeout)
TODO Move this in interface?
|
public JavaClient(String url, ExecutorService executor)
public String getBaseUrl()
AutomationClient
getBaseUrl
in interface AutomationClient
public AdapterManager getAdapterManager()
public void asyncExec(Runnable runnable)
public <T> T getAdapter(Object objToAdapt, Class<T> adapterType)
AutomationClient
Optional operation. Framework that doesn't supports reflection like GWT
must throw UnsupportedOperationException
getAdapter
in interface AutomationClient
public void registerAdapter(AdapterFactory<?> factory)
AutomationClient
registerAdapter
in interface AutomationClient
public void getSession(LoginCallback loginCb, AsyncCallback<Session> cb)
AutomationClient
getSession
in interface AutomationClient
public void getSession(AsyncCallback<Session> cb)
AutomationClient
getSession
in interface AutomationClient
public void getSession(String username, String password, AsyncCallback<Session> cb)
AutomationClient
getSession
in interface AutomationClient
public Session getSession(LoginCallback cb)
AutomationClient
getSession
in interface AutomationClient
public Session getSession(String username, String password)
AutomationClient
getSession
in interface AutomationClient
public Session getSession()
AutomationClient
getSession
in interface AutomationClient
public void shutdown()
AutomationClient
shutdown
in interface AutomationClient
public void shutdown(long timeout)
timeout
- Copyright © 2011 Nuxeo SA. All Rights Reserved.