}
@Override
protected void safeProcess(String msg)
{
LogMessage logMessage = null;
//log.debug("data is:" + msg);
//System.out.println("data is:");
//System.out.println(msg);
JSONObject json = JSONObject.fromString(msg);
logMessage = new LogMessage();
logMessage.setLocation(json.optString("location"));
logMessage.setMessageBody(json.optString("messageBody"));
logMessage.setTimestamp(json.optString("timestamp"));
logMessage.setLogLevel(json.optInt("logLevel"));
Object object = json.opt("messageObject");
//System.out.println("message object type = " + json.opt("messageObject").getClass());
//System.out.println("message object = " + json.opt("messageObject"));
if (object instanceof JSONNull)
{
object = null;
}
else if (object instanceof JSONArray)
{
object = ((JSONArray) object);
}
logMessage.setMessageObject(object);
final MessageEvent event = new MessageEvent();
event.setMessage(logMessage);
Display.getDefault().asyncExec(new Runnable()
{