public void init() {
connector.addStateChangeHandler(new StateChangeHandler() {
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
JavaScriptObject wrapper = getConnectorWrapper();
JavaScriptConnectorState state = getConnectorState();
for (String callback : state.getCallbackNames()) {
ensureCallback(JavaScriptConnectorHelper.this, wrapper,
callback);
}
for (Entry<String, Set<String>> entry : state
.getRpcInterfaces().entrySet()) {
String rpcName = entry.getKey();
String jsName = getJsInterfaceName(rpcName);
if (!rpcObjects.containsKey(jsName)) {
Set<String> methods = entry.getValue();