Examples of ModuleManager


Examples of gri.gridp.modules.managers.ModuleManager

 
  /**
   * Creates a local TaskManager for GRIDP tasks
   */
  public TaskManager getTaskManager() {
    ModuleManager moduleManager = getModuleManager();
    RunScriptTask runScript = new RunScriptTask(scriptFile, execCmd);
    return new GridpTaskManager(moduleManager, runScript);
  }
View Full Code Here

Examples of gri.gridp.modules.managers.ModuleManager

   * Creates an SSH TaskManager to run GRIDP tasks on remote computers
   * over SSH.  The remote computer and login information are provided
   * by the SessionFactory.
   */
  public TaskManager getSshTaskManager(SessionFactory sessionFactory) {
    ModuleManager moduleManager = getModuleManager();
    SshScriptTask runScript = new SshScriptTask(sessionFactory, scriptFile, execCmd);
    return new GridpTaskManager(moduleManager, runScript);
  }
View Full Code Here

Examples of gri.gridp.modules.managers.ModuleManager

    scriptSerializer.write(taskManager.getRunScriptTask(), scriptElem);
    elem.addContent(scriptElem);
  }

  public GridpTaskManager readTaskManager(Element elem) throws IOException {
    ModuleManager moduleManager;
    RunScriptTask runScriptTask;

    Element moduleElem = elem.getChild("modules");
    if (moduleElem == null)
      throw new MissingElementException("modules");
View Full Code Here

Examples of org.apache.lenya.cms.module.ModuleManager

                source = resolver.getSource();
            }

            if (source == null) {
                if (path.startsWith("lenya/modules/")) {
                    ModuleManager moduleMgr = null;
                    try {
                        moduleMgr = (ModuleManager) this.manager.lookup(ModuleManager.ROLE);
                        final String moduleShortcut = path.split("/")[2];
                        String baseUri = moduleMgr.getBaseURI(moduleShortcut);
                        final String modulePath = path.substring(("lenya/modules/" + moduleShortcut).length());
                        source = sourceResolver.resolveURI(baseUri + modulePath);
                    } finally {
                        if (moduleMgr != null) {
                            this.manager.release(moduleMgr);
View Full Code Here

Examples of org.apache.lenya.cms.module.ModuleManager

            List allUris = new ArrayList();
            allUris.addAll(Arrays.asList(uris));
           
            String contextSourceUri = null;
            if (path.startsWith("lenya/modules/")) {
                ModuleManager moduleMgr = null;
                try {
                    moduleMgr = (ModuleManager) this.manager.lookup(ModuleManager.ROLE);
                    final String moduleShortcut = path.split("/")[2];
                    String baseUri = moduleMgr.getBaseURI(moduleShortcut);
                    final String modulePath = path.substring(("lenya/modules/" + moduleShortcut).length());
                    contextSourceUri = baseUri + modulePath;
                } finally {
                    if (moduleMgr != null) {
                        this.manager.release(moduleMgr);
View Full Code Here

Examples of org.apache.lenya.cms.module.ModuleManager

            List allUris = new ArrayList();
            allUris.addAll(Arrays.asList(uris));
           
            String contextSourceUri = null;
            if (path.startsWith("lenya/modules/")) {
                ModuleManager moduleMgr = null;
                try {
                    moduleMgr = (ModuleManager) this.manager.lookup(ModuleManager.ROLE);
                    final String moduleShortcut = path.split("/")[2];
                    String baseUri = moduleMgr.getBaseURI(moduleShortcut);
                    final String modulePath = path.substring(("lenya/modules/" + moduleShortcut).length());
                    contextSourceUri = baseUri + modulePath;
                } finally {
                    if (moduleMgr != null) {
                        this.manager.release(moduleMgr);
View Full Code Here

Examples of org.apache.lenya.cms.module.ModuleManager

                source = resolver.getSource();
            }

            if (source == null) {
                if (path.startsWith("lenya/modules/")) {
                    ModuleManager moduleMgr = null;
                    try {
                        moduleMgr = (ModuleManager) this.manager.lookup(ModuleManager.ROLE);
                        final String moduleShortcut = path.split("/")[2];
                        String baseUri = moduleMgr.getBaseURI(moduleShortcut);
                        final String modulePath = path
                                .substring(("lenya/modules/" + moduleShortcut).length());
                        source = sourceResolver.resolveURI(baseUri + modulePath);
                    } finally {
                        if (moduleMgr != null) {
View Full Code Here

Examples of org.directwebremoting.extend.ModuleManager

                Creator creator = creatorManager.getCreator(creatorName, false);
                Loggers.STARTUP.debug("  Creator: " + creatorName + " = " + creator + " (" + creator.getClass().getName() + ")");
            }

            // ModuleManager debugging
            ModuleManager moduleManager = container.getBean(ModuleManager.class);
            Loggers.STARTUP.debug("ModuleManager");
            Loggers.STARTUP.debug("  Type: " + moduleManager.getClass().getName());
        }
    }
View Full Code Here

Examples of org.jdesktop.wonderland.modules.service.ModuleManager

    public Response getModuleRepository(@PathParam("modulename") String moduleName) {
        /* Fetch thhe error logger for use in this method */
        Logger logger = ModuleManager.getLogger();
       
        /* Fetch the module from the module manager */
        ModuleManager manager = ModuleManager.getModuleManager();
        Module module = manager.getInstalledModules().get(moduleName);
        if (module == null) {
            /* Log an error and return an error response */
            logger.warning("ModuleManager: unable to locate module " + moduleName);
            ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
            return rb.build();
View Full Code Here

Examples of org.jdesktop.wonderland.modules.service.ModuleManager

        /*
         * Create a factory for disk-base file items to handle the request. Also
         * place the file in add/.
         */
        String redirect = "/installFailed.jsp";
        ModuleManager manager = ModuleManager.getModuleManager();
       
        /* Check that we have a file upload request */
        boolean isMultipart = ServletFileUpload.isMultipartContent(request);
        if (isMultipart == false) {
            LOGGER.warning("Failed to upload module, isMultipart=false");
            String msg = "Unable to recognize upload request. Please try again.";
            request.setAttribute("errorMessage", msg);
            RequestDispatcher rd = request.getRequestDispatcher(redirect);
            rd.forward(request, response);
            return;
        }
        // Create a new file upload handler
        ServletFileUpload upload = new ServletFileUpload();

        // Parse the request
        try {
            FileItemIterator iter = upload.getItemIterator(request);
            while (iter.hasNext() == true) {
                FileItemStream item = iter.next();
                InputStream stream = item.openStream();
                if (item.isFormField() == false) {
                    /*
                     * The name given should have a .jar extension. Check this here. If
                     * not, return an error. If so, parse out just the module name.
                     */
                    String moduleJar = item.getName();
                    if (moduleJar.endsWith(".jar") == false) {
                        /* Log an error to the log and write an error message back */
                        LOGGER.warning("Upload is not a jar file " + moduleJar);
                        String msg = "The file " + moduleJar + " needs to be" +
                                " a jar file. Please try again.";
                        request.setAttribute("errorMessage", msg);
                        RequestDispatcher rd = request.getRequestDispatcher(redirect);
                        rd.forward(request, response);
                        return;
                    }
                    String moduleName = moduleJar.substring(0, moduleJar.length() - 4);

                    LOGGER.info("Upload Install module " + moduleName +
                            " with file name " + moduleJar);
                   
                    /*
                     * Write the file a temporary file
                     */
                    File tmpFile = null;
                    try {
                        tmpFile = File.createTempFile(moduleName+"_tmp", ".jar");
                        tmpFile.deleteOnExit();
                        RunUtil.writeToFile(stream, tmpFile);
                    } catch (java.lang.Exception excp) {
                        /* Log an error to the log and write an error message back */
                        LOGGER.log(Level.WARNING, "Failed to save file", excp);
                        String msg = "Internal error installing the module.";
                        request.setAttribute("errorMessage", msg);
                        RequestDispatcher rd = request.getRequestDispatcher(redirect);
                        rd.forward(request, response);
                        return;
                    }

                    /* Add the new module */
                    Collection<File> moduleFiles = new LinkedList<File>();
                    moduleFiles.add(tmpFile);
                    Collection<Module> result = manager.addToInstall(moduleFiles);
                    if (result.isEmpty() == true) {
                        /* Log an error to the log and write an error message back */
                        LOGGER.warning("Failed to install module " + moduleName);
                        String msg = "Internal error installing the module.";
                        request.setAttribute("errorMessage", msg);
                        RequestDispatcher rd = request.getRequestDispatcher(redirect);
                        rd.forward(request, response);
                        return;
                    }
                }
            }
        } catch (FileUploadException excp) {
            /* Log an error to the log and write an error message back */
            LOGGER.log(Level.WARNING, "File upload failed", excp);
            String msg = "Failed to upload the file. Please try again.";
            request.setAttribute("errorMessage", msg);
            RequestDispatcher rd = request.getRequestDispatcher(redirect);
            rd.forward(request, response);
            return;
        }
        /* Install all of the modules that are possible */
        manager.installAll();
       
        /* If we have reached here, then post a simple message */
        LOGGER.info("Added module successfully");
        RequestDispatcher rd = request.getRequestDispatcher("/installSuccess.jsp");
        rd.forward(request, response);
View Full Code Here
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.