/** * Checks if the given address matches any external target. * * @param addr Address to check * @return True, if there is any external entity matching the target. */ private boolean matchesExternal(Address addr) { if (spyable) return true; Vector results = new Vector(); Enumeration e = external.elements(); while (e.hasMoreElements()) { Address k = (Address) e.nextElement(); if (k.matches(addr)) return true; } return false; }
/** * Find all internal/virtual entities that listen to a given address. * * @param addr Address to check * @return List of entities */ private VirtualMBusListener[] getMatchingTargets(Address addr) { Vector results = new Vector(); Enumeration e = virtual.keys(); while (e.hasMoreElements()) { Address k = (Address) e.nextElement(); if (k.matches(addr)) results.addElement(virtual.get(k)); } VirtualMBusListener[] ret = new VirtualMBusListener[results.size()]; for (int i = 0; i < results.size(); i++) ret[i] = (VirtualMBusListener) results.elementAt(i); return ret; }