01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.geronimo.j2ee.deployment;
17:
18: import java.util.Map;
19: import java.util.List;
20: import java.util.HashMap;
21:
22: import org.apache.geronimo.common.DeploymentException;
23: import org.apache.geronimo.kernel.config.Configuration;
24: import org.apache.geronimo.kernel.repository.Environment;
25: import org.apache.geronimo.deployment.AbstractNamespaceBuilder;
26: import org.apache.geronimo.j2ee.annotation.Injection;
27: import org.apache.geronimo.j2ee.annotation.Holder;
28: import org.apache.geronimo.gbean.AbstractName;
29: import org.apache.xmlbeans.QNameSet;
30: import org.apache.xmlbeans.XmlObject;
31:
32: /**
33: * @version $Rev: 535381 $ $Date: 2007-05-04 14:04:18 -0700 (Fri, 04 May 2007) $
34: */
35: public interface NamingBuilder extends AbstractNamespaceBuilder {
36:
37: XmlObject[] NO_REFS = new XmlObject[] {};
38: String ENV = "env/";
39:
40: Key<Map<String, Object>> JNDI_KEY = new Key<Map<String, Object>>() {
41:
42: public Map<String, Object> get(Map context) {
43: Map<String, Object> result = (Map<String, Object>) context
44: .get(this );
45: if (result == null) {
46: result = new HashMap<String, Object>();
47: context.put(this , result);
48: }
49: return result;
50: }
51: };
52: Key<Holder> INJECTION_KEY = new Key<Holder>() {
53:
54: public Holder get(Map context) {
55: Holder result = (Holder) context.get(this );
56: if (result == null) {
57: result = new Holder();
58: context.put(this , result);
59: }
60: return result;
61: }
62: };
63: Key<AbstractName> GBEAN_NAME_KEY = new Key<AbstractName>() {
64:
65: public AbstractName get(Map context) {
66: return (AbstractName) context.get(this );
67: }
68: };
69:
70: void buildEnvironment(XmlObject specDD, XmlObject plan,
71: Environment environment) throws DeploymentException;
72:
73: void initContext(XmlObject specDD, XmlObject plan, Module module)
74: throws DeploymentException;
75:
76: void buildNaming(XmlObject specDD, XmlObject plan, Module module,
77: Map componentContext) throws DeploymentException;
78:
79: public interface Key<T> {
80: T get(Map context);
81: }
82:
83: }
|