+/* -----------------------------------------------------------------------
+ * Copyright 2016 King County Library System
+ * Bill Erickson <berickxx@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * -----------------------------------------------------------------------
+ */
package org.evergreen_ils.hatch;
import java.util.logging.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.nio.ByteBuffer;
import java.io.IOException;
+import java.util.regex.Pattern;
import org.json.*;
/**
private LinkedBlockingQueue<JSONObject> inQueue;
private LinkedBlockingQueue<JSONObject> outQueue;
- static final Logger logger = Hatch.getLogger();
private MessageReader reader;
private MessageWriter writer;
+ static final Logger logger = Hatch.getLogger();
+
public MessageIO() {
inQueue = new LinkedBlockingQueue<JSONObject>();
outQueue = new LinkedBlockingQueue<JSONObject>();
String message = new String(msgBytes, "UTF-8");
- logger.info("MessageReader read: " + message);
+ logger.info("MessageReader read: " + message.length());
return message;
}
System.exit(1);
} catch (IOException ioe) {
+
logger.warning(ioe.toString());
+ continue;
} catch (JSONException je) {
logger.warning("Error parsing JSON message on STDIN " +
je.toString() + " : " + message);
-
continue;
}
+/* -----------------------------------------------------------------------
+ * Copyright 2016 King County Library System
+ * Bill Erickson <berickxx@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * -----------------------------------------------------------------------
+ */
package org.evergreen_ils.hatch;
import org.json.*;
+/* -----------------------------------------------------------------------
+ * Copyright 2016 King County Library System
+ * Bill Erickson <berickxx@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * -----------------------------------------------------------------------
+ */
package org.evergreen_ils.hatch;
import java.util.logging.Logger;