1 /** 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * 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 */ 17 18 package org.apache.geronimo.j2ee.deployment; 19 20 import java.util.HashMap; 21 import java.util.Map; 22 23 import org.apache.geronimo.common.DeploymentException; 24 import org.apache.geronimo.deployment.AbstractNamespaceBuilder; 25 import org.apache.geronimo.gbean.AbstractName; 26 import org.apache.geronimo.j2ee.annotation.Holder; 27 import org.apache.geronimo.kernel.repository.Environment; 28 import org.apache.xmlbeans.XmlObject; 29 30 /** 31 * @version $Rev: 636806 $ $Date: 2008-03-13 10:03:34 -0700 (Thu, 13 Mar 2008) $ 32 */ 33 public interface NamingBuilder extends AbstractNamespaceBuilder { 34 35 int NORMAL_PRIORITY = 50; 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.get(this); 44 if (result == null) { 45 result = new HashMap<String, Object>(); 46 context.put(this, result); 47 } 48 return result; 49 } 50 }; 51 Key<Holder> INJECTION_KEY = new Key<Holder>() { 52 53 public Holder get(Map context) { 54 Holder result = (Holder) context.get(this); 55 if (result == null) { 56 result = new Holder(); 57 context.put(this, result); 58 } 59 return result; 60 } 61 }; 62 Key<AbstractName> GBEAN_NAME_KEY = new Key<AbstractName>() { 63 64 public AbstractName get(Map context) { 65 return (AbstractName) context.get(this); 66 } 67 }; 68 69 void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment) throws DeploymentException; 70 71 void initContext(XmlObject specDD, XmlObject plan, Module module) throws DeploymentException; 72 73 void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException; 74 75 /** 76 * Returns sort order priority. Lower numbers indicate higher priority. 77 */ 78 int getPriority(); 79 80 public interface Key<T> { 81 T get(Map context); 82 } 83 84 85 86 }