@@ -0,0 +1,2192 @@
+/**%0A * Copyright 2012 Kjetil %C3%98rbekk %3Ckjetil.orbekk@gmail.com%3E%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.orbekk.same.apps;%0A%0Aimport com.google.protobuf.RpcCallback;%0Aimport com.orbekk.protobuf.Rpc;%0Aimport com.orbekk.protobuf.RpcChannel;%0Aimport com.orbekk.same.Services;%0Aimport com.orbekk.same.Services.Empty;%0A%0Apublic class KillMaster %7B%0A    final String location;%0A    %0A    public KillMaster(String location) %7B%0A        this.location = location;%0A    %7D%0A    %0A    public void run() throws Exception %7B%0A        RpcChannel channel = null;%0A        try %7B%0A            String host = location.split(%22:%22)%5B0%5D;%0A            int port = Integer.valueOf(location.split(%22:%22)%5B1%5D);%0A            channel = RpcChannel.create(host, port);%0A            Services.SystemService system = Services.SystemService.newStub(channel);%0A            Rpc rpc = new Rpc();%0A            rpc.setTimeout(10000);%0A            RpcCallback%3CEmpty%3E done = new RpcCallback%3CEmpty%3E() %7B%0A                @Override public void run(Empty unused) %7B%0A                %7D%0A            %7D;%0A            system.killMaster(rpc, Services.Empty.getDefaultInstance(),%0A                    done);%0A            rpc.await();%0A        %7D finally %7B%0A            if (channel != null) %7B%0A                channel.close();%0A            %7D%0A        %7D%0A    %7D%0A    %0A    public static void main(String%5B%5D args) %7B%0A        if (args.length != 1) %7B%0A            System.err.println(%22Usage: %22 + KillMaster.class + %22 host:port%22);%0A            System.exit(1);%0A        %7D%0A        String location = args%5B0%5D;%0A        try %7B%0A            new KillMaster(location).run();%0A        %7D catch (Exception e) %7B%0A            e.printStackTrace();%0A            System.exit(1);%0A        %7D%0A    %7D%0A%7D%0A

Add KillMaster application.