use of com.emc.storageos.svcs.errorhandling.model.StatusCoded in project coprhd-controller by CoprHD.
the class Documenter method createEntries.
public static Collection<DocumenterEntry> createEntries() {
final List<Class<?>> list = getMessageBundleClasses();
_log.info("found these classes to document: {}", list);
final Collection<DocumenterEntry> entries = new ArrayList<DocumenterEntry>();
for (final Class<?> interfaze : list) {
final Object proxy = ExceptionMessagesProxy.create(interfaze);
final Method[] methods = interfaze.getDeclaredMethods();
for (final Method method : methods) {
StatusType status;
try {
final Object[] parameters = sampleParameters(method);
final ServiceCoded sce = (ServiceCoded) method.invoke(proxy, parameters);
if (sce instanceof StatusCoded) {
status = ((StatusCoded) sce).getStatus();
} else {
status = sce.isRetryable() ? Status.SERVICE_UNAVAILABLE : Status.INTERNAL_SERVER_ERROR;
}
entries.add(new DocumenterEntry(interfaze, method, status, sce, parameters));
} catch (final Exception e) {
_log.error(String.format("Fail to create document entry for method: %s", method), e);
}
}
}
return entries;
}
Aggregations