Пример #1
0
  public ExtensionClassAndMethodMatcher getPointCut(String string) throws ParseException {
    ClassMethodSignature sig = parseClassMethodSignature(string);
    if (sig != null) {
      return new ExtensionClassAndMethodMatcher(
          extensionName,
          null,
          defaultMetricPrefix,
          new ExactClassMatcher(sig.getClassName()),
          createExactMethodMatcher(sig.getMethodName(), sig.getMethodDesc()),
          false,
          false,
          false,
          null);
    }

    throw new RuntimeException("Unable to parse point cut: " + string);
  }
Пример #2
0
 public Tracer doGetTracer(
     final Transaction transaction,
     final ClassMethodSignature sig,
     final Object call,
     final Object[] args) {
   try {
     final String endPoint =
         (String)
             call.getClass()
                 .getMethod("getTargetEndpointAddress", (Class<?>[]) new Class[0])
                 .invoke(call, new Object[0]);
     try {
       final URL url = new URL(endPoint);
       final String uri = InstrumentUtils.getURI(url);
       String methodName;
       if (sig == null) {
         methodName = "";
       } else {
         methodName = sig.getMethodName();
       }
       return new XmlRpcTracer(
           (PointCut) this,
           transaction,
           sig,
           call,
           url.getHost(),
           "XmlRpc",
           uri,
           new String[] {methodName});
     } catch (MalformedURLException e) {
       Agent.LOG.log(
           Level.FINE, "Unable to parse the target endpoint address for an XML RPC call", e);
     }
   } catch (Throwable e2) {
     Agent.LOG.log(
         Level.FINE, "Unable to get the target endpoint address for an XML RPC call", e2);
   }
   return null;
 }