juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svi...@apache.org
Subject cvs commit: ws-juddi/src/java/org/apache/juddi/proxy RegistryProxy.java
Date Mon, 22 Mar 2004 19:25:39 GMT
sviens      2004/03/22 11:25:39

  Modified:    src/java/org/apache/juddi/proxy RegistryProxy.java
  Log:
  Default RegistryProxy constructor loads properties from juddi.properties file (must be in
the classpath).
  
  Revision  Changes    Path
  1.5       +17 -2     ws-juddi/src/java/org/apache/juddi/proxy/RegistryProxy.java
  
  Index: RegistryProxy.java
  ===================================================================
  RCS file: /home/cvs/ws-juddi/src/java/org/apache/juddi/proxy/RegistryProxy.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RegistryProxy.java	16 Mar 2004 20:15:17 -0000	1.4
  +++ RegistryProxy.java	22 Mar 2004 19:25:38 -0000	1.5
  @@ -15,6 +15,8 @@
    */
   package org.apache.juddi.proxy;
   
  +import java.io.IOException;
  +import java.io.InputStream;
   import java.net.MalformedURLException;
   import java.net.URL;
   import java.util.Properties;
  @@ -33,6 +35,7 @@
   import org.apache.juddi.registry.IRegistry;
   import org.apache.juddi.transport.Transport;
   import org.apache.juddi.transport.TransportFactory;
  +import org.apache.juddi.util.Loader;
   import org.apache.juddi.util.xml.XMLUtils;
   
   import org.w3c.dom.Document;
  @@ -52,6 +55,9 @@
     // jUDDI SOAP Transport
     private static Transport transport = TransportFactory.getTransport();
     
  +  // jUDDI Proxy Property File Name
  +  private static final String PROPFILE_NAME = "juddi.properties";
  +  
     // Default Properties
     private static final String DEFAULT_INQUIRY_ENDPOINT = "http://localhost/juddi/inquiry";
     private static final String DEFAULT_PUBLISH_ENDPOINT = "http://localhost/juddi/publish";
  @@ -82,8 +88,17 @@
       // attempt to load proxy properties from
       // the juddi.properties file which should
       // be located in the classpath. 
  -    Properties props = null;
  -    
  +    Properties props = new Properties();
  +
  +    try {
  +      InputStream stream = Loader.getResourceAsStream(PROPFILE_NAME);
  +      if (stream != null)
  +        props.load(stream);
  +    }
  +    catch (IOException ioex) {
  +    	ioex.printStackTrace();
  +    }
  +
       this.init(props);
     }
   
  
  
  

Mime
View raw message