/** * PUBLIC: Given the file name or URL of a topic map, returns a * topic map reader of the right class. Uses the file extension to * determine what reader to create. Supports '.xtm', and '.ltm'. */ public static TopicMapReaderIF getReader (String filename_or_url) { try { return getReader(StreamUtils.getResource(filename_or_url)); } catch (IOException ioe) { throw new OntopiaRuntimeException(ioe); } }
URL url = (clusterProps != null ? StreamUtils.getResource(clusterProps) : null); if (url == null) { if (clusterProps == null) {
public synchronized void joinCluster() { try { System.out.println("Joining cluster: '" + clusterId + "'"); try { URL url = (clusterProps != null ? StreamUtils.getResource(clusterProps) : null); if (url == null) { if (clusterProps == null) { log.debug("Using default cluster properties."); this.channel = new JChannel(); } else { log.debug("Using cluster properties as given: '" + clusterProps + "'"); this.channel = new JChannel(clusterProps); } } else { log.debug("Using cluster properties in: '" + url + "'"); this.channel = new JChannel(url); } } catch (Exception e) { throw new OntopiaRuntimeException("Problems occurred while loading JGroups properties from " + clusterProps, e); } this.channel.setReceiver(this); this.channel.connect(clusterId); } catch (Exception e) { throw new OntopiaRuntimeException("Could not connect to cluster '" + clusterId + "'.", e); } }