// Copyright 2008 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.gerrit.server;

import com.google.gerrit.client.data.ChangeHeader;
import com.google.gerrit.client.data.ChangeListService;
import com.google.gerrit.client.data.MineResult;
import com.google.gerrit.client.data.ProjectIdentity;
import com.google.gerrit.client.data.UserIdentity;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwtjsonrpc.server.JsonServlet;

import java.util.ArrayList;
import java.util.Date;

public class ChangeListServiceImpl extends JsonServlet implements ChangeListService {
  public void mine(final AsyncCallback<MineResult> callback) {
    final MineResult r = new MineResult();
    r.byMe = new ArrayList<ChangeHeader>();
    for (int i = 10; i < 10 + 2; i++) {
      final ChangeHeader c = new ChangeHeader();
      c.id = i;
      c.subject = "Change " + i;

      c.owner = new UserIdentity();
      c.owner.fullName = "User " + i;

      c.project = new ProjectIdentity();
      c.project.name = "platform/test";
      c.lastUpdate = new Date();
      r.byMe.add(c);
    }
    callback.onSuccess(r);
  }
}

@@ -930,57 +930,8 @@
 ack;
-%0Aimport com.google.gwtjsonrpc.server.JsonServlet;
 %0A%0Aim
@@ -1023,16 +1023,22 @@
 extends 
+Gerrit
 JsonServ
@@ -1072,16 +1072,110 @@
 rvice %7B%0A
+  @Override%0A  protected Object createServiceHandle() throws Exception %7B%0A    return this;%0A  %7D%0A%0A
   public

Switch our demo ChangeListServiceImpl to use GerritJsonServlet