Package org.jdesktop.wonderland.modules

Examples of org.jdesktop.wonderland.modules.Module


            // are all met
            Iterator<Map.Entry<String, Module>> i = deploy.entrySet().iterator();
            while (i.hasNext()) {
                Map.Entry<String, Module> e = i.next();
                String name = e.getKey();
                Module module = e.getValue();

                // scan all the dependencies to see if they are met
                boolean ready = true;
                for (ModuleInfo info : module.getRequires().getRequires()) {
                    // check if the dependency is still in the map
                    // of modules to install.  If it is, it means we cannot
                    // install this module yet.  If the dependency isn't in
                    // the map, it's already installed or already on the list,
                    // so we should be all set
View Full Code Here


    public Module add(File jarFile) {
        /* Get the error logger */
        Logger logger = ModuleManager.getLogger();
       
        /* First attempt to open the URL as a module */
        Module module = null;
        try {
            module = ModuleFactory.open(jarFile);
        } catch (java.lang.Exception excp) {
            /* Log the error and return false */
            logger.log(Level.WARNING, "[MODULES] PENDING Failed to Open Module "
                    + jarFile, excp);
            return null;
        }
       
        /* Next, see the module already exists, log warning and continue */
        if (this.pendingModules.containsKey(module.getName()) == true) {
            logger.log(Level.INFO, "[MODULES] PENDING Module already exists "
                    + module.getName());
        }
       
        /* Add to the pending/ directory */
        File file = this.addToPending(module.getName(), jarFile);
        if (file == null) {
            logger.log(Level.WARNING, "[MODULES] PENDING Failed to add " +
                    module.getName());
            return null;
        }
       
        /* Re-open the module in the new directory */
        try {
            module = ModuleFactory.open(file);

            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Add pending module " + module);
            }
        } catch (java.lang.Exception excp) {
            /* Log the error and return false */
            logger.log(Level.WARNING, "[MODULES] PENDING Failed to Open Module "
                    + file, excp);
            return null;
        }      
        /* If successful, add to the list of pending modules */
        this.pendingModules.put(module.getName(), module);
        return module;
    }
View Full Code Here

         */
        File[] files = this.pendingFile.listFiles();
        for (File file : files) {
            /* Attempt to create the module */
            try {
                Module module = ModuleFactory.open(file);
                map.put(module.getName(), module);

                if (logger.isLoggable(Level.FINE)) {
                    logger.fine("Load pending module " + module);
                }
            } catch (java.lang.Exception excp) {
View Full Code Here

                    excp);
            return null;
        }
       
        /* Re-open module in the installed directory, add to the list */
        Module module = null;
        try {
            module = ModuleFactory.open(file);
            this.installedModules.put(moduleName, module);

            if (logger.isLoggable(Level.FINE)) {
View Full Code Here

         */
        File[] files = this.installedFile.listFiles();
        for (File file : files) {
            /* Attempt to create the module */
            try {
                Module module = ModuleFactory.open(file);
                map.put(module.getName(), module);

                if (logger.isLoggable(Level.FINE)) {
                    logger.fine("Load installed module " + module);
                }
            } catch (java.lang.Exception excp) {
View Full Code Here

            List<String> ordered = DeployManager.getDeploymentOrder(modules);

            // create the list of infos in the correct order
            Collection<ModuleInfo> list = new LinkedList();
            for (String moduleName : ordered) {
                Module module = modules.get(moduleName);
                list.add(module.getInfo());
            }

            moduleList.setModuleInfos(list.toArray(new ModuleInfo[] {}));
            return Response.ok(moduleList).build();
        }
View Full Code Here

        /* 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();
        }
       
        /* Check to see that the module info exists -- it's really bad if it doesn't */
        ModuleInfo moduleInfo = module.getInfo();
        if (moduleInfo == null) {
            /* Log an error and return an error response */
            logger.warning("ModuleManager: unable to locate module info: " + moduleName);
            ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
            return rb.build();
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.Module

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.