Package remote

Source Code of remote.RemoteScript

package remote;

import java.io.IOException;

import play.Logger;
import play.modules.gae.PlayDevEnvironment;

import com.google.appengine.tools.remoteapi.RemoteApiInstaller;
import com.google.appengine.tools.remoteapi.RemoteApiOptions;
import com.google.apphosting.api.ApiProxy;

public abstract class RemoteScript {
    public abstract void innerRun();

    public void run() {
        RemoteApiOptions options = new RemoteApiOptions()
            .server("11-9-prod.sortmybox.appspot.com", 443)
            .credentials(System.getenv("user"), System.getenv("password"))
            .remoteApiPath("/remote_api");
        RemoteApiInstaller installer = new RemoteApiInstaller();
//        ApiProxy.setEnvironmentForCurrentThread(new PlayDevEnvironment());
        try {
            installer.install(options);
            innerRun();
        } catch (IOException e) {
            Logger.error(e, "Unable to install");
        } finally {
            try {
                installer.uninstall();
            } catch (Throwable e) {
//                Logger.error(e, "Unable to uninstall");
            }
        }
    }
}
TOP

Related Classes of remote.RemoteScript

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.