private final EventControl getEventControl() { EventControl evnCtrl = thrLocal.get(); if (evnCtrl == null) { thrLocal.set(evnCtrl = new EventControl()); } return evnCtrl; }
/** * Begin of block, that should be performed without firing events. * Firing of events is postponed after end of block . * There is strong necessity to use always both methods: beginAtomicAction * and finishAtomicAction. It is recomended use it in try - finally block. * @param run Events fired from this atomic action will be marked as events * that were fired from this run. */ void beginAtomicAction(FileSystem.AtomicAction run) { getEventControl().beginAtomicAction(run); }
/** * Inside atomicAction adds an event dispatcher to the queue of FS events * and firing of events is postponed. If not event handlers are called directly. * @param run dispatcher to run */ void dispatchEvent(EventDispatcher run) { getEventControl().dispatchEvent(run); }
/** Executes atomic action. The atomic action represents a set of * operations constituting one logical unit. It is guaranteed that during * execution of such an action no events about changes in the filesystem * will be fired.*/ void runAtomicAction(final FileSystem.AtomicAction run) throws IOException { try { enterAtomicAction(run, false); run.run(); } finally { exitAtomicAction(false); } }
reqQueueCopy = getRequestsQueue(); setRequestsQueue(null); priorityRequests = 0; } else { setRequestsQueue(new LinkedList<FileSystem.EventDispatcher>()); invokeDispatchers(false, reqQueueCopy); LinkedList<FileSystem.EventDispatcher> newReqQueue = invokeDispatchers(true, reqQueueCopy); while ((getRequestsQueue() != null) && !getRequestsQueue().isEmpty()) { FileSystem.EventDispatcher r = getRequestsQueue().removeFirst(); newReqQueue.add(r); setRequestsQueue(newReqQueue);
/** * End of block, that should be performed without firing events. * Firing of events is postponed after end of block . * There is strong necessity to use always both methods: beginAtomicAction * and finishAtomicAction. It is recomended use it in try - finally block. */ void finishAtomicAction() { getEventControl().finishAtomicAction(); }
/** * Method that can fire events directly, postpone them, fire them in * standalone thread or in RequestProcessor */ void dispatchEvent(FileSystem.EventDispatcher dispatcher) { if (postponeFiring(dispatcher)) { return; } dispatcher.run(); }
/** * End of priority atomic actions. Atomic actions from inside of org.openide.FileSystems * are considered as priority atomic actions. From last priority atomic actions * are fired events regardless if nested in any normal atomic action. * * End of block, that should be performed without firing events. * Firing of events is postponed after end of block . * There is strong necessity to use always both methods: beginAtomicAction * and finishAtomicAction. It is recommended use it in try - finally block. * @see FileSystemt#finishAtomicAction */ void finishAtomicAction() { exitAtomicAction(true); }
/** * Begin of priority atomic actions. Atomic actions from inside of org.openide.FileSystems * are considered as priority atomic actions. From last priority atomic actions * are fired events regardless if nested in any normal atomic action. * * Begin of block, that should be performed without firing events. * Firing of events is postponed after end of block . * There is strong necessity to use always both methods: beginAtomicAction * and finishAtomicAction. It is recommended use it in try - finally block. * @see FileSystemt#beginAtomicAction * @param run Events fired from this atomic action will be marked as events * that were fired from this run. */ void beginAtomicAction(FileSystem.AtomicAction run) { enterAtomicAction(run, true); }
/** Executes atomic action. The atomic action represents a set of * operations constituting one logical unit. It is guaranteed that during * execution of such an action no events about changes in the filesystem * will be fired. * <P> * <em>Warning:</em> the action should not take a significant amount of time, and should finish as soon as * possible--otherwise all event notifications will be blocked. * <p><strong>Warning:</strong> do not be misled by the name of this method; * it does not require the filesystem to treat the changes as an atomic block of * commits in the database sense! That is, if an exception is thrown in the middle * of the action, partial results will not be undone (in general this would be * impossible to implement for all filesystems anyway). * @param run the action to run * @exception IOException if there is an <code>IOException</code> thrown in the actions' {@link AtomicAction#run run} * method */ public final void runAtomicAction(final AtomicAction run) throws IOException { getEventControl().runAtomicAction(run); }
invokeDispatchers (false, reqQueueCopy); return; LinkedList newReqQueue = invokeDispatchers (true, reqQueueCopy); synchronized (this) { while (requestsQueue != null && !requestsQueue.isEmpty ()) {
/** Executes atomic action. The atomic action represents a set of * operations constituting one logical unit. It is guaranteed that during * execution of such an action no events about changes in the filesystem * will be fired.*/ void runAtomicAction (final FileSystem.AtomicAction run) throws IOException { try { enterAtomicAction (run, false); run.run (); } finally { exitAtomicAction (false); } }
/** * End of block, that should be performed without firing events. * Firing of events is postponed after end of block . * There is strong necessity to use always both methods: beginAtomicAction * and finishAtomicAction. It is recomended use it in try - finally block. */ void finishAtomicAction () { getEventControl ().finishAtomicAction (); }
/** * Method that can fire events directly, postpone them, fire them in * standalone thread or in RequestProcessor */ void dispatchEvent (FileSystem.EventDispatcher dispatcher) { if (postponeFiring (dispatcher)) return; dispatcher.run(); }
/** * End of priority atomic actions. Atomic actions from inside of org.openide.FileSystems * are considered as priority atomic actions. From last priority atomic actions * are fired events regardless if nested in any normal atomic action. * * End of block, that should be performed without firing events. * Firing of events is postponed after end of block . * There is strong necessity to use always both methods: beginAtomicAction * and finishAtomicAction. It is recomended use it in try - finally block. * @see FileSystemt#finishAtomicAction */ void finishAtomicAction () { exitAtomicAction (true); }
/** * Begin of priority atomic actions. Atomic actions from inside of org.openide.FileSystems * are considered as priority atomic actions. From last priority atomic actions * are fired events regardless if nested in any normal atomic action. * * Begin of block, that should be performed without firing events. * Firing of events is postponed after end of block . * There is strong necessity to use always both methods: beginAtomicAction * and finishAtomicAction. It is recomended use it in try - finally block. * @see FileSystemt#beginAtomicAction * @param run Events fired from this atomic action will be marked as events * that were fired from this run. */ void beginAtomicAction (FileSystem.AtomicAction run) { enterAtomicAction (run, true); }
/** Executes atomic action. The atomic action represents a set of * operations constituting one logical unit. It is guaranteed that during * execution of such an action no events about changes in the filesystem * will be fired. * <P> * <em>Warning:</em> the action should not take a significant amount of time, and should finish as soon as * possible--otherwise all event notifications will be blocked. * <p><strong>Warning:</strong> do not be misled by the name of this method; * it does not require the filesystem to treat the changes as an atomic block of * commits in the database sense! That is, if an exception is thrown in the middle * of the action, partial results will not be undone (in general this would be * impossible to implement for all filesystems anyway). * @param run the action to run * @exception IOException if there is an <code>IOException</code> thrown in the actions' {@link AtomicAction#run run} * method */ public final void runAtomicAction (final AtomicAction run) throws IOException { getEventControl ().runAtomicAction (run); }
invokeDispatchers (false, reqQueueCopy); return; LinkedList newReqQueue = invokeDispatchers (true, reqQueueCopy); synchronized (this) { while (requestsQueue != null && !requestsQueue.isEmpty ()) {
/** Executes atomic action. The atomic action represents a set of * operations constituting one logical unit. It is guaranteed that during * execution of such an action no events about changes in the filesystem * will be fired.*/ void runAtomicAction (final FileSystem.AtomicAction run) throws IOException { try { enterAtomicAction (run, false); run.run (); } finally { exitAtomicAction (false); } }
/** * Inside atomicAction adds an event dispatcher to the queue of FS events * and firing of events is postponed. If not event handlers are called directly. * @param run dispatcher to run */ void dispatchEvent (EventDispatcher run) { getEventControl ().dispatchEvent (run); }