Returns all the applications that want to receive messages for the given application ID. @param ID The application ID or null for all apps. @return A list of all applications that want to receive the message.
(String ID)
| 623 | * @return A list of all applications that want to receive the message. |
| 624 | */ |
| 625 | public Collection<Application> getApplications(String ID) { |
| 626 | LinkedList<Application> apps = new LinkedList<Application>(); |
| 627 | // Applications that match |
| 628 | Collection<Application> tmp = this.applications.get(ID); |
| 629 | if (tmp != null) { |
| 630 | apps.addAll(tmp); |
| 631 | } |
| 632 | // Applications that want to look at all messages |
| 633 | if (ID != null) { |
| 634 | tmp = this.applications.get(null); |
| 635 | if (tmp != null) { |
| 636 | apps.addAll(tmp); |
| 637 | } |
| 638 | } |
| 639 | return apps; |
| 640 | } |
| 641 | |
| 642 | /** |
| 643 | * Creates a replicate of this router. The replicate has the same |