String key = null;
Key keyAnnot = method.getAnnotation(Key.class);
if (keyAnnot != null) {
key = keyAnnot.value();
} else {
Message msg = new KeyGenMessage(method);
key = keyGenerator.generateKey(msg);
if (key == null) {
throw new AnnotationsError("Could not compute key for "
+ method.getEnclosingType().getQualifiedSourceName() + "."
+ method.getName() + " using " + keyGenerator);