protected int findGridlet(Collection obj, int gridletId, int userId)
    {
        ResGridlet rgl = null;
        int found = -1;     // means the Gridlet is not in the list

        try
        {
            // Search through the list to find the given Gridlet object
            int i = 0;
            Iterator iter = obj.iterator();
            while ( iter.hasNext() )
            {
                rgl = (ResGridlet) iter.next();

                // Need to check against the userId as well since
                // each user might have same Gridlet id submitted to
                // same GridResource
                if (rgl.getGridletID()==gridletId && rgl.getUserID()==userId)
                {
                    found = i;
                    break;
                }

                i++;
            }
        }
        catch (Exception e)
        {
            System.out.println(super.get_name() +
                               ".findGridlet(): Exception error occurs.");
            System.out.println( e.getMessage() );
        }

        return found;
    }