KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > bpel > xml > ArchiveWsdlLocator


1 package org.jbpm.bpel.xml;
2
3 import java.io.ByteArrayInputStream JavaDoc;
4
5 import org.xml.sax.InputSource JavaDoc;
6
7 import org.jbpm.jpdl.par.ProcessArchive;
8
9 /**
10  * @author Alejandro Guízar
11  * @version $Revision: 1.4 $ $Date: 2005/06/16 19:15:34 $
12  */

13 public class ArchiveWsdlLocator extends ImportWsdlLocator {
14   
15   private final ProcessArchive archive;
16
17   public ArchiveWsdlLocator(String JavaDoc bpelURI, ProcessArchive archive) {
18     super(bpelURI);
19     this.archive = archive;
20   }
21   
22   protected InputSource JavaDoc createInputSource(String JavaDoc importURI) {
23     InputSource JavaDoc inputSource = new InputSource JavaDoc(importURI);
24     byte[] entry = archive.removeEntry(importURI);
25     if (entry != null) {
26       inputSource.setByteStream(new ByteArrayInputStream JavaDoc(entry));
27     }
28     return inputSource;
29   }
30
31 }
Popular Tags