public synchronized void gridletPause(int gridletId, int userId, boolean ack)
    {
        boolean status = false;

        // find this Gridlet in the execution list
        int found = gridletInExecList_.indexOf(gridletId, userId);
        if (found >= 0)
        {
            // update Gridlets in execution list up to this point in time
            updateGridletProcessing();

            // get a Gridlet from execution list
            ResGridlet rgl = (ResGridlet) gridletInExecList_.remove(found);

            // if a Gridlet is finished upon pausing, then set it to success
            // instead.
            if (rgl.getRemainingGridletLength() == 0.0)
            {
                System.out.println(super.resName_
                        + ".TimeSharedWithFailure.gridletPause(): Cannot pause"
                        + " Gridlet #" + gridletId + " for User #" + userId
                        + " since it is FINISHED.");

                gridletFinish(rgl, Gridlet.SUCCESS);
            }
            else
            {
                status = true;
                rgl.setGridletStatus(Gridlet.PAUSED);

                // add the Gridlet into the paused list
                gridletPausedList_.add(rgl);
                System.out.println(super.resName_ +
                ".TimeSharedWithFailure.gridletPause(): Gridlet #" + gridletId +
                " with User #" + userId + " has been sucessfully PAUSED.");
            }

            // forecast all Gridlets in the execution list
            forecastGridlet();
        }
        else   // if not found in the execution list
        {
            System.out.println(super.resName_ +
                    ".TimeSharedWithFailure.gridletPause(): Cannot find " +
                    "Gridlet #" + gridletId + " for User #" + userId);
        }

        // sends back an ack
        if (ack)
        {
            super.sendAck(GridSimTags.GRIDLET_PAUSE_ACK, status,
                          gridletId, userId);
        }
    }