this.glob = glob;
for(int i=0; i<conList.length; i++) {
ME = conList[i].helpText;
conList[i].con = conList[i].glob.getXmlBlasterAccess();
I_XmlBlasterAccess con = conList[i].con;
try {
// Check if other login name or password was given on command line:
// (This is redundant as it is done by ConnectQos already)
String name = con.getGlobal().getProperty().get("session.name", "AllProtocols");
String passwd = con.getGlobal().getProperty().get("passwd", "secret");
ConnectQos qos = new ConnectQos(con.getGlobal(), name, passwd);
con.connect(qos, this); // Login to xmlBlaster, register for updates
PublishKey pk = new PublishKey(con.getGlobal(), "AllProtocols", "text/xml", "1.0");
pk.setClientTags("<org.xmlBlaster><demo/></org.xmlBlaster>");
PublishQos pq = new PublishQos(con.getGlobal());
MsgUnit msgUnit = new MsgUnit(pk, "Hi", pq);
con.publish(msgUnit);
GetKey gk = new GetKey(con.getGlobal(), "AllProtocols");
GetQos gq = new GetQos(con.getGlobal());
MsgUnit[] msgs = con.get(gk.toXml(), gq.toXml());
GetReturnQos grq = new GetReturnQos(con.getGlobal(), msgs[0].getQos());
log.info("Accessed xmlBlaster message with content '" + new String(msgs[0].getContent()) +
"' and status=" + grq.getState());
SubscribeKey sk = new SubscribeKey(con.getGlobal(), "AllProtocols");
SubscribeQos sq = new SubscribeQos(con.getGlobal());
SubscribeReturnQos subRet = con.subscribe(sk.toXml(), sq.toXml());
msgUnit = new MsgUnit(pk, "Ho".getBytes(), pq);
PublishReturnQos prq = con.publish(msgUnit);
log.info("Got status='" + prq.getState() + "' for published message '" + prq.getKeyOid());
try { Thread.sleep(1000); }
catch( InterruptedException ie) {} // wait a second to receive update()
UnSubscribeKey uk = new UnSubscribeKey(con.getGlobal(), subRet.getSubscriptionId());
UnSubscribeQos uq = new UnSubscribeQos(con.getGlobal());
UnSubscribeReturnQos[] urq = con.unSubscribe(uk.toXml(), uq.toXml());
EraseKey ek = new EraseKey(con.getGlobal(), "AllProtocols");
EraseQos eq = new EraseQos(con.getGlobal());
EraseReturnQos[] eraseArr = con.erase(ek.toXml(), eq.toXml());
DisconnectQos dq = new DisconnectQos(con.getGlobal());
con.disconnect(dq);
}
catch (XmlBlasterException e) {
log.severe(e.getMessage());
}
catch (Throwable e) {