List of usage examples for java.io NotSerializableException initCause
public synchronized Throwable initCause(Throwable cause)
From source file:org.mule.keygenerator.MD5MuleEventKeyGenerator.java
public Serializable generateKey(MuleEvent event) throws NotSerializableException { try {//from w w w . ja v a 2 s.c o m byte[] bytesOfMessage = event.getMessageAsBytes(); MessageDigest md = MessageDigest.getInstance("MD5"); String key = new String(md.digest(bytesOfMessage)); if (logger.isDebugEnabled()) { logger.debug("Generated key for event: " + event + " key: " + key); } return key; } catch (Exception e) { NotSerializableException notSerializableException = new NotSerializableException(e.getMessage()); notSerializableException.initCause(e); throw notSerializableException; } }