// Path: controller-core/src/main/java/com/palominolabs/benchpress/controller/http/ControllerJobResource.java
// @Path("controller/job")
// @Singleton
// @Produces(MediaType.APPLICATION_JSON)
// public final class ControllerJobResource {
//     private JobFarmer jobFarmer;
// 
//     @Inject
//     ControllerJobResource(JobFarmer jobFarmer) {
//         this.jobFarmer = jobFarmer;
//     }
// 
//     /**
//      * @param task The workload to start
//      * @return 202 and the Job object as JSON, 412 on failure
//      */
//     @POST
//     @Consumes(MediaType.APPLICATION_JSON)
//     public Response submit(Task task) {
//         UUID jobId = UUID.randomUUID();
//         MDC.put(MdcKeys.JOB_ID, jobId.toString());
// 
//         try {
//             return jobFarmer.submitJob(new Job(task, jobId));
//         } finally {
//             MDC.remove(MdcKeys.JOB_ID);
//         }
//     }
// 
//     @GET
//     @Produces(MediaType.TEXT_HTML)
//     public Response list() {
//         StringBuilder stringBuilder = new StringBuilder();
//         stringBuilder.append("<html>\n<body>\n");
// 
//         stringBuilder.append("<ul>\n");
//         Set<UUID> jobIds = jobFarmer.getJobIds();
//         for (UUID jobId : jobIds) {
//             stringBuilder.append("<li><a href='/job/").append(jobId).append("'>").append(jobId).append("</a></li>\n");
//         }
//         stringBuilder.append("</ul>\n");
// 
//         stringBuilder.append("</html>");
//         return Response.status(Response.Status.OK).entity(stringBuilder.toString()).build();
//     }
// 
//     @POST
//     @Path("{jobId}/report/finished")
//     @Consumes(MediaType.APPLICATION_JSON)
//     public Response reportFinished(@PathParam("jobId") UUID jobId, SliceFinishedReport sliceFinishedReport) {
//         MDC.put(MdcKeys.JOB_ID, jobId.toString());
// 
//         try {
//             return jobFarmer.handleSliceFinishedReport(jobId, sliceFinishedReport);
//         } finally {
//             MDC.remove(MdcKeys.JOB_ID);
//         }
//     }
// 
//     @POST
//     @Path("{jobId}/report/progress")
//     @Consumes(MediaType.APPLICATION_JSON)
//     public Response reportProgress(@PathParam("jobId") UUID jobId, SliceProgressReport sliceProgressReport) {
//         MDC.put(MdcKeys.JOB_ID, jobId.toString());
// 
//         try {
//             return jobFarmer.handleSliceProgressReport(jobId, sliceProgressReport);
//         } finally {
//             MDC.remove(MdcKeys.JOB_ID);
//         }
//     }
// 
//     /**
//      * Get status of a job
//      *
//      * @param jobId The job to get status of
//      * @return 200 and a Job object
//      */
//     @GET
//     @Path("{jobId}")
//     public JobStatusResponse get(@PathParam("jobId") UUID jobId) {
//         MDC.put(MdcKeys.JOB_ID, jobId.toString());
// 
//         try {
//             return jobFarmer.getJobStatus(jobId);
//         } finally {
//             MDC.remove(MdcKeys.JOB_ID);
//         }
//     }
// }
// 
// Path: jersey-support/src/main/java/com/palominolabs/benchpress/jersey/JerseyResourceConfigBase.java
// public class JerseyResourceConfigBase extends ResourceConfig {
// 
//     /**
//      * @param objectMapperContextResolver The {@link ObjectMapperContextResolver} to use for Jackson/Jersey integration,
//      *                                    typically available with an {@link com.palominolabs.benchpress.ipc.Ipc}
//      *                                    binding annotation.
//      */
//     public JerseyResourceConfigBase(ObjectMapperContextResolver objectMapperContextResolver) {
//         register(JacksonFeature.class);
//         register(objectMapperContextResolver);
// 
//         property(CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, true);
//         property(CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE, true);
//         property(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, true);
//         property(CommonProperties.MOXY_JSON_FEATURE_DISABLE, true);
//     }
// }
// 
// Path: jersey-support/src/main/java/com/palominolabs/benchpress/jersey/ObjectMapperContextResolver.java
// public final class ObjectMapperContextResolver implements ContextResolver<ObjectMapper> {
//     private final ObjectMapper objectMapper;
// 
//     ObjectMapperContextResolver(ObjectMapper objectMapper) {
//         this.objectMapper = objectMapper;
//     }
// 
//     @Override
//     public ObjectMapper getContext(Class<?> type) {
//         return objectMapper;
//     }
// }


import com.google.inject.Inject;
import com.palominolabs.benchpress.controller.http.ControllerJobResource;
import com.palominolabs.benchpress.ipc.Ipc;
import com.palominolabs.benchpress.jersey.JerseyResourceConfigBase;
import com.palominolabs.benchpress.jersey.ObjectMapperContextResolver;
package com.palominolabs.benchpress.controller;


public class ControllerJerseyApp extends JerseyResourceConfigBase {

