public int callMethod(int method, String resultVar, boolean ignoreSoapFault) {
   String user = DnUtil.getFirstDnPart(getOrganizationalUser());
   traceInfo("sending request: ", method);
   MethodCache caller = getBaseConnector().responseCache;
   Monitor mon1 = MonitorFactory.start("OutgoingCall:" + NomUtil.getUniversalName(method));
   Monitor mon2 = MonitorFactory.start("AllOutgoingCalls");
   Monitor monu1 =
       MonitorFactory.start(
           "OutgoingCallForUser:"******":" + NomUtil.getUniversalName(method));
   Monitor monu2 = MonitorFactory.start("AllOutgoingCallsForUser:"******"CALL", this, startTime, method, succes);
     mon1.stop();
     mon2.stop();
     monu1.stop();
     monu2.stop();
   }
 }
Example #2
0
  @Override
  public Object invoke(Object proxy, Method method, Object[] args) {
    Hook hook = new Hook();
    Method customMethod = null;
    Object[] customArgs = new Object[args.length + 1];

    // Get a string representation of this invokation.
    String key = MethodCache.getKey(this.original, method.getName(), args);

    // Look for a custom handler.
    if (this.mapping.containsKey(key)) {
      customArgs[0] = hook;
      System.arraycopy(args, 0, customArgs, 1, args.length);

      Method cached = MethodCache.getMethod(this.custom, this.mapping.get(key), customArgs);

      if (cached != null) customMethod = cached;
    }

    if (customMethod == null && !key.equals("ls.d(mw)") && !key.equals("ls.s()"))
      System.out.println(key + " => " + method);

    // Go ahead.
    Object toReturn = null;
    try {
      if (customMethod != null) toReturn = customMethod.invoke(this.custom, customArgs);
    } catch (IllegalAccessException | InvocationTargetException e) {
      e.printStackTrace();
    }

    try {
      if (!hook.isCancelled()) toReturn = method.invoke(this.original, args);
    } catch (IllegalAccessException | InvocationTargetException e) {
      e.printStackTrace();
    }

    return toReturn;
  }
  public Object invoke(Object target) throws Exception {
    Method method = MethodCache.get(_methodKey);

    return method.invoke(target, _arguments);
  }