/** * This method returns the list URL of the naming service url * * @return Array of naming service url. * @throws Exception - * if there is no configured urls or any problem in getting urls */ public static function getNamingServiceURL() { if (WebtopNaming::$namingServiceURL == null) { // Initilaize the list of naming URLs $urlList = array(); // Check for naming service URL in system propertied // $systemNamingURL = SystemProperties::get(Constants::AM_NAMING_URL); // if ($systemNamingURL != null) // $urlList[] = $systemNamingURL; // Get the naming service URLs from properties files $configURLListString = SystemProperties::get(Constants::AM_NAMING_URL); if ($configURLListString != null) { $stok = explode(" ", $configURLListString); foreach ($stok as $nextURL) { if (array_key_exists($nextURL, $urlList)) { // if (debug.warningEnabled()) { // debug.warning("Duplicate naming service URL " + // "specified "+ nextURL + ", will be ignored."); // } } else { $urlList[] = $nextURL; } } if (count($urlList) == 0) { throw new Exception("No NamingService URL"); } // else { // if (debug . messageEnabled()) { // debug . message("Naming service URL list: " + urlList); // } } WebtopNaming::$namingServiceURL = $urlList; // Start naming service monitor if more than 1 naming URLs are found // if (!isServerMode() && (urlList . size() > 1)) { // Thread monitorThread = new Thread(new SiteMonitor()); // monitorThread . setDaemon(true); // monitorThread . setPriority(Thread . MIN_PRIORITY); // monitorThread . start(); // } else { // if (debug . messageEnabled()) { // debug . message("Only one naming service URL specified." + " NamingServiceMonitor will be disabled."); // } // } } return WebtopNaming::$namingServiceURL; }