- Timestamp:
- 07/16/13 23:31:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/remote/RemoteTree.java
r101 r102 56 56 } 57 57 58 public void setAddress(Address address) { 59 this.connection = Connection.to(new ClientSideManagedConnection(), address); 60 this.connection.setExceptionHandler(this); 61 this.connection.setNeedFileAcceptor(this); 62 } 63 58 64 @ParamAnnotation 59 65 public void setAddress(String address) { 60 this.connection = Connection.to(new ClientSideManagedConnection(), new Address(address)); 61 this.connection.setExceptionHandler(this); 62 this.connection.setNeedFileAcceptor(this); 66 setAddress(new Address(address)); 63 67 } 64 68 … … 72 76 } 73 77 78 74 79 @Override 75 80 public String toString() { 76 assert Dispatching.isThreadSafe(); 77 return "remote tree " + getName() + "(" + getAddress() + ")"; 81 return super.toString() + "[" + getAddress() + "]"; 78 82 } 79 83 … … 102 106 // assert param != null; 103 107 // // assert path.isResolved(); 104 // //TODO only do that if needed105 108 // connection.send(new GetRequest().field(param.getId()).path(path.getTextual()), this, new ClientSideResponseFuture(pathRemoveHandler(path, future)) { 106 109 // @Override … … 116 119 117 120 121 /** Fetch information. 122 * 123 * This method does not check whether the info is already in the cache, it will always issue a request or join 124 * with other already issued but returned info request. Too issue request only when needed, use TreeOperations.findInfo() 125 * 126 * */ 118 127 @Override 119 128 public void info(final Path path, final Future<FramsClass> future) { … … 153 162 }); 154 163 155 //TODO: if the info is in the cache, then don't communicate156 164 connection.send(new InfoRequest().path(path.getTextual()), AtOnceDispatcher.getInstance(), new ClientSideResponseFuture(compositeFuture) { 157 165 @Override … … 203 211 204 212 log.trace("storing value {} for {}", param, path); 205 //TODO break in passing exception handler is here 213 206 214 connection.send(new SetRequest().value(value.toString()).field(param.getId()).path(path.getTextual()), this, new ClientSideResponseFuture(future) { 207 215 @Override … … 224 232 @Override 225 233 protected void processOk(Response response) { 226 FramsClass framsClass = processFetchedInfo(RemoteTree.this, response.getFiles().get(0)); 234 assert bufferedDispatcher.getTargetDispatcher().isActive(); 235 FramsClass framsClass = Loaders.loadFramsClass(response.getFiles().get(0).getContent()); 236 putInfoIntoCache(framsClass); 237 227 238 assignRootParam(Param.build().name("Tree").id(RemoteTree.this.getName()).type("o " + framsClass.getId()).finish(CompositeParam.class)); 228 239 bufferedDispatcher.setBuffer(false);
Note: See TracChangeset
for help on using the changeset viewer.