if (method.isAnnotationPresent(DeclarePrivate.class)) {
// Method may not be called by clients.
log.debug("Method {} is declared private.", method);
throw new NotAllowedException("Access denied, method is private");
}
final DeclareProtected annotation = method.getAnnotation(DeclareProtected.class);
if (annotation != null) {
if (!conn.getClient().hasPermission(conn, annotation.permission())) {
// client doesn't have required permission
log.debug("Client {} doesn't have required permission {} to call {}", new Object[] { conn.getClient(), annotation.permission(), method });
throw new NotAllowedException("Access denied, method is protected");
}
}
log.debug("Invoking method: {}", method.toString());
if (method.getReturnType().equals(Void.TYPE)) {