protected synchronized void unsubscribe() throws UnableToDestroySubscriptionFault { try { unregister(); } catch (EndpointRegistrationException e) { UnableToDestroySubscriptionFaultType fault = new UnableToDestroySubscriptionFaultType(); throw new UnableToDestroySubscriptionFault("Error unregistering endpoint", fault, e); } if (subscriberAddress != null && WsnProcessImpl.localtable != null) { String topicName = convertTopic(topic); Iterator<ListItem> iter = WsnProcessImpl.localtable.iterator(); while (iter.hasNext()) { ListItem item = (ListItem) iter.next(); if (item.getTopicName().equals(topicName)) iter.remove(); } ListItem listCheck = null; for (ListItem listItem : WsnProcessImpl.localtable) if (listItem.getTopicName().equals(topicName)) listCheck = listItem; if (listCheck == null) { // NotifyObserver notify = new NotifyObserver(topicName,0); notifyObserver.setTopicName(topicName); notifyObserver.setKind(0); notifyObserver.addObserver(RtMgr.getInstance()); notifyObserver.notifyMessage(); } } }
private ArrayList<String> getForwardIp() { ArrayList<String> ret = org.apache.servicemix.wsn.router.mgr.RtMgr.calForwardGroups( this.topicName, this.originatorGroup); Iterator<String> it = ret.iterator(); ArrayList<String> forwardIP = new ArrayList<String>(); while (it.hasNext()) { String itNext = it.next(); // System.out.println("@@@@@@@@@@@@@@@@@@@@@:"+org.apache.servicemix.wsn.router.mgr.base.SysInfo.groupMap.get(itNext).addr); String addr = org.apache.servicemix.wsn.router.mgr.base.SysInfo.groupMap.get(itNext).addr; forwardIP.add(addr); } return forwardIP; // Start.forwardIP=searchRoute.calForwardIP("500:3:6:10:15:20:26", "m", // Start.testMap); }