@Override
 public XmppTransport build() {
   if (singleton == null) {
     singleton = new XmppService();
     singleton.doesShortcut = XmppTransportConfig.decorate(getParams()).getDoShortcut();
   }
   return singleton.get(getParams(), getHandle());
 }
示例#2
0
 public void xmppDisconnect() throws Exception {
   AgentHost host = getAgentHost();
   XmppService service = (XmppService) host.getTransportService("xmpp");
   if (service != null) {
     service.disconnect(getId());
   } else {
     throw new Exception("No XMPP service registered");
   }
 }
示例#3
0
  public void xmppConnect(@Name("username") String username, @Name("password") String password)
      throws Exception {
    AgentHost host = getAgentHost();

    XmppService service = (XmppService) host.getTransportService("xmpp");
    if (service != null) {
      service.connect(getId(), username, password);
    } else {
      throw new Exception("No XMPP service registered");
    }
  }