private void handleCommitReservation(Sim_event ev)
    {
        int src = -1;   // the sender id
        boolean success = false;
        int tag = -1;

        try
        {
            // [0]=reservID, [1]=gridlet(s), [2]=transID, [3]=senderID
            Object[] obj = ( Object[] ) ev.get_data();

            // get the data inside an array
            int reservationID = ( (Integer) obj[0] ).intValue();
            int transactionID = ( (Integer) obj[2] ).intValue();
            src = ( (Integer) obj[3] ).intValue();

            int returnTag = GridSimTags.RETURN_AR_COMMIT;
            tag = returnTag + transactionID;

            // check whether this resource can support AR or not
            success = checkResourceType(src, returnTag, transactionID,
                            GridSimTags.AR_COMMIT_ERROR_RESOURCE_CANT_SUPPORT,
                            "can't commit a reservation");

            // if a resource doesn't support AR then exit straightaway
            if (!success) {
                return;
            }

            // check again whether obj[1] contains either Gridlet or GridletList
            success = selectCommitMethod(obj[1], reservationID, src, tag);
        }
        catch (ClassCastException c) {
            success = false;
            c.printStackTrace();
        }
        catch (Exception e) {
            success = false;
        }

        // if there is an exception or other errors, then send back an error msg
        if (!success && tag != -1)
        {
            System.out.println(super.get_name() + " : Error - can't commit a"+
                " reservation.");

            super.send(src, 0.0, GridSimTags.RETURN_AR_COMMIT,
                new IO_data(new Integer(GridSimTags.AR_COMMIT_ERROR),SIZE,src));
        }
    }