Exemplo n.º 1
0
 public void persistDispatchers() {
   JSONArray jsonDispatchers = new JSONArray();
   for (Dispatcher dispatcher : dispatchers) {
     jsonDispatchers.add(dispatcher.jsonify());
   }
   json.put("dispatchers", jsonDispatchers);
 }
Exemplo n.º 2
0
 public Dispatcher getDispatcher(int id) {
   for (Dispatcher dispatcher : dispatchers) {
     if (dispatcher.getId() == id) {
       return dispatcher;
     }
   }
   return null;
 }
Exemplo n.º 3
0
 private void restoreDispatchers() {
   JSONArray jsonDispatchers = (JSONArray) json.get("dispatchers");
   int size = jsonDispatchers.size();
   for (int i = 0; i < size; ++i) {
     JSONObject jsonDispatcher = (JSONObject) jsonDispatchers.get(i);
     Dispatcher dispatcher = Dispatcher.createFromJSON(jsonDispatcher);
     dispatchers.add(dispatcher);
   }
 }