zeusScheduleField.setAccessible(true);
ZeusSchedule zeusSchedule=(ZeusSchedule) zeusScheduleField.get(locker);
if(zeusSchedule!=null){
Field masterContextField=zeusSchedule.getClass().getDeclaredField("context");
masterContextField.setAccessible(true);
MasterContext context=(MasterContext)masterContextField.get(zeusSchedule);
if(context!=null){
String op=req.getParameter("op");
if("workers".equals(op)){
Map<Channel, MasterWorkerHolder> workers=context.getWorkers();
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
for(Channel channel:workers.keySet()){
MasterWorkerHolder holder=workers.get(channel);
Set<String> runnings=holder.getRunnings().keySet();
Set<String> manualRunnings=holder.getManualRunnings().keySet();
Set<String> debugRunnings=holder.getDebugRunnings().keySet();
HeartBeatInfo heart=holder.getHeart();
resp.getWriter().println(channel.getRemoteAddress()+":");
resp.getWriter().println("\t runnings:"+runnings.toString());
resp.getWriter().println("\t manual runnings:"+manualRunnings.toString());
resp.getWriter().println("\t debug runnings:"+debugRunnings.toString());
resp.getWriter().println("\t heart beat: ");
resp.getWriter().println("\t\t last heartbeat:"+ format.format(heart.timestamp));
resp.getWriter().println("\t\t mem use rate:"+heart.memRate);
resp.getWriter().println("\t\t runnings:"+heart.runnings.toString());
resp.getWriter().println("\t\t manual runnings:"+heart.manualRunnings.toString());
resp.getWriter().println("\t\t debug runnings:"+heart.debugRunnings.toString());
}
}else if("queue".equals(op)){
Queue<String> queue=context.getQueue();
Queue<String> debugQueue=context.getDebugQueue();
Queue<String> manualQueue=context.getManualQueue();
resp.getWriter().println("schedule jobs in queue:");
for(String jobId:queue){
resp.getWriter().print(jobId+"\t");
}
resp.getWriter().println("manual jobs in queue:");
for(String jobId:manualQueue){
resp.getWriter().print(jobId+"\t");
}
resp.getWriter().println("debug jobs in queue");
for(String jobId:debugQueue){
resp.getWriter().print(jobId+"\t");
}
}else if("jobstatus".equals(op)){
Dispatcher dispatcher=context.getDispatcher();
if(dispatcher!=null){
for(Controller c:dispatcher.getControllers()){
resp.getWriter().println(c.toString());
}
}