congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ApplicationHandlerDelegate
Code IndexAdd Tabnine to your IDE (free)

How to use
ApplicationHandlerDelegate
in
com.englishtown.vertx.jersey

Best Java code snippets using com.englishtown.vertx.jersey.ApplicationHandlerDelegate (Showing top 13 results out of 315)

origin: com.englishtown/vertx-mod-jersey

  @Override
  public void handle(Void aVoid) {
    // Resume the vert.x request if we haven't already read the body
    if (inputStream == null) {
      vertxRequest.resume();
    }
    applicationHandlerDelegate.handle(jerseyRequest);
  }
});
origin: ef-labs/vertx-jersey

/**
 * Get the Jersey server-side application handler associated with the container.
 *
 * @return Jersey server-side application handler associated with the container.
 */
@Override
public ApplicationHandler getApplicationHandler() {
  return getApplicationHandlerDelegate().getApplicationHandler();
}
origin: com.englishtown/vertx-mod-jersey

  /**
   * Releases resources
   */
  @Override
  public void close() {
    // Destroy the jersey service locator
    if (jerseyHandler != null && jerseyHandler.getDelegate() != null) {
      ServiceLocatorFactory.getInstance().destroy(jerseyHandler.getDelegate().getServiceLocator());
      jerseyHandler = null;
    }
    if (server != null) {
      server.close();
      server = null;
    }
  }
}
origin: ef-labs/vertx-jersey

@Before
public void setUp() {
  when(container.getOptions()).thenReturn(options);
  when(container.getVertx()).thenReturn(vertx);
  when(container.getApplicationHandlerDelegate()).thenReturn(applicationHandlerDelegate);
  when(applicationHandlerDelegate.getServiceLocator()).thenReturn(serviceLocator);
  when(options.getMaxBodySize()).thenReturn(1024);
  when(options.getBaseUri()).thenReturn(URI.create("/test"));
  when(request.absoluteURI()).thenReturn(URI.create("http://test.englishtown.com/test").toString());
  when(request.response()).thenReturn(response);
  when(request.headers()).thenReturn(headers);
  JsonArray resources = new JsonArray().add("com.englishtown.vertx.jersey.resources");
  config.put(DefaultJerseyOptions.CONFIG_RESOURCES, resources);
  ContainerResponseWriterProvider provider = mock(ContainerResponseWriterProvider.class);
  when(provider.get(any(HttpServerRequest.class), any(ContainerRequest.class))).thenReturn(mock(ContainerResponseWriter.class));
  when(serviceLocator.<Ref<Vertx>>getService((new TypeLiteral<Ref<Vertx>>() {
  }).getType())).thenReturn(vertxRef);
  when(serviceLocator.<Ref<Container>>getService((new TypeLiteral<Ref<Container>>() {
  }).getType())).thenReturn(containerRef);
  jerseyHandler = new DefaultJerseyHandler(() -> container, provider, requestProcessors);
}
origin: ef-labs/vertx-jersey

@Test
public void testHandle() throws Exception {
  when(request.method()).thenReturn(HttpMethod.GET);
  when(request.headers()).thenReturn(mock(MultiMap.class));
  jerseyHandler.handle(request);
  verify(applicationHandlerDelegate).handle(any(ContainerRequest.class));
}
origin: com.englishtown.vertx/vertx-jersey

  /**
   * Shutdown jersey server and release resources
   */
  @Override
  public void stop() {
    // Run jersey shutdown lifecycle
    if (container != null) {
      container.stop();
      container = null;
    }
    // Destroy the jersey service locator
    if (jerseyHandler != null && jerseyHandler.getDelegate() != null) {
      ServiceLocatorFactory.getInstance().destroy(jerseyHandler.getDelegate().getServiceLocator());
      jerseyHandler = null;
    }
    if (server != null) {
      server.close();
      server = null;
    }
  }
}
origin: com.englishtown.vertx/vertx-jersey

/**
 * Get the Jersey server-side application handler associated with the container.
 *
 * @return Jersey server-side application handler associated with the container.
 */
@Override
public ApplicationHandler getApplicationHandler() {
  return getApplicationHandlerDelegate().getApplicationHandler();
}
origin: ef-labs/vertx-jersey

@Test
public void testHandle_RequestProcessors() throws Exception {
  when(request.headers()).thenReturn(mock(MultiMap.class));
  when(request.method()).thenReturn(HttpMethod.GET);
  InputStream inputStream = null;
  VertxRequestProcessor rp1 = mock(VertxRequestProcessor.class);
  VertxRequestProcessor rp2 = mock(VertxRequestProcessor.class);
  requestProcessors.add(rp1);
  requestProcessors.add(rp2);
  jerseyHandler.handle(request, inputStream);
  verify(rp1).process(any(HttpServerRequest.class), any(ContainerRequest.class), endHandlerCaptor.capture());
  endHandlerCaptor.getValue().handle(null);
  verify(rp2).process(any(HttpServerRequest.class), any(ContainerRequest.class), endHandlerCaptor.capture());
  endHandlerCaptor.getValue().handle(null);
  verify(applicationHandlerDelegate).handle(any(ContainerRequest.class));
}
origin: ef-labs/vertx-jersey

  /**
   * Shutdown jersey server and release resources
   */
  @Override
  public void stop() {
    // Run jersey shutdown lifecycle
    if (container != null) {
      container.stop();
      container = null;
    }
    // Destroy the jersey service locator
    if (jerseyHandler != null && jerseyHandler.getDelegate() != null) {
      ServiceLocatorFactory.getInstance().destroy(jerseyHandler.getDelegate().getServiceLocator());
      jerseyHandler = null;
    }
    if (server != null) {
      server.close();
      server = null;
    }
  }
}
origin: ef-labs/vertx-jersey

@Test
public void testHandle_JSON_POST() throws Exception {
  DefaultHttpHeaders headers = new DefaultHttpHeaders();
  headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
  when(request.method()).thenReturn(HttpMethod.POST);
  when(request.headers()).thenReturn(new HeadersAdaptor(headers));
  jerseyHandler.handle(request);
  verify(request).handler(dataHandlerCaptor.capture());
  verify(request).endHandler(endHandlerCaptor.capture());
  Buffer data = Buffer.buffer("{}");
  dataHandlerCaptor.getValue().handle(data);
  endHandlerCaptor.getValue().handle(null);
  verify(applicationHandlerDelegate).handle(any(ContainerRequest.class));
}
origin: com.englishtown/vertx-mod-jersey

applicationHandlerDelegate.handle(jerseyRequest);
origin: ef-labs/vertx-jersey

      vertxRequest.resume();
    getDelegate().handle(jerseyRequest);
  });
} else {
  getDelegate().handle(jerseyRequest);
origin: com.englishtown.vertx/vertx-jersey

      vertxRequest.resume();
    getDelegate().handle(jerseyRequest);
  });
} else {
  getDelegate().handle(jerseyRequest);
com.englishtown.vertx.jerseyApplicationHandlerDelegate

Javadoc

Delegates handling a Jersey ContainerRequest to an underlying org.glassfish.jersey.server.ApplicationHandler

Most used methods

  • getServiceLocator
    Returns the application handler service locator
  • handle
    The main request/response processing entry point for Jersey container implementations.
  • getApplicationHandler
    Returns the underlying ApplicationHandler

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • setScale (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • Menu (java.awt)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now