[ 
https://issues.apache.org/jira/browse/MUSE-169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Jemiolo closed MUSE-169.
----------------------------

    Resolution: Fixed

Here is some test code that shows how to use the new methods to construct a 
muse.xml file programmatically:


    public static void main(String[] args) throws Exception
    {
        RouterDefinition router = new RouterDefinition();
        
router.setRouterClass(org.apache.muse.core.routing.SimpleResourceRouter.class);
        
        LoggingConfig logging = new LoggingConfig();
        logging.setLogFile(new java.io.File("log/muse.log"));
        logging.setLogLevel(java.util.logging.Level.FINE);
        router.setLoggingConfig(logging);
        
        PersistenceDefinition persistence = new PersistenceDefinition();
        
persistence.setPersistenceClass(org.apache.muse.core.routing.RouterFilePersistence.class);
        persistence.setPersistenceLocation("router-entries");
        router.setPersistenceDefinition(persistence);
        
        Collection resources = new ArrayList();
        
        ResourceDefinition resource = new ResourceDefinition();
        resource.setUsingPersistence(true);
        resource.setContextPath("http-server");
        resource.setResourceClass(org.apache.muse.core.SimpleResource.class);
        resource.setResourceIdFactory(new 
org.apache.muse.core.routing.CounterResourceIdFactory());
        
        WsdlConfig wsdl = new WsdlConfig();
        wsdl.setWsdlPath("wsdl/HttpServer.wsdl");
        wsdl.setWsdlPortType(new QName("http://example.com/http-server";, 
"HttpServerPortType", "tns"));
        resource.setWsdlConfig(wsdl);
        
        Collection capabilities = new ArrayList();
        
        CapabilityDefinition cap = new CapabilityDefinition();
        
cap.setImplementationClass(Class.forName("org.apache.muse.core.Capability"));
        cap.setURI("http://example.com/http-server/management";);
                
        capabilities.add(cap);
        resource.setCapabilityDefinitions(capabilities);
        
        resources.add(resource);
        
        DeploymentDescriptor dd = new SimpleDeploymentDescriptor();
        dd.setRouterDefinition(router);
        dd.setResourceDefinitions(resources);
        
        java.io.File file = new java.io.File("muse.xml");
        
        Element xml = dd.toXML();
        XmlUtils.toFile(xml, file);
    }


> Add setter methods and XmlSerializable to *Descriptor interfaces and classes
> ----------------------------------------------------------------------------
>
>                 Key: MUSE-169
>                 URL: https://issues.apache.org/jira/browse/MUSE-169
>             Project: Muse
>          Issue Type: Improvement
>          Components: Core Engine - Deployment Descriptor
>    Affects Versions: 2.1.0
>            Reporter: Dan Jemiolo
>         Assigned To: Dan Jemiolo
>             Fix For: 2.2.0
>
>
> Doing this will allow people to create descriptors programmatically and write 
> them to a file, which could be used by Muse-oriented tooling.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to