/** * Record a 'visit' to a DSpace object and enforce any policies set * on this curator. * * @param dso the DSpace object * @throws IOException A general class of exceptions produced by failed or interrupted I/O operations. */ protected void visit(DSpaceObject dso) throws IOException { Context curCtx = curationCtx.get(); if (curCtx != null) { if (txScope.equals(TxScope.OBJECT)) { curCtx.dispatchEvents(); } } }
/** * Adds a thread to the ready stack. Can also be called externally to queue up a collection * for harvesting before it is "due" for another cycle. This allows starting a harvest process * from the UI that still "plays nice" with these thread mechanics instead of making an * asynchronous call to runHarvest(). * * @param context The relevant DSpace Context. * @param harvestedCollection collection to be harvested * @throws IOException A general class of exceptions produced by failed or interrupted I/O operations. * @throws SQLException An exception that provides information on a database access error or other errors. * @throws AuthorizeException Exception indicating the current user of the context does not have permission * to perform a particular action. */ public void addThread(Context context, HarvestedCollection harvestedCollection) throws SQLException, IOException, AuthorizeException { log.debug("****** Entered the addThread method. Active threads: " + harvestThreads.toString()); context.setCurrentUser(harvestAdmin); harvestedCollection.setHarvestStatus(HarvestedCollection.STATUS_QUEUED); harvestedCollectionService.update(context, harvestedCollection); context.dispatchEvents(); HarvestThread ht = new HarvestThread(harvestedCollection.getCollection().getID()); harvestThreads.push(ht); log.debug("****** Queued up a thread. Active threads: " + harvestThreads.toString()); log.info("Thread queued up: " + ht.toString()); }
context.dispatchEvents();
context.dispatchEvents(); context.restoreAuthSystemState();
context.dispatchEvents(); i = 0; context.dispatchEvents(); } catch (Exception e) { System.out.println("Changes could not be committed");
context.dispatchEvents();
eperson.setNetid(netid.toLowerCase()); ePersonService.update(context, eperson); context.dispatchEvents(); context.restoreAuthSystemState(); context.setCurrentUser(eperson); authenticationService.initEPerson(context, request, eperson); ePersonService.update(context, eperson); context.dispatchEvents(); context.setCurrentUser(eperson);
ourContext.dispatchEvents(); ourContext.dispatchEvents(); intermediateCommit();
context.dispatchEvents();
eperson); ePersonService.update(context, eperson); context.dispatchEvents(); context.restoreAuthSystemState(); context.setCurrentUser(eperson);