portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/capability/src/java/org/apache/jetspeed/capabilities/impl JetspeedCapabilities.java
Date Tue, 04 Jan 2005 15:52:02 GMT
weaver      2005/01/04 07:52:02

  Modified:    components/capability/src/java/org/apache/jetspeed/capabilities/impl
                        JetspeedCapabilities.java
  Log:
  Throw exception if capabilitied could not be nuilt instead of returning null.
  
  Revision  Changes    Path
  1.3       +14 -4     jakarta-jetspeed-2/components/capability/src/java/org/apache/jetspeed/capabilities/impl/JetspeedCapabilities.java
  
  Index: JetspeedCapabilities.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/capability/src/java/org/apache/jetspeed/capabilities/impl/JetspeedCapabilities.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JetspeedCapabilities.java	7 Nov 2004 18:44:44 -0000	1.2
  +++ JetspeedCapabilities.java	4 Jan 2005 15:52:02 -0000	1.3
  @@ -29,6 +29,7 @@
   import org.apache.jetspeed.capabilities.Client;
   import org.apache.jetspeed.capabilities.MediaType;
   import org.apache.jetspeed.capabilities.MimeType;
  +import org.apache.jetspeed.capabilities.UnableToBuildCapabilityMapException;
   import org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport;
   import org.apache.ojb.broker.query.Criteria;
   import org.apache.ojb.broker.query.QueryByCriteria;
  @@ -118,9 +119,10 @@
   
       /**
        * @param userAgent Agent from the request
  +     * @throws UnableToBuildCapabilityMapException
        * @see org.apache.jetspeed.services.capability.CapabilityService#getCapabilityMap(java.lang.String)
        */
  -    public CapabilityMap getCapabilityMap(String userAgent)
  +    public CapabilityMap getCapabilityMap(String userAgent) throws UnableToBuildCapabilityMapException
       {        
           CapabilityMap map = null;
           boolean bClientFound = false;
  @@ -211,8 +213,16 @@
               }
   
           }
  -
  -        return map;
  +        
  +        if(map != null)
  +        {
  +               return map;
  +        }
  +        else
  +        {
  +            throw new UnableToBuildCapabilityMapException("We were unable to build a capability
map for the agent, "+userAgent+
  +                                ".  This might be an indiciation that the capability database
has not been correctly initialized.");
  +        }
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message