开发者

XML processing and creating a resource in parallel in Java

I am writing a app, which has to create multiple Resources. The input is a XML. I need to parse the XML, create the Resources in parallel and update the responses in the Ouputs.

<Components>
    <Resources>
        <CreateResourceARequest> ...</CreateResourceARequest>
        <CreateResourceBRequest>...</CreateResourceBRequest>
        <CreateResourceCRequest>...</CreateResourceCRequest>
    </Resources>
    <Outputs>
        <CreateResourceAResponse>...</CreateResourceAResponse>
        <CreateResourceBResponse>...</CreateResourceBResponse>
        <CreateResourceCResponse>...</CreateResourceCResponse>
    </Outputs>
<Components>    

Each of the ResourceRequests are h开发者_如何学Pythonandled by a specific Classes.

What is the best way to create Resources in parallel, aggregate the results and update the xml ?


you will parse xml file in single thread anyway because the file is linear. but you can collect you parsers for each CreateResourceCRequest in a set and start them all in parallel threads after parsing file

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