@Test public void testMultiInterface() throws Exception { Sample instance = new Sample(); Object proxy = traceProxyFactory.createProxy(instance, Consumer.class, Callable.class); ((Consumer)proxy).accept("hello"); Span span = tracer.getCapturedSpan(); Assert.assertEquals("service", span.getService()); Assert.assertEquals(Consumer.class.getCanonicalName(), span.getResource()); Assert.assertEquals("accept", span.getOperation()); Assert.assertEquals("hello", ((Callable)proxy).call()); span = tracer.getCapturedSpan(); Assert.assertEquals("service", span.getService()); Assert.assertEquals(Callable.class.getCanonicalName(), span.getResource()); Assert.assertEquals("call", span.getOperation()); }
@SneakyThrows public <T> T createProxy(final T instance, Class<T> iface) { return (T)createProxy(instance, new Class[]{iface}); }
TraceProxyFactory { @SneakyThrows public <T> T createProxy(final T instance, Class<T> iface) { return (T)createProxy(instance, new Class[]{iface}); } }
TraceProxyFactory { @SneakyThrows public <T> T createProxy(final T instance, Class<T> iface) { return (T)createProxy(instance, new Class[]{iface}); }  }
TraceProxyFactory { @SneakyThrows public <T> T createProxy(final T instance, Class<T> iface) { return (T)createProxy(instance, new Class[]{iface}); }  @SneakyThrows T createProxy(final T instance, Class<T> iface); @SneakyThrows Object createProxy(final Object instance, Class<?>... ifaces); }
TraceProxyFactory { @SneakyThrows public <T> T createProxy(final T instance, Class<T> iface) { return (T)createProxy(instance, new Class[]{iface}); }  @SneakyThrows T createProxy(final T instance, Class<T> iface); @SneakyThrows Object createProxy(final Object instance, Class<?>... ifaces);  }