- long now = System.currentTimeMillis();
- while ((reply.getFields() == null) && ((System.currentTimeMillis() - now) < 60000)) {
- reply.wait(60000 - (System.currentTimeMillis() - now));
- }
- if (reply.getFields() == null) {
- for (String targetMessage : targetMessages) {
- replies.remove(targetMessage);
- }
- replies.remove("Error");
- throw new PluginException("Timeout waiting for " + targetMessages[0] + "!");
- }