Skip to content

Commit

Permalink
Removed HelloWorldHealthCheckResource.java,
Browse files Browse the repository at this point in the history
added RotationManagementConfig and removed binding of RotationManagementResource
  • Loading branch information
ajay-jalgaonkar committed Mar 22, 2024
1 parent 282db60 commit c8ce346
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.flipkart.gjex.core.config;

import com.flipkart.gjex.core.web.RotationManagementResource;
import org.glassfish.jersey.server.ResourceConfig;

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;

/**
* RotationManagementConfig for registering RotationManagementResource.
* @author ajay.jalgaonkar
*
*/
@Singleton
@Named("RotationManagementConfig")
public class RotationManagementConfig extends ResourceConfig {
@Inject
public RotationManagementConfig (RotationManagementResource rotationManagementResource) {
register(rotationManagementResource);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import javax.servlet.ServletContext;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

Expand All @@ -17,10 +19,13 @@
*/

@Singleton
@Path("/rotation_status")
@Path("/rotation")
@Named
public class RotationManagementResource {

@Context
private ServletContext servletContext;

private RotationManagementBasedHealthCheck rotationManagementBasedHealthCheck;

@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ protected void configure() {
bind(Filter.class).annotatedWith(Names.named("LoggingFilter")).to(LoggingFilter.class);
bind(Filter.class).annotatedWith(Names.named("AuthFilter")).to(AuthFilter.class);
bind(TracingSampler.class).to(AllWhitelistTracingSampler.class);
bind(RotationManagementBasedHealthCheck.class).toInstance(new RotationManagementBasedHealthCheck());
bind(HealthCheck.class).to(RotationManagementBasedHealthCheck.class);
bind(ResourceConfig.class).annotatedWith(Names.named("HelloWorldResourceConfig")).to(HelloWorldResourceConfig.class);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ public class HelloWorldResourceConfig extends ResourceConfig {
@Inject
public HelloWorldResourceConfig (HelloWorldResource1 helloWorldresource1,
HelloWorldResource2 helloWorldresource2,
RotationManagementResource rotationManagementResource,
HelloWorldHealthCheckResource helloWorldHealthCheckResource) {
RotationManagementResource rotationManagementResource) {
register(helloWorldresource1);
register(helloWorldresource2);
register(rotationManagementResource);
register(helloWorldHealthCheckResource);
// register(rotationManagementResource);
}

}

0 comments on commit c8ce346

Please sign in to comment.