private boolean selectCommitMethod(Object obj,int reservID,int src,int tag)
    {
        boolean flag = true;
        try
        {
            // A case where a reservation only has 1 Gridlet
            Gridlet gridlet = (Gridlet) obj;
            if (checkGridlet(gridlet))
            {
                ( (ARPolicy) policy_).handleCommitReservation(reservID, src,
                        tag, gridlet);
            }
            else {
                flag = false;
            }
        }
        catch (ClassCastException c)
        {
            try
            {
                // A case where a reservation contains 1 or more Gridlets
                GridletList list = (GridletList) obj;
                Gridlet gl = null;

                // For each Gridlet in the list, check whether it has finished
                // before or not
                for (int i = 0; i < list.size(); i++)
                {
                    gl = (Gridlet) list.get(i);
                    if (!checkGridlet(gl))
                    {
                        flag = false;
                        break;
                    }
                }

                if (flag)
                {
                    ( (ARPolicy) policy_).handleCommitReservation(reservID, src,
                        tag, list);
                }
            }
            catch (ClassCastException again) {
                flag = false;
            }
        }
        catch (Exception e) {
            flag = false;
        }

        return flag;
    }