1 9 package org.jboss.portal.server.impl.config; 10 11 import org.jboss.portal.server.config.Configuration; 12 import org.apache.log4j.Logger; 13 14 import java.io.InputStream ; 15 16 25 public class ConfigurationImpl implements Configuration 26 { 27 28 29 private Logger log = Logger.getLogger(ConfigurationImpl.class); 30 31 32 private ClassLoader loader = null; 33 34 35 private String base; 36 37 38 private int nonSecurePort; 39 40 41 private int securePort; 42 43 46 public int getNonSecurePort() 47 { 48 return nonSecurePort; 49 } 50 51 54 public void setNonSecurePort(int nonSecurePort) 55 { 56 this.nonSecurePort = nonSecurePort; 57 } 58 59 62 public int getSecurePort() 63 { 64 return securePort; 65 } 66 67 70 public void setSecurePort(int securePort) 71 { 72 this.securePort = securePort; 73 } 74 75 78 public String getBase() 79 { 80 return base; 81 } 82 83 86 public void setBase(String base) 87 { 88 this.base = base; 89 } 90 91 97 public InputStream load(String name) 98 { 99 if (loader == null) 100 { 101 loader = ConfigurationImpl.class.getClassLoader(); 102 log.debug("Initialized configuration class loader " + loader); 103 } 104 InputStream in = loader.getResourceAsStream(base.length() == 0 ? name.substring(1) : base + name); 105 log.debug("Loaded config resource for name = " + name + " the result is " + in); 106 return in; 107 } 108 } 109 | Popular Tags |