String text = jTextField1.getText();
this.setTitle(ME + " " + xmlBlaster.getSessionName().getNodeIdStr() + " " + text);
if (this.subscribeReturnQos != null) {
try {
UnSubscribeKey key = new UnSubscribeKey(xmlBlaster.getGlobal(), this.subscribeReturnQos.getSubscriptionId());
UnSubscribeQos qos = new UnSubscribeQos(xmlBlaster.getGlobal() );
xmlBlaster.unSubscribe(key.toXml(), qos.toXml());
System.out.println(ME + " unSubscribe from " + this.subscribeReturnQos.getSubscriptionId());
this.subscribeReturnQos = null;
}
catch( Throwable ex ) {
System.err.println("error-error-error-error >>>"+ex.toString());
System.out.println(ME + " " + ex.getMessage());
ex.printStackTrace();
}
}
try {
SubscribeKey key = new SubscribeKey(xmlBlaster.getGlobal(), text, "XPATH");
SubscribeQos qos = new SubscribeQos(xmlBlaster.getGlobal() );
this.subscribeReturnQos = xmlBlaster.subscribe(key.toXml(), qos.toXml());
System.out.println(ME + " subscribe on " + text + " -> " + this.subscribeReturnQos.getSubscriptionId());
}
catch( Exception ex ) {
System.err.println("error-error-error-error >>>"+ex.toString());
System.out.println(ME + " " + ex.getMessage());