Package org.apache.geronimo.system.plugin.model

Examples of org.apache.geronimo.system.plugin.model.ModuleType


    }
    public static ModuleType loadModule(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
        Unmarshaller unmarshaller = MODULE_CONTEXT.createUnmarshaller();
        XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
        JAXBElement<ModuleType> element = unmarshaller.unmarshal(xmlStream, ModuleType.class);
        ModuleType pluginList = element.getValue();
        return pluginList;
    }
View Full Code Here


    public void testCommentXml() throws Exception {
        String comment = "This comment should get properly parsed";

        Reader in = new StringReader(REFERENCE_COMMENT_XML);
        ModuleType module = AttributesXmlUtil.loadModule(in);
        ConfigurationOverride commentConfig = new ConfigurationOverride(module, expressionParser);

        assertNotNull(commentConfig);
        assertEquals(commentConfig.getComment(), comment);
    }
View Full Code Here

    public void testCommentXml() throws Exception {
        String comment = "This comment should get properly parsed";

        Reader in = new StringReader(REFERENCE_COMMENT_XML);
        ModuleType module = AttributesXmlUtil.loadModule(in);
        ConfigurationOverride commentConfig = new ConfigurationOverride(module, expressionParser);

        assertNotNull(commentConfig);
        assertEquals(commentConfig.getComment(), comment);
    }
View Full Code Here

    static void write(ServerOverride serverOverride, Writer writer) throws XMLStreamException, JAXBException, IOException {
        AttributesType attributes = serverOverride.writeXml();
       
        // we don't need to write wab configuration to config.xml
        for (Iterator<ModuleType> it = attributes.getModule().iterator(); it.hasNext();) {
            ModuleType module = it.next();
            if (module.getName().endsWith("wab")) {
                it.remove();
            }
        }
       
        AttributesXmlUtil.writeAttributes(attributes, writer);
View Full Code Here

    }
    public static ModuleType loadModule(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
        Unmarshaller unmarshaller = MODULE_CONTEXT.createUnmarshaller();
        XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
        JAXBElement<ModuleType> element = unmarshaller.unmarshal(xmlStream, ModuleType.class);
        ModuleType pluginList = element.getValue();
        return pluginList;
    }
View Full Code Here

    static void write(ServerOverride serverOverride, Writer writer) throws XMLStreamException, JAXBException, IOException {
        AttributesType attributes = serverOverride.writeXml();
       
        // we don't need to write wab configuration to config.xml
        for (Iterator<ModuleType> it = attributes.getModule().iterator(); it.hasNext();) {
            ModuleType module = it.next();
            if (module.getName().endsWith("wab")) {
                it.remove();
            }
        }
       
        AttributesXmlUtil.writeAttributes(attributes, writer);
View Full Code Here

    }
    public static ModuleType loadModule(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
        Unmarshaller unmarshaller = MODULE_CONTEXT.createUnmarshaller();
        XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
        JAXBElement<ModuleType> element = unmarshaller.unmarshal(xmlStream, ModuleType.class);
        ModuleType pluginList = element.getValue();
        return pluginList;
    }
View Full Code Here

    public void addGBean(AbstractName gbeanName, GBeanOverride gbean) {
        gbeans.put(gbeanName, gbean);
    }

    public ModuleType writeXml() {
        ModuleType module = new ModuleType();
        module.setName(name.toString());

        if (condition != null && condition.trim().length() != 0) {
            module.setCondition(condition);
        } else if (!load) {
            module.setLoad(false);
        }

        if (comment != null && comment.trim().length() > 0) {
            module.setComment(comment.trim());
        }

        // GBeans
        for (GBeanOverride gbeanOverride : gbeans.values()) {
            GbeanType gbean = gbeanOverride.writeXml();
            module.getGbean().add(gbean);
        }
        return module;
    }
View Full Code Here

            cmnt.append("==================================================================");

            attributes.setComment(cmnt.toString());
        }
        for (ConfigurationOverride module: configurations.values()) {
            ModuleType moduleType = module.writeXml();
            attributes.getModule().add(moduleType);
        }
        return attributes;
    }
View Full Code Here

    }
    public static ModuleType loadModule(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
        Unmarshaller unmarshaller = MODULE_CONTEXT.createUnmarshaller();
        XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
        JAXBElement<ModuleType> element = unmarshaller.unmarshal(xmlStream, ModuleType.class);
        ModuleType pluginList = element.getValue();
        return pluginList;
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.system.plugin.model.ModuleType

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.