- private Reply performRequest(SimpleFieldSet fields, Bucket data, String... targetMessages) throws PluginException {
- @SuppressWarnings("synthetic-access")
- Reply reply = new Reply();
- for (String targetMessage : targetMessages) {
- replies.put(targetMessage, reply);
- }
- replies.put("Error", reply);
+ private Reply performRequest(SimpleFieldSet fields, Bucket data) throws PluginException {
+ final String identifier = "FCP-Command-" + System.currentTimeMillis() + "-" + counter.getAndIncrement();
+ final Reply reply = new Reply();
+ logger.log(Level.FINE, String.format("Sending FCP Request: %s", fields.get("Message")));
+ ConnectorListener connectorListener = new ConnectorListener() {
+
+ @Override
+ @SuppressWarnings("synthetic-access")
+ public void receivedReply(PluginConnector pluginConnector, SimpleFieldSet fields, Bucket data) {
+ String messageName = fields.get("Message");
+ logger.log(Level.FINEST, String.format("Received Reply from Plugin: %s", messageName));
+ synchronized (reply) {
+ reply.setFields(fields);
+ reply.setData(data);
+ reply.notify();
+ }
+ }
+ };
+ pluginConnector.addConnectorListener(WOT_PLUGIN_NAME, identifier, connectorListener);