public Object removeResource(Object obj) throws StorageException, CommunicationException { try { testStorage(); return storage.removeResource(obj); } // try catch (CommunicationException error) { writeLog("Erro de comunicacao: " + error.getMessage()); for (int counter = 0; counter < getTryNumber(); counter++) { try { sleep(); createStorage(); return storage.removeResource(obj); } // try catch (CommunicationException error1) { writeLog("Erro de comunicacao: " + error.getMessage()); } // catch } // for throw error; } // catch }