Changeset 9265
- Timestamp:
- 2005-03-03T16:23:19+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/ServiceRack.java
r8953 r9265 193 193 // other type of request, must be processed by the subclass - 194 194 // send to the service method 195 195 StringBuffer error_string = new StringBuffer(); 196 196 String to = GSPath.getFirstLink(request.getAttribute(GSXML.TO_ATT)); 197 197 Element response = null; … … 206 206 try { 207 207 m = c.getDeclaredMethod(method_name, params); 208 208 // if this has worked, break 209 209 break; 210 210 } catch (NoSuchMethodException e) { 211 211 c = c.getSuperclass(); 212 212 } catch (SecurityException e) { 213 System.err.println("ServiceRack.process: security exception for finding method "+method_name +", returning null");214 return null;213 System.err.println("ServiceRack.process: security exception for finding method "+method_name); 214 error_string.append("ServiceRack.process: security exception for finding method "+method_name); 215 215 } 216 216 } // while … … 222 222 } catch (Exception e) { 223 223 System.err.println("ServiceRack.process: Trying to call a processService type method (process"+to+") on a subclass("+this.getClass().getName()+"), but an exception happened:"+e.toString()); 224 return null;224 error_string.append("ServiceRack.process: Trying to call a processService type method (process"+to+") on a subclass("+this.getClass().getName()+"), but an exception happened:"+e.toString()); 225 225 } 226 226 } else { 227 227 System.err.println("ServiceRack.process: method "+method_name+" not found for class "+this.getClass().getName()); 228 } 229 if (response !=null) { 230 mainResult.appendChild(this.doc.importNode(response, true)); 228 error_string.append("ServiceRack.process: method "+method_name+" not found for class "+this.getClass().getName()); 231 229 } 232 230 233 231 } catch (ClassNotFoundException e) { 234 232 System.err.println("ServiceRack error: Element class not found"); 235 return null;233 error_string.append("ServiceRack error: Element class not found"); 236 234 } 237 } 235 if (response !=null) { 236 mainResult.appendChild(this.doc.importNode(response, true)); 237 } else { 238 // add in a dummy response 239 System.err.println("adding in an error element\n"); 240 response = this.doc.createElement(GSXML.RESPONSE_ELEM); 241 GSXML.addError(this.doc, response, error_string.toString()); 242 mainResult.appendChild(response); 243 244 } 245 246 } // else process request 238 247 } // for each request 239 248
Note:
See TracChangeset
for help on using the changeset viewer.