public static LGPayload deserialize(byte[] serialized) { return (LGPayload) SerializationUtils.deserialize(serialized); }
/** * @return Returns this class as byte[] */ public byte[] toByteArray() { return SerializationUtils.serialize(this); }
public static LGCommand deserialize(byte[] serialized) { return (LGCommand) SerializationUtils.deserialize(serialized); }
public byte[] toByteArray() { return SerializationUtils.serialize(this); }
@Override public void printBody(byte[] body) { try { HashMap<String, String> map; //Exception exception = (Exception) SerializationUtils.deserialize(body); map = (HashMap) SerializationUtils.deserialize(body); System.out.println(map.toString()); } catch (Exception e) { e.printStackTrace(); } }
public void publishException(String taskId, String requests, Exception e) { try { HashMap<String, String> map = new HashMap(); map.put("taskId", taskId); map.put("requests", requests); map.put("cause", e.toString()); map.put("detailmessage", e.getMessage()); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); map.put("stackTrace", sw.toString()); channel.basicPublish("Exceptions", "", null, SerializationUtils.serialize(map)); } catch (Exception e1) { e1.printStackTrace(); } }