sruehl commented on a change in pull request #40: Alias registry for opm
URL: https://github.com/apache/incubator-plc4x/pull/40#discussion_r235886620
##########
File path:
plc4j/utils/opm/src/main/java/org/apache/plc4x/java/opm/PlcEntityInterceptor.java
##########
@@ -182,15 +197,33 @@ static void refetchAllFields(Object proxy,
PlcDriverManager driverManager, Strin
}
}
- private static Object fetchValueForIsGetter(Method m, PlcDriverManager
driverManager, String address) throws OPMException {
- return fetchValueForGetter(m, 2, driverManager, address);
+ private static String getFqn(Field field) {
+ return field.getDeclaringClass().getName() + "." + field.getName();
}
- private static Object fetchValueForGetter(Method m, PlcDriverManager
driverManager, String address) throws OPMException {
- return fetchValueForGetter(m, 3, driverManager, address);
+ /**
+ * Checks if a field needs to be refetched, i.e., the cached values are
too old.
+ */
+ private static boolean needsToBeFetched(Map<String, Instant> lastFetched,
Field field) {
+ long cacheDurationMillis =
field.getAnnotation(PlcField.class).cacheDurationMillis();
Review comment:
cacheDurationMillis() might produce a NPE here. Not sure if we asserted
before.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services