Пример #1
0
  public void onMessage(
      String channel, String sender, String login, String hostname, String message) {

    JSFunction onMessage = (JSFunction) _things.get("onMessage");
    if (onMessage == null) return;

    JSObjectBase o = new JSObjectBase();
    o.set("channel", channel);
    o.set("sender", sender);
    o.set("login", login);
    o.set("hostname", hostname);
    o.set("message", message);

    onMessage.call(onMessage.getScope(), o);
  }
Пример #2
0
  protected void onDisconnect() {
    JSFunction onDisconnect = (JSFunction) _things.get("onDisconnect");
    if (onDisconnect == null) return;

    onDisconnect.call(onDisconnect.getScope());
  }