mpoeschl    02/03/06 07:14:10

  Modified:    src/java/org/apache/torque/om AbstractBaseManager.java
  Log:
  fix javadoc warnings
  replace collabnet lic with apache lic
  
  Revision  Changes    Path
  1.3       +96 -88    
jakarta-turbine-torque/src/java/org/apache/torque/om/AbstractBaseManager.java
  
  Index: AbstractBaseManager.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/om/AbstractBaseManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractBaseManager.java  6 Mar 2002 03:48:15 -0000       1.2
  +++ AbstractBaseManager.java  6 Mar 2002 15:14:10 -0000       1.3
  @@ -1,50 +1,58 @@
   package org.apache.torque.om;
   
  -/* ================================================================
  - * Copyright (c) 2001 Collab.Net.  All rights reserved.
  - * 
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
  + * reserved.
  + *
    * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions are
  - * met:
  - * 
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
    * 1. Redistributions of source code must retain the above copyright
  - * notice, this list of conditions and the following disclaimer.
  - * 
  + *    notice, this list of conditions and the following disclaimer.
  + *
    * 2. Redistributions in binary form must reproduce the above copyright
  - * notice, this list of conditions and the following disclaimer in the
  - * documentation and/or other materials provided with the distribution.
  - * 
  - * 3. The end-user documentation included with the redistribution, if
  - * any, must include the following acknowlegement: "This product includes
  - * software developed by Collab.Net <http://www.Collab.Net/>."
  - * Alternately, this acknowlegement may appear in the software itself, if
  - * and wherever such third-party acknowlegements normally appear.
  - * 
  - * 4. The hosted project names must not be used to endorse or promote
  - * products derived from this software without prior written
  - * permission. For written permission, please contact [EMAIL PROTECTED]
  - * 
  - * 5. Products derived from this software may not use the "Tigris" or 
  - * "Scarab" names nor may "Tigris" or "Scarab" appear in their names without 
  - * prior written permission of Collab.Net.
  - * 
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  - * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
  - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
    *
  + * 4. The names "Apache" and "Apache Software Foundation" and
  + *    "Apache Turbine" must not be used to endorse or promote products
  + *    derived from this software without prior written permission. For
  + *    written permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    "Apache Turbine", nor may "Apache" appear in their name, without
  + *    prior written permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
    * ====================================================================
  - * 
  + *
    * This software consists of voluntary contributions made by many
  - * individuals on behalf of Collab.Net.
  - */ 
  + * individuals on behalf of the Apache Software Foundation.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
   
   import java.util.Arrays;
   import java.util.List;
  @@ -60,15 +68,15 @@
   import org.apache.log4j.Category;
   
   /**
  - * This class contains common functionality of a Manager for 
  + * This class contains common functionality of a Manager for
    * instantiating OM's.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>John McNally</a>
  - * @version $Id: AbstractBaseManager.java,v 1.2 2002/03/06 03:48:15 jmcnally Exp $
  + * @version $Id: AbstractBaseManager.java,v 1.3 2002/03/06 15:14:10 mpoeschl Exp $
    */
  -public abstract class AbstractBaseManager 
  +public abstract class AbstractBaseManager
   {
  -    protected static final Category category = 
  +    protected static final Category category =
           Category.getInstance(AbstractBaseManager.class.getName());
   
       /** used to cache the om objects */
  @@ -116,12 +124,12 @@
       {
           return className;
       }
  -    
  +
       /**
        * Set the classname to instantiate for getInstance()
        * @param v  Value to assign to className.
        */
  -    public void setClassName(String  v) 
  +    public void setClassName(String  v)
           throws TorqueException
       {
           this.className = v;
  @@ -135,12 +143,12 @@
               throw new TorqueException("Could not load "+getClassName());
           }
       }
  -    
  +
   
       /**
        * Return an instance of an om based on the id
        */
  -    protected Persistent getOMInstance(ObjectKey id) 
  +    protected Persistent getOMInstance(ObjectKey id)
           throws TorqueException
       {
           return getOMInstance(id, true);
  @@ -149,7 +157,7 @@
       /**
        * Return an instance of an om based on the id
        */
  -    protected Persistent getOMInstance(ObjectKey id, boolean fromCache) 
  +    protected Persistent getOMInstance(ObjectKey id, boolean fromCache)
           throws TorqueException
       {
           String key = id.toString();
  @@ -162,31 +170,31 @@
           if (om == null)
           {
               om = retrieveStoredOM(id);
  -            if (fromCache) 
  +            if (fromCache)
               {
                   putInstanceImpl(om);
               }
           }
  -        
  +
           return om;
       }
   
       private Persistent cacheGet(String key)
       {
           Persistent om = null;
  -        if (cache != null) 
  +        if (cache != null)
           {
  -            if (lockCache) 
  +            if (lockCache)
               {
                   synchronized (this)
                   {
                       om = (Persistent)cache.get(key);
                   }
               }
  -            else 
  -            {    
  +            else
  +            {
                   om = (Persistent)cache.get(key);
  -            }   
  +            }
           }
           return om;
       }
  @@ -194,7 +202,7 @@
       protected void clearImpl()
           throws TorqueException
       {
  -        if (cache != null) 
  +        if (cache != null)
           {
               try
               {
  @@ -211,14 +219,14 @@
       protected void putInstanceImpl(Persistent om)
           throws TorqueException
       {
  -        if (getOMClass() != null && !getOMClass().isInstance(om)) 
  +        if (getOMClass() != null && !getOMClass().isInstance(om))
           {
               throw new TorqueException(om + "; class=" + om.getClass().getName()
  -                + "; id=" + om.getPrimaryKey() + " cannot be cached with " + 
  -                getOMClass().getName() + " objects");   
  +                + "; id=" + om.getPrimaryKey() + " cannot be cached with " +
  +                getOMClass().getName() + " objects");
           }
  -        
  -        if (cache != null) 
  +
  +        if (cache != null)
           {
               synchronized (this)
               {
  @@ -249,9 +257,9 @@
        *
        * @param ids a <code>ObjectKey[]</code> value
        * @return a <code>List</code> value
  -     * @exception Exception if an error occurs
  +     * @exception TorqueException if an error occurs
        */
  -    protected List getOMs(ObjectKey[] ids) 
  +    protected List getOMs(ObjectKey[] ids)
           throws TorqueException
       {
           return getOMs(Arrays.asList(ids));
  @@ -262,9 +270,9 @@
        *
        * @param ids a <code>List</code> of <code>ObjectKey</code>'s
        * @return a <code>List</code> value
  -     * @exception Exception if an error occurs
  +     * @exception TorqueException if an error occurs
        */
  -    protected List getOMs(List ids) 
  +    protected List getOMs(List ids)
           throws TorqueException
       {
           return getOMs(ids, true);
  @@ -275,25 +283,25 @@
        *
        * @param ids a <code>List</code> of <code>ObjectKey</code>'s
        * @return a <code>List</code> value
  -     * @exception Exception if an error occurs
  +     * @exception TorqueException if an error occurs
        */
  -    protected List getOMs(List ids, boolean fromCache) 
  +    protected List getOMs(List ids, boolean fromCache)
           throws TorqueException
       {
           List oms = null;
  -        if ( ids != null && ids.size() > 0 ) 
  +        if ( ids != null && ids.size() > 0 )
           {
               // start a new list where we will replace the id's with om's
               oms = new ArrayList(ids);
               List newIds = new ArrayList(ids.size());
  -            for ( int i=0; i<ids.size(); i++ ) 
  +            for ( int i=0; i<ids.size(); i++ )
               {
                   ObjectKey id = (ObjectKey)ids.get(i);
                   String key = id.toString();
                   Persistent om = null;
  -                if (fromCache) 
  +                if (fromCache)
                   {
  -                    om = cacheGet(key);                    
  +                    om = cacheGet(key);
                   }
                   if (om == null)
                   {
  @@ -301,27 +309,27 @@
                   }
                   else
                   {
  -                    oms.set(i, om); 
  +                    oms.set(i, om);
                   }
               }
  -            
  -            if ( newIds.size() > 0 ) 
  +
  +            if ( newIds.size() > 0 )
               {
                   List newOms = retrieveStoredOMs(newIds);
  -                for ( int i=0; i<oms.size(); i++ ) 
  +                for ( int i=0; i<oms.size(); i++ )
                   {
  -                    if ( oms.get(i) instanceof ObjectKey ) 
  +                    if ( oms.get(i) instanceof ObjectKey )
                       {
  -                        for ( int j=newOms.size(); j>=0; j-- ) 
  +                        for ( int j=newOms.size(); j>=0; j-- )
                           {
                               Persistent om = (Persistent)newOms.get(j);
  -                            if ( om.getPrimaryKey().equals(oms.get(i)) ) 
  +                            if ( om.getPrimaryKey().equals(oms.get(i)) )
                               {
                                   // replace the id with the om and add the om
                                   // to the cache
                                   oms.set(i, om);
                                   newOms.remove(j);
  -                                if (fromCache) 
  +                                if (fromCache)
                                   {
                                       putInstanceImpl(om);
                                   }
  @@ -329,7 +337,7 @@
                               }
                           }
                       }
  -                }                
  +                }
               }
           }
           return oms;
  @@ -342,31 +350,31 @@
        * Get the value of region.
        * @return value of region.
        */
  -    public String getRegion() 
  +    public String getRegion()
       {
           return region;
       }
  -    
  +
       /**
        * Set the value of region.
        * @param v  Value to assign to region.
        */
  -    public void setRegion(String  v) 
  +    public void setRegion(String  v)
           throws TorqueException
       {
           this.region = v;
  -        try 
  +        try
           {
               cache = JCS.getInstance(getRegion());
  -        } 
  -        catch (Exception e) 
  +        }
  +        catch (Exception e)
           {
               throw new TorqueException(
                   "Cache could not be initialized", e);
           }
  -        if (cache == null) 
  +        if (cache == null)
           {
               category.info("Cache was not be initialized for region: " + v);
  -        }        
  +        }
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to