}
protected String calculatePassivationId()
{
try {
Sha256OutputStream os = new Sha256OutputStream(new NullOutputStream());
WriteStream out = Vfs.openWrite(os);
out.print(getJavaClass());
ArrayList<String> typeList = new ArrayList<String>();
for (Type type : getTypes()) {
typeList.add(type.toString());
}
Collections.sort(typeList);
for (String typeString : typeList) {
out.print(";");
out.print(typeString);
}
if (getName() != null) {
out.print(";name=");
out.print(getName());
}
ArrayList<String> annList = new ArrayList<String>();
for (Annotation ann : getQualifiers()) {
annList.add(bindingToString(ann));
}
Collections.sort(annList);
for (String annString : annList) {
out.print(";");
out.print(annString);
}
// ioc/0l34
if (getAnnotatedType() != null) {
XmlCookie xmlCookie = getAnnotatedType().getAnnotation(XmlCookie.class);
if (xmlCookie != null) {
out.print(";xmlcookie=" + xmlCookie.value());
}
}
out.close();
return Base64.encodeFromByteArray(os.getDigest());
} catch (IOException e) {
throw new IllegalStateException(e);
}
}