1 17 package org.apache.geronimo.system.properties; 18 19 import org.apache.geronimo.gbean.GBeanInfo; 20 import org.apache.geronimo.gbean.GBeanInfoBuilder; 21 22 27 public class NamingProperties { 28 29 static final String JAVA_NAMING_FACTORY_INITIAL = "java.naming.factory.initial"; 30 static final String JAVA_NAMING_FACTORY_URL_PKGS = "java.naming.factory.url.pkgs"; 31 static final String JAVA_NAMING_PROVIDER_URL = "java.naming.provider.url"; 32 33 public NamingProperties(String namingFactoryInitial, String namingFactoryUrlPkgs, String namingProviderUrl) { 34 setNamingFactoryInitial(namingFactoryInitial); 35 setNamingFactoryUrlPkgs(namingFactoryUrlPkgs); 36 setNamingProviderUrl(namingProviderUrl); 37 } 38 39 public String getNamingFactoryInitial() { 40 return System.getProperty(JAVA_NAMING_FACTORY_INITIAL); 41 } 42 43 public void setNamingFactoryInitial(String namingFactoryInitial) { 44 System.setProperty(JAVA_NAMING_FACTORY_INITIAL, namingFactoryInitial); 45 } 46 47 public String getNamingFactoryUrlPkgs() { 48 return System.getProperty(JAVA_NAMING_FACTORY_URL_PKGS); 49 } 50 51 public void setNamingFactoryUrlPkgs(String namingFactoryUrlPkgs) { 52 System.setProperty(JAVA_NAMING_FACTORY_URL_PKGS, namingFactoryUrlPkgs); 53 } 54 55 public String getNamingProviderUrl() { 56 return System.getProperty(JAVA_NAMING_PROVIDER_URL); 57 } 58 59 public void setNamingProviderUrl(String namingProviderUrl) { 60 System.setProperty(JAVA_NAMING_PROVIDER_URL, namingProviderUrl); 61 } 62 63 public static final GBeanInfo gbeanInfo; 64 65 static { 66 GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(NamingProperties.class); 67 infoFactory.addAttribute("namingFactoryInitial", String .class, true); 68 infoFactory.addAttribute("namingFactoryUrlPkgs", String .class, true); 69 infoFactory.addAttribute("namingProviderUrl", String .class, true, true); 70 71 infoFactory.setConstructor(new String [] {"namingFactoryInitial", "namingFactoryUrlPkgs", "namingProviderUrl"}); 72 73 gbeanInfo = infoFactory.getBeanInfo(); 74 } 75 76 public static GBeanInfo getGBeanInfo() { 77 return gbeanInfo; 78 } 79 } 80 | Popular Tags |