    @Inject
    ControllerJerseyApp(@Ipc ObjectMapperContextResolver objectMapperContextResolver) {
// Path: controller-core/src/main/java/com/palominolabs/benchpress/controller/http/ControllerJobResource.java
// @Path("controller/job")
// @Singleton
// @Produces(MediaType.APPLICATION_JSON)
// public final class ControllerJobResource {
//     private JobFarmer jobFarmer;
// 
//     @Inject
//     ControllerJobResource(JobFarmer jobFarmer) {
//         this.jobFarmer = jobFarmer;
//     }
// 
//     /**
//      * @param task The workload to start
//      * @return 202 and the Job object as JSON, 412 on failure
//      */
//     @POST
//     @Consumes(MediaType.APPLICATION_JSON)
//     public Response submit(Task task) {
//         UUID jobId = UUID.randomUUID();
//         MDC.put(MdcKeys.JOB_ID, jobId.toString());
// 
//         try {
//             return jobFarmer.submitJob(new Job(task, jobId));
//         } finally {
//             MDC.remove(MdcKeys.JOB_ID);
//         }
//     }
// 
//     @GET
//     @Produces(MediaType.TEXT_HTML)
//     public Response list() {
//         StringBuilder stringBuilder = new StringBuilder();
//         stringBuilder.append("<html>\n<body>\n");
// 
//         stringBuilder.append("<ul>\n");
//         Set<UUID> jobIds = jobFarmer.getJobIds();
//         for (UUID jobId : jobIds) {
//             stringBuilder.append("<li><a href='/job/").append(jobId).append("'>").append(jobId).append("</a></li>\n");
//         }
//         stringBuilder.append("</ul>\n");
// 
//         stringBuilder.append("</html>");
//         return Response.status(Response.Status.OK).entity(stringBuilder.toString()).build();
//     }
// 
//     @POST
//     @Path("{jobId}/report/finished")
//     @Consumes(MediaType.APPLICATION_JSON)
//     public Response reportFinished(@PathParam("jobId") UUID jobId, SliceFinishedReport sliceFinishedReport) {
//         MDC.put(MdcKeys.JOB_ID, jobId.toString());
// 
//         try {
//             return jobFarmer.handleSliceFinishedReport(jobId, sliceFinishedReport);
//         } finally {
//             MDC.remove(MdcKeys.JOB_ID);
//         }
//     }
// 
//     @POST
//     @Path("{jobId}/report/progress")
//     @Consumes(MediaType.APPLICATION_JSON)
//     public Response reportProgress(@PathParam("jobId") UUID jobId, SliceProgressReport sliceProgressReport) {
//         MDC.put(MdcKeys.JOB_ID, jobId.toString());
// 
//         try {
//             return jobFarmer.handleSliceProgressReport(jobId, sliceProgressReport);
//         } finally {
//             MDC.remove(MdcKeys.JOB_ID);
//         }
//     }
// 
//     /**
//      * Get status of a job
//      *
//      * @param jobId The job to get status of
//      * @return 200 and a Job object
//      */
//     @GET
//     @Path("{jobId}")
//     public JobStatusResponse get(@PathParam("jobId") UUID jobId) {
//         MDC.put(MdcKeys.JOB_ID, jobId.toString());
// 
//         try {
//             return jobFarmer.getJobStatus(jobId);
//         } finally {
//             MDC.remove(MdcKeys.JOB_ID);
//         }
//     }
// }
// 
// Path: jersey-support/src/main/java/com/palominolabs/benchpress/jersey/JerseyResourceConfigBase.java
// public class JerseyResourceConfigBase extends ResourceConfig {
// 
//     /**
//      * @param objectMapperContextResolver The {@link ObjectMapperContextResolver} to use for Jackson/Jersey integration,
//      *                                    typically available with an {@link com.palominolabs.benchpress.ipc.Ipc}
//      *                                    binding annotation.
//      */
//     public JerseyResourceConfigBase(ObjectMapperContextResolver objectMapperContextResolver) {
//         register(JacksonFeature.class);
//         register(objectMapperContextResolver);
// 
//         property(CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, true);
//         property(CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE, true);
//         property(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, true);
//         property(CommonProperties.MOXY_JSON_FEATURE_DISABLE, true);
//     }
// }
// 
// Path: jersey-support/src/main/java/com/palominolabs/benchpress/jersey/ObjectMapperContextResolver.java
// public final class ObjectMapperContextResolver implements ContextResolver<ObjectMapper> {
//     private final ObjectMapper objectMapper;
// 
//     ObjectMapperContextResolver(ObjectMapper objectMapper) {
//         this.objectMapper = objectMapper;
//     }
// 
//     @Override
//     public ObjectMapper getContext(Class<?> type) {
//         return objectMapper;
//     }
// }


// Path: controller-core/src/main/java/com/palominolabs/benchpress/controller/ControllerJerseyApp.java
import com.google.inject.Inject;
import com.palominolabs.benchpress.controller.http.ControllerJobResource;
import com.palominolabs.benchpress.ipc.Ipc;
import com.palominolabs.benchpress.jersey.JerseyResourceConfigBase;
import com.palominolabs.benchpress.jersey.ObjectMapperContextResolver;

package com.palominolabs.benchpress.controller;


public class ControllerJerseyApp extends JerseyResourceConfigBase {

    @Inject
    ControllerJerseyApp(@Ipc ObjectMapperContextResolver objectMapperContextResolver) {
        super(objectMapperContextResolver);