Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlObject$Factory


        assert moduleFile != null: "moduleFile is null";
        assert targetPath != null: "targetPath is null";
        assert !targetPath.endsWith("/"): "targetPath must not end with a '/'";

        String specDD;
        XmlObject connector;
        try {
            if (specDDUrl == null) {
                specDDUrl = DeploymentUtil.createJarURL(moduleFile, "META-INF/ra.xml");
            }

            // read in the entire specDD as a string, we need this for getDeploymentDescriptor
            // on the J2ee management object
            specDD = DeploymentUtil.readAll(specDDUrl);
        } catch (Exception e) {
            //no ra.xml, not for us.
            return null;
        }
        //we found ra.xml, if it won't parse it's an error.
        try {
            // parse it
            XmlObject xmlObject = XmlBeansUtil.parse(specDD);
            ConnectorDocument connectorDoc = SchemaConversionUtils.convertToConnectorSchema(xmlObject);
            connector = connectorDoc.getConnector();
        } catch (XmlException e) {
            throw new DeploymentException("Could not parse ra.xml descriptor", e);
        }
View Full Code Here


    public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
        J2eeContext earJ2eeContext = earContext.getJ2eeContext();
        J2eeContext moduleJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.RESOURCE_ADAPTER_MODULE, module.getName());
        J2eeContext resourceJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.JCA_RESOURCE, module.getName());
        XmlObject specDD = module.getSpecDD();

        //set up the metadata for the ResourceAdapterModule
        ObjectName resourceAdapterModuleName = null;
        try {
            resourceAdapterModuleName = NameFactory.getModuleName(null, null, null, null, null, moduleJ2eeContext);
View Full Code Here

    public void addGBeans(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
        J2eeContext earJ2eeContext = earContext.getJ2eeContext();
        J2eeContext moduleJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.RESOURCE_ADAPTER_MODULE, module.getName());
        J2eeContext resourceJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.JCA_RESOURCE, module.getName());

        XmlObject specDD = module.getSpecDD();

        // build the objectName
        ObjectName resourceAdapterModuleName = null;
        try {
            resourceAdapterModuleName = NameFactory.getModuleName(null, null, null, null, null, moduleJ2eeContext);
View Full Code Here

    File basedir = new File(System.getProperty("basedir", System.getProperty("user.dir")));

    public void testLoadGeronimoDeploymentDescriptor10() throws Exception {
        File geronimoDD = new File(basedir, "src/test-data/connector_1_0/geronimo-ra.xml");
        assertTrue(geronimoDD.exists());
        XmlObject plan = XmlBeansUtil.parse(geronimoDD.toURL());
        GerConnectorDocument connectorDocument = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
        GerConnectorType connector = (GerConnectorType) SchemaConversionUtils.fixGeronimoSchema(connectorDocument, "connector", GerConnectorType.type);
        SchemaConversionUtils.validateDD(connector);
        assertEquals(1, connectorDocument.getConnector().getResourceadapterArray().length);
    }
View Full Code Here

    }

    public void testLoadJ2eeDeploymentDescriptor() throws Exception {
        File j2eeDD = new File(basedir, "src/test-data/connector_1_5/ra.xml");
        assertTrue(j2eeDD.exists());
        XmlObject plan = XmlBeansUtil.parse(j2eeDD.toURL());
        ConnectorDocument connectorDocument = (ConnectorDocument) plan.changeType(ConnectorDocument.type);
        assertNotNull(connectorDocument.getConnector().getResourceadapter());
        SchemaConversionUtils.validateDD(connectorDocument);
    }
View Full Code Here

    }

    public void testLoadGeronimoDeploymentDescriptor15() throws Exception {
        File geronimoDD = new File(basedir, "src/test-data/connector_1_5/geronimo-ra.xml");
        assertTrue(geronimoDD.exists());
        XmlObject plan = XmlBeansUtil.parse(geronimoDD.toURL());
        GerConnectorDocument connectorDocument = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
        GerConnectorType connector = (GerConnectorType) SchemaConversionUtils.fixGeronimoSchema(connectorDocument, "connector", GerConnectorType.type);
        assertEquals(1, connector.getResourceadapterArray().length);
    }
View Full Code Here

    public void testResourceAdapterNameUniqueness() throws Exception {
        File resourcePlan = new File(basedir, "src/test-data/data/dup-resourceadapter-name.xml");
        assertTrue(resourcePlan.exists());

        XmlObject plan = XmlBeansUtil.parse(resourcePlan.toURL());
        GerConnectorDocument doc = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
        if (doc == null) {
            doc = (GerConnectorDocument) plan;
        }
        try {
            SchemaConversionUtils.validateDD(doc);
View Full Code Here

    public void testConnectionFactoryNameUniqueness() throws Exception {
        File resourcePlan = new File(basedir, "src/test-data/data/dup-connectionfactoryinstance-name.xml");
        assertTrue(resourcePlan.exists());

        XmlObject plan = XmlBeansUtil.parse(resourcePlan.toURL());
        GerConnectorDocument doc = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
        if (doc == null) {
            doc = (GerConnectorDocument) plan;
        }
        try {
            SchemaConversionUtils.validateDD(doc);
View Full Code Here

    public void testAdminObjectNameUniqueness() throws Exception {
        File resourcePlan = new File(basedir, "src/test-data/data/dup-admin-object-name.xml");
        assertTrue(resourcePlan.exists());

        XmlObject plan = XmlBeansUtil.parse(resourcePlan.toURL());
        GerConnectorDocument doc = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
        if (doc == null) {
            doc = (GerConnectorDocument) plan;
        }
        try {
            SchemaConversionUtils.validateDD(doc);
View Full Code Here

    public void testRectifyPlan() throws Exception {
        File resourcePlan = new File(basedir, "src/test-data/data/old-schema-plan.xml");
        assertTrue(resourcePlan.exists());

        XmlObject plan = XmlBeansUtil.parse(resourcePlan.toURL());
        GerConnectorDocument doc = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
        if (doc == null) {
            doc = (GerConnectorDocument) plan;
        }
        GerConnectorType gerConnector = doc.getConnector();
        ConnectorPlanRectifier.rectifyPlan(gerConnector);
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlObject$Factory

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.