use of com.netflix.exhibitor.core.state.ServerList in project exhibitor by soabase.
the class ClusterResource method getClusterStatus.
@Path("status")
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response getClusterStatus() throws Exception {
InstanceConfig config = context.getExhibitor().getConfigManager().getConfig();
ServerList serverList = new ServerList(config.getString(StringConfigs.SERVERS_SPEC));
ClusterStatusTask task = new ClusterStatusTask(context.getExhibitor(), serverList.getSpecs());
List<ServerStatus> statuses = context.getExhibitor().getForkJoinPool().invoke(task);
GenericEntity<List<ServerStatus>> entity = new GenericEntity<List<ServerStatus>>(statuses) {
};
return Response.ok(entity).build();
}
Aggregations