use of org.neo4j.kernel.api.procedure.FailedLoadFunction in project neo4j by neo4j.
the class ProcedureCompiler method compileFunction.
private CallableUserFunction compileFunction(Class<?> procDefinition, Method method, QualifiedName procName) throws ProcedureException {
restrictions.verify(procName);
List<FieldSignature> inputSignature = inputSignatureDeterminer.signatureFor(method);
Class<?> returnType = method.getReturnType();
TypeCheckers.TypeChecker typeChecker = typeCheckers.checkerFor(returnType);
String description = description(method);
UserFunction function = method.getAnnotation(UserFunction.class);
String deprecated = deprecated(method, function::deprecatedBy, "Use of @UserFunction(deprecatedBy) without @Deprecated in " + procName);
List<FieldSetter> setters = allFieldInjections.setters(procDefinition);
if (!config.fullAccessFor(procName.toString())) {
try {
setters = safeFieldInjections.setters(procDefinition);
} catch (ComponentInjectionException e) {
description = describeAndLogLoadFailure(procName);
UserFunctionSignature signature = new UserFunctionSignature(procName, inputSignature, typeChecker.type(), deprecated, config.rolesFor(procName.toString()), description, null, false);
return new FailedLoadFunction(signature);
}
}
UserFunctionSignature signature = new UserFunctionSignature(procName, inputSignature, typeChecker.type(), deprecated, config.rolesFor(procName.toString()), description, null, false);
return ProcedureCompilation.compileFunction(signature, setters, method);
}
Aggregations