use of com.sun.jersey.api.json.JSONMarshaller in project hadoop by apache.
the class TestRMWebServicesAppsModification method appTimeoutToJSON.
protected static String appTimeoutToJSON(AppTimeoutInfo timeout) throws Exception {
StringWriter sw = new StringWriter();
JSONJAXBContext ctx = new JSONJAXBContext(JSONConfiguration.natural().rootUnwrapping(false).build(), AppTimeoutInfo.class);
JSONMarshaller jm = ctx.createJSONMarshaller();
jm.marshallToJSON(timeout, sw);
jm.marshallToJSON(timeout, System.out);
return sw.toString();
}
use of com.sun.jersey.api.json.JSONMarshaller in project hadoop by apache.
the class TestRMWebServicesNodeLabels method toJson.
@SuppressWarnings("rawtypes")
private String toJson(Object nsli, Class klass) throws Exception {
StringWriter sw = new StringWriter();
JSONJAXBContext ctx = new JSONJAXBContext(klass);
JSONMarshaller jm = ctx.createJSONMarshaller();
jm.marshallToJSON(nsli, sw);
return sw.toString();
}
use of com.sun.jersey.api.json.JSONMarshaller in project hadoop by apache.
the class TestRMWebServicesAppsModification method appPriorityToJSON.
protected static String appPriorityToJSON(AppPriority targetPriority) throws Exception {
StringWriter sw = new StringWriter();
JSONJAXBContext ctx = new JSONJAXBContext(AppPriority.class);
JSONMarshaller jm = ctx.createJSONMarshaller();
jm.marshallToJSON(targetPriority, sw);
return sw.toString();
}
use of com.sun.jersey.api.json.JSONMarshaller in project hadoop by apache.
the class TestRMWebServicesAppsModification method appQueueToJSON.
protected static String appQueueToJSON(AppQueue targetQueue) throws Exception {
StringWriter sw = new StringWriter();
JSONJAXBContext ctx = new JSONJAXBContext(AppQueue.class);
JSONMarshaller jm = ctx.createJSONMarshaller();
jm.marshallToJSON(targetQueue, sw);
return sw.toString();
}
use of com.sun.jersey.api.json.JSONMarshaller in project hadoop by apache.
the class TestRMWebServicesAppsModification method appStateToJSON.
private static String appStateToJSON(AppState state) throws Exception {
StringWriter sw = new StringWriter();
JSONJAXBContext ctx = new JSONJAXBContext(AppState.class);
JSONMarshaller jm = ctx.createJSONMarshaller();
jm.marshallToJSON(state, sw);
return sw.toString();
}
Aggregations