- return reply;
- }
-
- //
- // INTERFACE ConnectorListener
- //
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void receivedReply(PluginConnector pluginConnector, SimpleFieldSet fields, Bucket data) {
- String messageName = fields.get("Message");
- logger.log(Level.FINEST, "Received Reply from Plugin: " + messageName);
- synchronized (reply) {
- reply.setFields(fields);
- reply.setData(data);
- reply.notify();
- }
- }
-
- /**
- * Container for the data of the reply from a plugin.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
- */
- private static class Reply {
-
- /** The fields of the reply. */
- private SimpleFieldSet fields;
-
- /** The payload of the reply. */
- private Bucket data;
-
- /** Empty constructor. */
- public Reply() {
- /* do nothing. */
- }
-
- /**
- * Returns the fields of the reply.
- *
- * @return The fields of the reply
- */
- public SimpleFieldSet getFields() {
- return fields;
- }
-
- /**
- * Sets the fields of the reply.
- *
- * @param fields
- * The fields of the reply
- */
- public void setFields(SimpleFieldSet fields) {
- this.fields = fields;
- }
-
- /**
- * Returns the payload of the reply.
- *
- * @return The payload of the reply (may be {@code null})
- */
- @SuppressWarnings("unused")
- public Bucket getData() {
- return data;
- }
-
- /**
- * Sets the payload of the reply.
- *
- * @param data
- * The payload of the reply (may be {@code null})
- */
- public void setData(Bucket data) {
- this.data = data;
- }
-