public void methodCallFinished(Object proxy, Method method, Object[] args, Object callid, ServiceInvocationContext context) { Long start = times.remove(callid); // May happen that property is added during ongoing call if(start!=null) { if(context!=null) { ServiceInvocationContext sic = (ServiceInvocationContext)context; if(sic.getServiceCall()!=null) { Long exe = (Long)sic.getServiceCall().getProperty("__duration"); if(exe!=null) { long dur = System.currentTimeMillis() - start.longValue() - exe.longValue(); // System.out.println("latency is: "+dur); setValue(dur); } } } else { System.out.println("no context"); } } } });
public void methodCallFinished(Object proxy, Method method, Object[] args, Object callid, ServiceInvocationContext context) { Long start = times.remove(callid); // May happen that property is added during ongoing call if(start!=null) { if(context!=null) { ServiceInvocationContext sic = (ServiceInvocationContext)context; if(sic.getNextServiceCall()!=null) { Long exe = (Long)sic.getNextServiceCall().getProperty("__duration"); if(exe!=null) { long dur = System.currentTimeMillis() - start.longValue() - exe.longValue(); // System.out.println("latency is: "+dur); setValue(dur); } } } else { System.out.println("no context"); } } } });
public void resultAvailable(Void result) { ServiceCall sc = ServiceCall.getLastInvocation(); // System.out.println("last invoc: "+sc); if("new".equals(sc.getProperty("new"))) { tr.setSucceeded(true); } else { tr.setFailed("Wrong service call properties: "+sc); } ret.setResult(tr); }
Boolean mon = (Boolean)context.getServiceCall().getProperty(ServiceCall.MONITORING);
Boolean mon = (Boolean)context.getNextServiceCall().getProperty(ServiceCall.MONITORING);
Boolean inh = lastcall!=null? (Boolean)lastcall.getProperty(ServiceCall.INHERIT): null; if(inh!=null && inh.booleanValue())
final IComponentIdentifier caller = call.getCaller(); final String callername = caller.getPlatformPrefix(); final byte[] signed = (byte[])call.getProperty(Authenticated.AUTHENTICATED);
final IComponentIdentifier caller = call.getCaller(); final String callername = caller.getPlatformPrefix(); final byte[] signed = (byte[])call.getProperty(Authenticated.AUTHENTICATED);
Boolean inh = currentcall!=null? (Boolean)currentcall.getProperty(ServiceCall.INHERIT): null; if(inh!=null && inh.booleanValue())