Package com.sun.faban.harness.tools

Examples of com.sun.faban.harness.tools.ToolDescription


                            if (toolMap.containsKey(key)) {
                                logger.log(Level.WARNING,
                                        "Ignoring duplicate tool" + id);
                            } else {
                                toolMap.put(key, new ToolDescription(id,
                                        serviceName, toolClass, type, dir));
                            }
                        }
                    }
                }
View Full Code Here


        }
    }

    private void bindServices() {
        for (Map.Entry<String, ToolDescription> entry : toolMap.entrySet()) {
            ToolDescription toolDesc = entry.getValue();
            if (!toolDesc.bind(serviceMap))
                logger.warning("Tool " + toolDesc.getId() + " at " +
                        toolDesc.getLocationType() + File.separator +
                        toolDesc.getLocation() +
                        " references non-existent service " +
                        toolDesc.getServiceName());
        }
    }
View Full Code Here

                        toolsetTools.addAll(toolSetsMap.get(key));
                        for (String t1 : toolsetTools) {
                            StringTokenizer tt1 = new StringTokenizer(t1);
                            String toolId1 = tt1.nextToken();
                            String toolKey1 = toolId1 + '/' + serviceName;
                            ToolDescription toolDesc = toolMap.get(toolKey1);
                            MasterToolContext toolCtx;
                            if (toolDesc != null) {
                                toolCtx = new MasterToolContext(t1, ctx,
                                        toolDesc);
                            } else {
                                toolDesc = toolMap.get(toolId1);
                                if (toolDesc != null) {
                                    toolCtx = new MasterToolContext(
                                            t1, ctx, toolDesc);
                                    activeDeployments.add(
                                            toolDesc.getLocationType() +
                                                    File.separator +
                                                    toolDesc.getLocation());
                                } else {
                                    //logger.info("No Tool Description for tool: " + t1);
                                    logger.fine("No Tool Description for tool: "
                                            + t1 +" ,so it's a command line tool");
                                    toolCtx = new MasterToolContext(
                                            t1, ctx, null);
                                }
                            }
                            if (toolCtx != null) {
                                toolList.add(toolCtx);
                            }
                        }
                    }

                }
                // Analyze the list of tools for toolset references.
                for (String tool : tools) {
                    StringTokenizer tt = new StringTokenizer(tool);
                    String toolId = tt.nextToken();
                    String toolKey = toolId + '/' + serviceName;
                    Set<String> toolsetTools = new LinkedHashSet<String>();
                    if (toolSetsMap.containsKey(toolKey)) {
                        toolsetTools.addAll(toolSetsMap.get(toolKey));
                        for (String t1 : toolsetTools) {
                            StringTokenizer tt1 = new StringTokenizer(t1);
                            String toolId1 = tt1.nextToken();
                            String toolKey1 = toolId1 + '/' + serviceName;
                            ToolDescription toolDesc = toolMap.get(toolKey1);
                            MasterToolContext toolCtx;
                            if (toolDesc != null) {
                                toolCtx = new MasterToolContext(t1, ctx, toolDesc);
                            } else {
                                toolDesc = toolMap.get(toolId1);
                                if (toolDesc != null) {
                                    toolCtx = new MasterToolContext(
                                            t1, ctx, toolDesc);
                                } else {
                                    logger.fine("No Tool Description for tool: "
                                            + t1 +
                                            " ,so it's a command line tool");
                                    toolCtx = new MasterToolContext(
                                            t1, ctx, null);
                                }
                            }
                            if (toolCtx != null) {
                                toolList.add(toolCtx);
                            }
                        }
                    } else {
                        ToolDescription toolDesc = toolMap.get(toolKey);
                        MasterToolContext toolCtx;
                        if (toolDesc != null) {
                            toolCtx = new MasterToolContext(tool, ctx, toolDesc);
                        } else {
                            toolDesc = toolMap.get(toolId);
View Full Code Here

            if (path != null && path.length() == 0)
                path = null;

            String toolClass = null;
            ToolDescription toolDesc = ctx.getToolDescription();
            if (toolDesc != null)
                toolClass = toolDesc.getToolClass();

            // Now, create the tool object and call its configure method           
            if (toolClass != null) {
                try {
                    DeployImageClassLoader loader = DeployImageClassLoader.
                            getInstance(toolDesc.getLocationType(),
                            toolDesc.getLocation(), getClass().getClassLoader());
                    Class c = loader.loadClass(toolClass);
                    tools[i] = new ToolWrapper(c, ctx);
                    logger.fine("Trying to run tool " + c.getName());
                    tools[i].configure(toolNames[i], path, outDir, host, CmdAgentImpl.getHandle(), latch);
                } catch (ClassNotFoundException ce) {
View Full Code Here

TOP

Related Classes of com.sun.faban.harness.tools.ToolDescription

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.