KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > bpel > data > spi > ScriptFactory


1 package org.jbpm.bpel.data.spi;
2
3 import java.util.HashMap JavaDoc;
4 import java.util.Map JavaDoc;
5
6 import org.jbpm.bpel.data.def.Snippet;
7
8 /**
9  * Snippet factories manufacture BPEL expressions and queries.
10  * @author Alejandro Guízar
11  * @version $Revision: 1.2 $ $Date: 2005/06/16 19:15:46 $
12  */

13 public abstract class ScriptFactory {
14   
15   private static Map JavaDoc factories = new HashMap JavaDoc();
16   
17   protected ScriptFactory() {
18   }
19   
20   public abstract Script createScript(Snippet snippet);
21   
22   public static ScriptFactory getInstance(String JavaDoc language) {
23     return (ScriptFactory) factories.get(language);
24   }
25   
26   public static void registerInstance(String JavaDoc language, ScriptFactory instance) {
27     factories.put(language, instance);
28   }
29 }
30
Popular Tags