Package org.jdesktop.wonderland.runner

Examples of org.jdesktop.wonderland.runner.DeploymentPlan


     * @return An XML encoding of the module's basic information
     */
    @GET
    @Produces({"application/xml", "application/json"})
    public Response getDeploymentPlan(@QueryParam(value="location") String location) {
        DeploymentPlan dp = DeploymentManager.getInstance().getPlan().clone();

        // filter by location
        if (location != null) {
            for (DeploymentEntry de : dp.getEntries().toArray(new DeploymentEntry[0])) {
                if (!location.equals(de.getLocation())) {
                    dp.removeEntry(de);
                }
            }
        }

        ResponseBuilder rb = Response.ok(dp);
View Full Code Here


                              Runner runner,
                              DeploymentEntry de)
        throws ServletException, IOException
    {
        DeploymentManager dm = DeploymentManager.getInstance();
        DeploymentPlan dp = dm.getPlan();
       
        // if any property is the same as the default property,
        // remove it so it will change as the default changes
        for (String propName : de.getProperties().stringPropertyNames()) {
            String runVal = de.getProperties().getProperty(propName);
            String defVal = runner.getDefaultProperties().getProperty(propName);

            if (runVal.equals(defVal)) {
                de.getProperties().remove(propName);
            }
        }

        // replace the existing entry with the new one
        dp.removeEntry(de);
        dp.addEntry(de);
        dm.savePlan();
       
        redirectToRun(response);
    }
View Full Code Here

    protected void doEditRunners(HttpServletRequest request,
                                 HttpServletResponse response)
        throws ServletException, IOException
    {
        DeploymentPlan dp = getSessionDeploymentPlan(request);
        request.setAttribute("entries", dp.getEntries());

        RequestDispatcher rd = request.getRequestDispatcher("/editRunners.jsp");
        rd.forward(request, response);
    }
View Full Code Here

            // remove the temporary session
            request.getSession().removeAttribute(DEPLOYMENT_PLAN_SESSION_KEY);
            redirectToRun(response);
        } else if (button.equalsIgnoreCase("Save")) {
            // store the new plan
            DeploymentPlan sessionPlan = getSessionDeploymentPlan(request);
            DeploymentManager.getInstance().setPlan(sessionPlan);
            DeploymentManager.getInstance().savePlan();
           
            // restart the RunManager
            restartRunManager();
View Full Code Here

        {
            request.setAttribute("error", "Invalid entry");
            return false;
        }

        DeploymentPlan dp = getSessionDeploymentPlan(request);

        // make sure this isn't a duplicate
        if (dp.getEntry(de.getRunnerName()) != null) {
            request.setAttribute("error", "Duplicate name");
            return false;
        }
       
        dp.addEntry(de);
        return true;
    }
View Full Code Here

        String name = (String) request.getParameter("name");
        if (name == null) {
            return;
        }

        DeploymentPlan dp = getSessionDeploymentPlan(request);

        // find the entry and remove it
        DeploymentEntry de = dp.getEntry(name);
        if (de != null) {
            dp.removeEntry(de);
        }

        redirectToEditRunners(response);
    }
View Full Code Here

     * plan if there is none in the session.
     * @return the session deployment plan
     */
    protected DeploymentPlan getSessionDeploymentPlan(HttpServletRequest request) {
        HttpSession session = request.getSession();
        DeploymentPlan dp = (DeploymentPlan) session.getAttribute(DEPLOYMENT_PLAN_SESSION_KEY);
        if (dp == null) {
            DeploymentManager dm = DeploymentManager.getInstance();
            dp = dm.getPlan().clone();
            session.setAttribute(DEPLOYMENT_PLAN_SESSION_KEY, dp);
        }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.runner.DeploymentPlan

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.