Package hudson

Examples of hudson.XmlFile


    @SuppressWarnings("unchecked")
    private static synchronized void load() {
        if (stagesByNameByJob == null) {
            stagesByNameByJob = new TreeMap<String,Map<String,Stage>>();
            try {
                XmlFile configFile = getConfigFile();
                if (configFile.exists()) {
                    stagesByNameByJob = (Map<String,Map<String,Stage>>) configFile.read();
                }
            } catch (IOException x) {
                LOGGER.log(WARNING, null, x);
            }
            LOGGER.log(Level.FINE, "load: {0}", stagesByNameByJob);
View Full Code Here


        synchronized (LOADING_RUNS) {
            LOADING_RUNS.put(key(), this);
        }

        // super.reload() forces result to be FAILURE, so working around that
        new XmlFile(XSTREAM,new File(getRootDir(),"build.xml")).unmarshal(this);
    }
View Full Code Here

        }
    }

    static void alias() {
        Run.XSTREAM2.alias("flow-build", WorkflowRun.class);
        new XmlFile(null).getXStream().aliasType("flow-owner", Owner.class); // hack! but how else to set it for arbitrary Descriptor’s?
        Run.XSTREAM2.aliasType("flow-owner", Owner.class);
    }
View Full Code Here

    private synchronized @CheckForNull XmlFile configFile() {
        if (configFile == null) {
            Jenkins j = Jenkins.getInstance();
            if (j != null) {
                configFile = new XmlFile(new File(j.getRootDir(), FlowExecutionList.class.getName() + ".xml"));
            }
        }
        return configFile;
    }
View Full Code Here

        return configFile;
    }

    @SuppressWarnings("unchecked")
    private synchronized void load() {
        XmlFile cf = configFile();
        if (cf == null) {
            return; // oh well
        }
        if (cf.exists()) {
            try {
                runningTasks.replaceBy((List<FlowExecutionOwner>) cf.read());
            } catch (IOException x) {
                LOGGER.log(WARNING, null, x);
            }
        }
    }
View Full Code Here

            LOGGER.log(FINE, "could not schedule save, perhaps because Jenkins is shutting down; saving immediately", x);
            save(copy);
        }
    }
    private void save(List<FlowExecutionOwner> copy) {
        XmlFile cf = configFile();
        if (cf == null) {
            return; // oh well
        }
        try {
            cf.write(copy);
        } catch (IOException x) {
            LOGGER.log(WARNING, null, x);
        }
    }
View Full Code Here

    public void storeNode(FlowNode n) throws IOException {
        get().store(n);
    }

    private XmlFile getNodeFile(String id) {
        return new XmlFile(XSTREAM, new File(dir,id+".xml"));
    }
View Full Code Here

            CONTEXT.set(this);
            try {
                queue.add(n);
                while (!queue.isEmpty()) {
                    n = queue.remove(0);
                    XmlFile f = getNodeFile(n.getId());
                    if (!f.exists()) {
                        f.write(new Tag(n,new ArrayList<Action>()));
                    }
                }
            } finally {
                CONTEXT.set(old);
            }
View Full Code Here

     * Returns the serialization file.
     *
     * @return the serialization file.
     */
    public final XmlFile getDataFile() {
        return new XmlFile(getXStream(), new File(getOwner().getRootDir(), getSerializationFileName()));
    }
View Full Code Here

     * XML prior to the test code refactoring.
     *
     * @throws Exception
     */
    public void testXmlCompatibility() throws Exception {
        XmlFile xmlFile = new XmlFile(XSTREAM, getDataFile("junitResult.xml"));
        TestResult result = (TestResult)xmlFile.read();

        // Regenerate the transient data
        result.tally();
        assertEquals(9, result.getTotalCount());
        assertEquals(1, result.getSkipCount());
View Full Code Here

TOP

Related Classes of hudson.XmlFile

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.