Codota Logo
FutureCallbackProxy
Code IndexAdd Codota to your IDE (free)

How to use
FutureCallbackProxy
in
rocks.inspectit.agent.java.tracing.core.adapter.http.proxy

Best Java code snippets using rocks.inspectit.agent.java.tracing.core.adapter.http.proxy.FutureCallbackProxy (Showing top 12 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
public Object beforeBody(long methodId, Object object, Object[] parameters, SpecialSensorConfig ssc) {
  if ((null != parameters) && (parameters.length == 4)) {
    // the HTTP context
    Object httpContext = parameters[2];
    // the original callback given by the user
    Object originalCallback = parameters[3];
    SpanStoreAdapter spanStoreAdapter = new ApacheHttpContextSpanStoreAdapter(httpContext);
    FutureCallbackProxy proxy = new FutureCallbackProxy(originalCallback, spanStoreAdapter);
    Object newProxy = runtimeLinker.createProxy(FutureCallbackProxy.class, proxy, object.getClass().getClassLoader());
    parameters[3] = newProxy;
  }
  return null;
}
origin: inspectIT/inspectIT

  @Test
  public void returnsAnEmptyCollection() {
    Object[] args = proxy.getProxyConstructorArguments();
    assertThat("Number of args returned by the constructor must be zero.", args, is(new Object[] {}));
  }
}
origin: inspectIT/inspectIT

@Test
public void withoutSpanStore() throws Exception {
  proxy.cancelled();
  verify(spanStoreAdapter).getSpanStore();
  verify(originalCallback).cancelled();
  verifyNoMoreInteractions(spanStoreAdapter, originalCallback);
  verifyZeroInteractions(spanStore);
}
origin: inspectIT/inspectIT

  @Test
  public void withoutSpanStoreAndCallback() throws Exception {
    Exception exception = new Exception();
    removeOriginalCallback();
    proxy.failed(exception);
    verify(spanStoreAdapter).getSpanStore();
    verifyNoMoreInteractions(spanStoreAdapter);
    verifyZeroInteractions(spanStore, originalCallback);
  }
}
origin: inspectIT/inspectIT

  @Test
  public void withoutSpanStoreAndCallback() throws Exception {
    Object response = new Object();
    removeOriginalCallback();
    proxy.completed(response);
    verify(spanStoreAdapter).getSpanStore();
    verifyNoMoreInteractions(spanStoreAdapter);
    verifyZeroInteractions(spanStore, originalCallback);
  }
}
origin: inspectIT/inspectIT

  @Test
  public void withoutSpanStoreAndCallback() throws Exception {
    removeOriginalCallback();
    proxy.cancelled();
    verify(spanStoreAdapter).getSpanStore();
    verifyNoMoreInteractions(spanStoreAdapter);
    verifyZeroInteractions(spanStore, originalCallback);
  }
}
origin: inspectIT/inspectIT

@Test
public void withoutSpanStore() throws Exception {
  Exception exception = new Exception();
  proxy.failed(exception);
  verify(spanStoreAdapter).getSpanStore();
  verify(originalCallback).failed(exception);
  verifyNoMoreInteractions(spanStoreAdapter, originalCallback);
  verifyZeroInteractions(spanStore);
}
origin: inspectIT/inspectIT

@Test
public void withoutSpanStore() {
  Object response = new Object();
  proxy.completed(response);
  verify(spanStoreAdapter).getSpanStore();
  verify(originalCallback).completed(response);
  verifyNoMoreInteractions(spanStoreAdapter, originalCallback);
  verifyZeroInteractions(spanStore);
}
origin: inspectIT/inspectIT

@BeforeMethod
public void init() throws Exception {
  proxy = new FutureCallbackProxy(originalCallback, spanStoreAdapter);
  WFutureCallback.completed = new CachedMethod<Void>(FutureCallback.class.getName(), "completed", Object.class);
  WFutureCallback.failed = new CachedMethod<Void>(FutureCallback.class.getName(), "failed", Exception.class);
  WFutureCallback.cancelled = new CachedMethod<Void>(FutureCallback.class.getName(), "cancelled");
}
origin: inspectIT/inspectIT

@Test
public void successful() throws Exception {
  when(spanStoreAdapter.getSpanStore()).thenReturn(spanStore);
  proxy.cancelled();
  ArgumentCaptor<TagsProvidingAdapter> captor = ArgumentCaptor.forClass(TagsProvidingAdapter.class);
  verify(spanStoreAdapter).getSpanStore();
  verify(spanStore).finishSpan(captor.capture());
  verify(originalCallback).cancelled();
  verifyNoMoreInteractions(spanStore, spanStoreAdapter, originalCallback);
  assertThat(captor.getValue().getTags(), hasKey(SpanStoreAdapter.Constants.CANCEL));
}
origin: inspectIT/inspectIT

@Test
public void successful() throws Exception {
  Exception exception = new Exception();
  when(spanStoreAdapter.getSpanStore()).thenReturn(spanStore);
  proxy.failed(exception);
  verify(spanStoreAdapter).getSpanStore();
  verify(spanStore).finishSpan((TagsProvidingAdapter) any());
  verify(originalCallback).failed(exception);
  verifyNoMoreInteractions(spanStore, spanStoreAdapter, originalCallback);
}
origin: inspectIT/inspectIT

@Test
public void successful() {
  Object response = new Object();
  when(spanStoreAdapter.getSpanStore()).thenReturn(spanStore);
  proxy.completed(response);
  verify(spanStoreAdapter).getSpanStore();
  verify(spanStore).finishSpan((HttpResponseAdapter) any());
  verify(originalCallback).completed(response);
  verifyNoMoreInteractions(spanStore, spanStoreAdapter, originalCallback);
}
rocks.inspectit.agent.java.tracing.core.adapter.http.proxyFutureCallbackProxy

Javadoc

Proxy-class to wrap instances of the org.apache.http.concurrent.FutureCallback class.

Most used methods

  • <init>
    Constructor.
  • cancelled
    Cancelled method for FutureCallback.
  • completed
    Completed method for FutureCallback.
  • failed
    Failed method of FutureCallback.
  • getProxyConstructorArguments

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • getExternalFilesDir (Context)
  • getApplicationContext (Context)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • ImageIO (javax.imageio)
  • JFileChooser (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now