axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ow...@apache.org
Subject cvs commit: xml-axis-wsif/java/src/org/apache/wsif/base WSIFServiceFactoryImpl.java
Date Fri, 09 Aug 2002 09:21:48 GMT
owenb       2002/08/09 02:21:48

  Modified:    java/src/org/apache/wsif/base WSIFServiceFactoryImpl.java
  Log:
  Fixes to generation of keys for caching
  
  Revision  Changes    Path
  1.6       +29 -22    xml-axis-wsif/java/src/org/apache/wsif/base/WSIFServiceFactoryImpl.java
  
  Index: WSIFServiceFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/base/WSIFServiceFactoryImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WSIFServiceFactoryImpl.java	8 Aug 2002 15:38:40 -0000	1.5
  +++ WSIFServiceFactoryImpl.java	9 Aug 2002 09:21:48 -0000	1.6
  @@ -76,7 +76,7 @@
    * @author Mark Whitlock
    * @author Owen Burroughs <owenb@apache.org>
    */
  -public class WSIFServiceFactoryImpl extends WSIFServiceFactory{
  +public class WSIFServiceFactoryImpl extends WSIFServiceFactory {
   
       private boolean useCache = false;
       private Map cache = new HashMap();
  @@ -103,7 +103,7 @@
           String serviceName,
           String portTypeNS,
           String portTypeName)
  -            throws WSIFException {
  +        throws WSIFException {
           Trc.entry(
               this,
               wsdlLoc,
  @@ -124,7 +124,7 @@
               WSIFServiceImpl cachedWSI = (WSIFServiceImpl) cache.get(key);
               if (cachedWSI != null) {
                   WSIFServiceImpl wsi = new WSIFServiceImpl(cachedWSI);
  -                Trc.exit(wsi);                
  +                Trc.exit(wsi);
                   return wsi;
               }
           }
  @@ -170,7 +170,7 @@
           String serviceName,
           String portTypeNS,
           String portTypeName)
  -            throws WSIFException {
  +        throws WSIFException {
           Trc.entry(
               this,
               wsdlLoc,
  @@ -192,7 +192,7 @@
               WSIFServiceImpl cachedWSI = (WSIFServiceImpl) cache.get(key);
               if (cachedWSI != null) {
                   WSIFServiceImpl wsi = new WSIFServiceImpl(cachedWSI);
  -                Trc.exit(wsi);                
  +                Trc.exit(wsi);
                   return wsi;
               }
           }
  @@ -228,7 +228,7 @@
               WSIFServiceImpl cachedWSI = (WSIFServiceImpl) cache.get(key);
               if (cachedWSI != null) {
                   WSIFServiceImpl wsi = new WSIFServiceImpl(cachedWSI);
  -                Trc.exit(wsi);                
  +                Trc.exit(wsi);
                   return wsi;
               }
           }
  @@ -250,7 +250,7 @@
        * @exception A WSIFException if an error occurs when creating the service
        */
       public WSIFService getService(Definition def, Service service)
  -            throws WSIFException {
  +        throws WSIFException {
           Trc.entry(this, def, service);
           String key = "";
           if (useCache) {
  @@ -258,7 +258,7 @@
               WSIFServiceImpl cachedWSI = (WSIFServiceImpl) cache.get(key);
               if (cachedWSI != null) {
                   WSIFServiceImpl wsi = new WSIFServiceImpl(cachedWSI);
  -                Trc.exit(wsi);                
  +                Trc.exit(wsi);
                   return wsi;
               }
           }
  @@ -283,7 +283,7 @@
           Definition def,
           Service service,
           PortType portType)
  -            throws WSIFException {
  +        throws WSIFException {
           Trc.entry(this, def, service, portType);
           String key = "";
           if (useCache) {
  @@ -291,7 +291,7 @@
               WSIFServiceImpl cachedWSI = (WSIFServiceImpl) cache.get(key);
               if (cachedWSI != null) {
                   WSIFServiceImpl wsi = new WSIFServiceImpl(cachedWSI);
  -                Trc.exit(wsi);                
  +                Trc.exit(wsi);
                   return wsi;
               }
           }
  @@ -321,7 +321,7 @@
           String serviceName,
           String portTypeNS,
           String portTypeName)
  -            throws WSIFException {
  +        throws WSIFException {
           Trc.entry(this, def, serviceNS, serviceName, portTypeNS, portTypeName);
           String key = "";
           if (useCache) {
  @@ -335,7 +335,7 @@
               WSIFServiceImpl cachedWSI = (WSIFServiceImpl) cache.get(key);
               if (cachedWSI != null) {
                   WSIFServiceImpl wsi = new WSIFServiceImpl(cachedWSI);
  -                Trc.exit(wsi);                
  +                Trc.exit(wsi);
                   return wsi;
               }
           }
  @@ -372,10 +372,12 @@
           PortType portType) {
   
           String db =
  -            (def.getDocumentBaseURI() == null) ? def.getDocumentBaseURI() : "null";
  -        QName serviceName = (def != null) ? service.getQName() : null;
  +            (def != null && def.getDocumentBaseURI() != null)
  +                ? def.getDocumentBaseURI()
  +                : "null";
  +        QName serviceName = (service != null) ? service.getQName() : null;
           String sn = (serviceName != null) ? serviceName.toString() : "null";
  -        QName portTypeName = (def != null) ? portType.getQName() : null;
  +        QName portTypeName = (portType != null) ? portType.getQName() : null;
           String ptn = (portTypeName != null) ? portTypeName.toString() : "null";
           StringBuffer key = new StringBuffer();
           key.append("D=");
  @@ -387,7 +389,8 @@
   
           String ret = key.toString();
           // If no distinguishable information is available then don't add to cache
  -        if (ret.equals("D=nullS=nullP=null")) return "";        
  +        if (ret.equals("D=nullS=nullP=null"))
  +            return "";
           return ret;
       }
   
  @@ -419,10 +422,11 @@
           key.append(portTypeNS);
           key.append("PS=");
           key.append(portTypeName);
  -        
  +
           String ret = key.toString();
           // If no distinguishable information is available then don't add to cache
  -        if (ret.equals("W=SN=SS=PN=PS=")) return "";         
  +        if (ret.equals("W=SN=SS=PN=PS="))
  +            return "";
           return ret;
       }
   
  @@ -435,7 +439,9 @@
   
           StringBuffer key = new StringBuffer();
           String db =
  -            (def.getDocumentBaseURI() == null) ? def.getDocumentBaseURI() : "null";
  +            (def != null && def.getDocumentBaseURI() != null)
  +                ? def.getDocumentBaseURI()
  +                : "null";
           if (serviceNS == null)
               serviceNS = "";
           if (serviceName == null)
  @@ -454,10 +460,11 @@
           key.append(portTypeNS);
           key.append("PS=");
           key.append(portTypeName);
  -        
  +
           String ret = key.toString();
           // If no distinguishable information is available then don't add to cache
  -        if (ret.equals("D=nullSN=SS=PN=PS=")) return "";
  +        if (ret.equals("D=nullSN=SS=PN=PS="))
  +            return "";
           return ret;
  -    }    
  +    }
   }
  
  
  

Mime
View raw message