1 57 58 package org.apache.commons.discovery.resource.names; 59 60 import org.apache.commons.discovery.ResourceNameDiscover; 61 import org.apache.commons.discovery.ResourceNameListener; 62 import org.apache.commons.discovery.log.DiscoveryLogFactory; 63 import org.apache.commons.logging.Log; 64 65 66 71 public class DiscoverNamesInSystemProperties extends ResourceNameDiscoverImpl 72 implements ResourceNameDiscover, ResourceNameListener 73 { 74 private static Log log = DiscoveryLogFactory.newLog(DiscoverNamesInSystemProperties.class); 75 public static void setLog(Log _log) { 76 log = _log; 77 } 78 79 81 public DiscoverNamesInSystemProperties() { 82 super(); 83 } 84 85 88 public boolean find(String resourceName) { 89 if (log.isDebugEnabled()) 90 log.debug("find: resourceName='" + resourceName + "'"); 91 92 return notifyListener(System.getProperty(resourceName)); 93 } 94 95 public boolean found(String resourceName) { 96 return find(resourceName); 97 } 98 } 99 | Popular Tags |