01: /*
02: * BEGIN_HEADER - DO NOT EDIT
03: *
04: * The contents of this file are subject to the terms
05: * of the Common Development and Distribution License
06: * (the "License"). You may not use this file except
07: * in compliance with the License.
08: *
09: * You can obtain a copy of the license at
10: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
11: * See the License for the specific language governing
12: * permissions and limitations under the License.
13: *
14: * When distributing Covered Code, include this CDDL
15: * HEADER in each file and include the License file at
16: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
17: * If applicable add the following below this CDDL HEADER,
18: * with the fields enclosed by brackets "[]" replaced with
19: * your own identifying information: Portions Copyright
20: * [year] [name of copyright owner]
21: */
22:
23: /*
24: * @(#)TemplateRegistry.java
25: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
26: *
27: * END_HEADER - DO NOT EDIT
28: */
29: package com.sun.jbi.engine.xslt;
30:
31: import com.sun.jbi.engine.xslt.util.StringTranslator;
32:
33: import java.util.Collections;
34: import java.util.HashMap;
35: import java.util.Map;
36:
37: import javax.xml.transform.Templates;
38:
39: /**
40: * This command contains the request response implementation.
41: *
42: * @author Sun Microsystems, Inc.
43: */
44: public final class TemplateRegistry implements TEResources {
45: /**
46: *
47: */
48: private static TemplateRegistry sTemplateRegistry = null;
49:
50: /**
51: *
52: */
53: private Map mMap;
54:
55: /**
56: * Construtor for creating TemplateRegistry Object.
57: */
58: private TemplateRegistry() {
59: // Do any command specific init.
60: //TEMPLATEREGISTRY_CONSTRUCTOR_START));
61: mMap = Collections.synchronizedMap(new HashMap());
62:
63: //TEMPLATEREGISTRY_CONSTRUCTOR_END));
64: }
65:
66: /**
67: * DOCUMENT ME!
68: *
69: * @return NOT YET DOCUMENTED
70: */
71: public static TemplateRegistry getRegistry() {
72: if (sTemplateRegistry == null) {
73: sTemplateRegistry = new TemplateRegistry();
74: }
75:
76: return sTemplateRegistry;
77: }
78:
79: /**
80: * DOCUMENT ME!
81: *
82: * @param key NOT YET DOCUMENTED
83: *
84: * @return NOT YET DOCUMENTED
85: */
86: public Templates get(String key) {
87: return (Templates) mMap.get(key);
88: }
89:
90: /**
91: * DOCUMENT ME!
92: *
93: * @param key NOT YET DOCUMENTED
94: * @param tpl NOT YET DOCUMENTED
95: */
96: public void put(String key, Templates tpl) {
97: mMap.put(key, tpl);
98: }
99: }
|