- Timestamp:
- 07/04/13 20:29:50 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/remote/RecursiveFetcher.java
r90 r96 1 1 package com.framsticks.remote; 2 2 3 import static com.framsticks.core.InstanceUtils.*; 3 4 import com.framsticks.core.Node; 4 5 import com.framsticks.core.Path; … … 8 9 import com.framsticks.core.Instance; 9 10 import com.framsticks.util.dispatching.Future; 11 import com.framsticks.util.FramsticksException; 12 import com.framsticks.util.Logging; 10 13 import com.framsticks.util.StateFunctor; 11 14 import com.framsticks.util.Stopwatch; … … 36 39 assert instance.isActive(); 37 40 log.info("recursively fetched in " + stopwatch); 38 stateFunctor.call( null);41 stateFunctor.call(); 39 42 } 40 43 … … 44 47 log.warn("path " + path + " is not resolved - skipping"); 45 48 } else { 46 AccessInterface access = instance.bindAccess(path);49 AccessInterface access = bindAccess(path); 47 50 FramsClass framsClass = access.getFramsClass(); 48 51 assert framsClass != null; … … 50 53 Object child = access.get(p, Object.class); 51 54 final Path childPath = path.appendNode(new Node(p, child)); 52 if (childPath.isResolved() && instance.getInfoFromCache(childPath) != null) {55 if (childPath.isResolved() && getInfoFromCache(childPath) != null) { 53 56 ++dispatched; 54 57 instance.dispatch(new RunAt<Instance>() { … … 61 64 } 62 65 ++dispatched; 63 instance.resolve(childPath, new Future<Path>( ) {66 instance.resolve(childPath, new Future<Path>(Logging.logger(log, "resolve", RecursiveFetcher.this)) { 64 67 @Override 65 p ublic void result(Path result, Exception e) {68 protected void result(Path result) { 66 69 assert instance.isActive(); 67 if (e != null) {68 log.error(e);69 return;70 }71 70 fetch(result); 72 71 } … … 83 82 instance.fetchValues(path, new StateFunctor() { 84 83 @Override 85 public void call(Exception e) { 86 if (e != null) { 87 log.error("failed to fetch values for " + path + ": " + e); 88 process(null); 89 return; 90 } 84 public void handle(FramsticksException e) { 85 log.error("failed to fetch values for " + path + ": " + e); 86 process(null); 87 } 88 89 @Override 90 public void call() { 91 91 process(path); 92 92 }
Note: See TracChangeset
for help on using the changeset viewer.