private void processAddReplica(Sim_event ev) {
        if (ev == null) {
            return;
        }

        Object[] data = (Object[]) ev.get_data();
        if (data == null) {
            return;
        }

        File file = (File) data[0]; // get file
        file.setMasterCopy(false); // set file as a replica
        int req_source = ((Integer) data[1]).intValue(); // get sender id

        int msg = addFile(file); // add file
        if (msg == DataGridTags.FILE_ADD_SUCCESSFUL) {
            registerFile(file); // register file to RC
            data[0] = file.getName();
            filesWaitingForAddACK_.add(data);
        } else { // if an error occured, the notify the sender
            sendResult(file.getName(), DataGridTags.FILE_ADD_REPLICA_RESULT,
                    msg, req_source);
        }
    }