public abstract class

XWalkExtension

extends XWalkExtensionInternal
java.lang.Object
   ↳ XWalkExtensionInternal
     ↳ org.xwalk.core.XWalkExtension

Class Overview

This class represents an extension and could be implemented by callers.

Summary

Public Constructors
XWalkExtension(String name, String jsApi)
Constructor with name and javascript API.
XWalkExtension(String name, String jsApi, String[] entryPoints)
Constructor with name, javascript API and entry points.
Public Methods
final void broadcastMessage(String message)
Broadcast message to all extension instances.
abstract void onMessage(int instanceID, String message)
Notify the extension that the async message is received.
abstract String onSyncMessage(int instanceID, String message)
Notify the extension that the sync message is received.
final void postMessage(int instanceID, String message)
Send message to an instance.
Protected Methods
void destroyExtension()
Destroy an extension.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public XWalkExtension (String name, String jsApi)

Constructor with name and javascript API.

Parameters
name the exposed namespace.
jsApi the string of javascript API.

public XWalkExtension (String name, String jsApi, String[] entryPoints)

Constructor with name, javascript API and entry points.

Parameters
name the exposed namespace.
jsApi the string of javascript API.
entryPoints Entry points are used when the extension needs to have objects outside the namespace that is implicitly created using its name.

Public Methods

public final void broadcastMessage (String message)

Broadcast message to all extension instances.

Parameters
message the message.

public abstract void onMessage (int instanceID, String message)

Notify the extension that the async message is received.

Parameters
instanceID the id of instance.
message the received message.

public abstract String onSyncMessage (int instanceID, String message)

Notify the extension that the sync message is received.

Parameters
instanceID the id of instance.
message the received message.

public final void postMessage (int instanceID, String message)

Send message to an instance.

Parameters
instanceID the id of instance.
message the message.

Protected Methods

protected void destroyExtension ()

Destroy an extension.