try { methodDispatch = new MethodDispatch(context.getCache().getQueryService().getMethodInvocationAuthorizer(), resolutionType, this.methodName, argTypes); } catch (NameResolutionException nre) {
context.getCache().getQueryService().getMethodInvocationAuthorizer(), name) .validateReadType(clazz);
} else { member = new AttributeDescriptor(context.getCache().getPdxRegistry(), context.getCache().getQueryService().getMethodInvocationAuthorizer(), stepStr) .getReadMember(clazz);
/** * @param pathArray the path starting with an attribute on the initial type. * @return array of types starting with the initialType and ending with the type of the last * attribute in the path. * @throws NameNotFoundException if could not find an attribute along path * */ public static ObjectType[] calculateTypesAlongPath(ExecutionContext context, ObjectType initialType, String[] pathArray) throws NameNotFoundException { ObjectType[] types = new ObjectType[pathArray.length + 1]; // initialClass goes in front types[0] = initialType; for (int i = 1; i < types.length; i++) { ObjectType currentType = types[i - 1]; Member member = new AttributeDescriptor(context.getCache().getPdxRegistry(), context.getCache().getQueryService().getMethodInvocationAuthorizer(), pathArray[i - 1]) .getReadMember(currentType.resolveClass()); if (member instanceof Field) types[i] = TypeUtils.getObjectType(((Field) member).getType()); else if (member instanceof Method) types[i] = TypeUtils.getObjectType(((Method) member).getReturnType()); } return types; }
public static Object evaluateAttribute(ExecutionContext context, Object target, String attribute) throws NameNotFoundException, QueryInvocationTargetException { if (target instanceof Struct) { Struct struct = (Struct) target; try { return struct.get(attribute); } catch (Exception e) { throw new NameNotFoundException(attribute); } } try { return new AttributeDescriptor(context.getCache().getPdxRegistry(), context.getCache().getQueryService().getMethodInvocationAuthorizer(), attribute) .read(target); } catch (NameNotFoundException nfe) { if (DefaultQueryService.QUERY_HETEROGENEOUS_OBJECTS || DefaultQueryService.TEST_QUERY_HETEROGENEOUS_OBJECTS) { return QueryService.UNDEFINED; } else { throw nfe; } } }