Package org.directwebremoting.proxy

Examples of org.directwebremoting.proxy.ScriptProxy


    ServerContext serverContext = ServerContextFactory.get(servletContext);
    Iterator iterator = serverContext.getAllScriptSessions().iterator();
    String currentPage = webContext.getCurrentPage();
    serverContext.getScriptSessionsByPage(currentPage);
    while(iterator.hasNext()){
      ScriptProxy proxy = new ScriptProxy((ScriptSession) iterator.next());
      proxy.addFunctionCall("redirect");
    }
   
    return "miro";
  }
View Full Code Here


    public void getProgressInfo(Integer downloadKey) throws Exception {
        // DWR objects
        WebContext wctx = WebContextFactory.get();
        ScriptSession scriptSession = wctx.getScriptSession();
        //DownloadResults results = getPluginInstaller().checkOnInstall(downloadKey);
        ScriptProxy scriptProxy = new ScriptProxy();
        scriptProxy.addScriptSession(scriptSession);
       
        PluginInstallerGBean pluginInstallerInternal = (PluginInstallerGBean) getPluginInstaller();
        DownloadResults results = pluginInstallerInternal.checkOnInstall(downloadKey, false);
       
        //In the event results.isFinished is passed in true during polling
        scriptProxy.addFunctionCall("setMainMessage", results.getCurrentMessage());
        scriptProxy.addFunctionCall("setProgressCurrentFile", results.getCurrentFile());
       
        while (!results.isFinished()) {
            // update the progress bar
            scriptProxy.addFunctionCall("setProgressCurrentFile", results.getCurrentFile());
            scriptProxy.addFunctionCall("setProgressPercent", results.getCurrentFilePercent());
            scriptProxy.addFunctionCall("setMainMessage", results.getCurrentMessage());
           
            // get an update on the download progress, sleep time reduce to poll faster for smaller files
            Thread.sleep(100);
            //results = getPluginInstaller().checkOnInstall(downloadKey);
            results = pluginInstallerInternal.checkOnInstall(downloadKey, false);
        }
       
        if(results.isFailed()) {
            scriptProxy.addFunctionCall("setErrorMessage", results.getFailure().toString());
            throw new Exception("Unable to install configuration", results.getFailure());
        }
       
        //Fills bar at the end in the event the poller didn't catch the 100
        scriptProxy.addFunctionCall("setProgressFull");
        scriptProxy.addFunctionCall("setFinished");
       
    }
View Full Code Here

TOP

Related Classes of org.directwebremoting.proxy.ScriptProxy

Copyright © 2018 www.massapicom. 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.