FileSystemSvc.IAdvanced Interface

com.bea.ide.filesystem
FileSystemSvc.IAdvanced Interface

public static interface FileSystemSvc.IAdvanced

    extends FileSystemSvc.I

This interface contains methods that are not normally used; mostly they are used by the FileSvc to control the firing and type of FileSystem events. If one want to make changes to the file system, use the FileSvc instead of manipulating the filesysem directly, as it will properly use this advanced interface.

One method on this interface that may be of interest is the getLock() method which, when synchronized on, will prevent events from firing, listeners from being added, and other threads calling the FileSvc (or trying to grab the lock) from proceeding with their changes.


All Superinterfaces
FileSystemSvc.I
Enclosing class

FileSystemSvc

Field Summary

public static final int
ABORT_CHANGE
A previously-started change should be aborted.
public static final int
FILE_CHANGED
Signifies the file's content was changed, or the modification date was changed.
public static final int
FILE_DELETED
Signifies the file has been deleted from the system.
public static final int
FILE_NEW
Signifies the file is new.
public static final int
FILE_WRITABLE_CHANGED
Signifies the file's writable status was changed.
public static final int
IGNORE_CHANGE
The change that occurred on disk should be ignored and not sent to the listeners.
public static final int
IGNORE_FUTURE_CHANGES
Future change events for this file should be ignored.
 

Method Summary

public void
finishChangeInternally(URI changedUri, int changeType, Object state)
This method should be called after the application changes a file on disk.
public void
resumeEventProcessing()
This is the counterpart to the stopEventProcessing method and allows the File System Service to resume processing file system events.
public void
startChangeInternally(URI changedUri)
This method should be called immediately before the application changes a file on disk.
public void
stopEventProcessing()
This method allows the caller to temporarily halt file system event notifictaions.
public boolean
synchronize(boolean waitForListeners)
This method synchronizes the file system.
public boolean
synchronize(FileSystemSvc.ISynchronizeComplete sc)
This method synchronizes the file system.
 
Methods from interface com.bea.ide.filesystem.FileSystemSvc.I
addFileSystemListener, addFileSystemListener, countIFiles, countIFiles, getIFiles, getIFiles, getIFiles, getIFilesAndDirs, removeFileSystemListener, removeFileSystemListener
   

Field Detail

ABORT_CHANGE

public static final int ABORT_CHANGE
A previously-started change should be aborted.


FILE_CHANGED

public static final int FILE_CHANGED
Signifies the file's content was changed, or the modification date was changed.


FILE_DELETED

public static final int FILE_DELETED
Signifies the file has been deleted from the system.


FILE_NEW

public static final int FILE_NEW
Signifies the file is new.


FILE_WRITABLE_CHANGED

public static final int FILE_WRITABLE_CHANGED
Signifies the file's writable status was changed.


IGNORE_CHANGE

public static final int IGNORE_CHANGE
The change that occurred on disk should be ignored and not sent to the listeners.


IGNORE_FUTURE_CHANGES

public static final int IGNORE_FUTURE_CHANGES
Future change events for this file should be ignored. This setting will be cleared if the file is subsequently deleted and recreated.

 

Method Detail

finishChangeInternally(URI, int, Object) Method

public void finishChangeInternally(URI changedUri, 
                                   int changeType, 
                                   Object state)
This method should be called after the application changes a file on disk. The change type is passed in as a hint for how you would like the event to be viewed by the listeners. After completion, file system events may be processed again. This method contains an implict call to FileSystemSvc.IAdvanced.resumeEventProcessing()

Parameters

changedUri
the URI of the file/directory that has been changed.
changeType
a constant from FileSystemEvent indicating the change type hint.
state
object that will be passed along with the filesystem event.

Related Topics

FileSystemSvc.IAdvanced.resumeEventProcessing()
FileSystemEvent


resumeEventProcessing() Method

public void resumeEventProcessing()
This is the counterpart to the stopEventProcessing method and allows the File System Service to resume processing file system events.

Related Topics

FileSystemEvent


startChangeInternally(URI) Method

public void startChangeInternally(URI changedUri)
This method should be called immediately before the application changes a file on disk.

As a side effect, this method halts all file system notifications until finishChangeInternally is called. This method contains an implict call to FileSystemSvc.IAdvanced.stopEventProcessing()

Parameters

changedUri
the URI of the file/directory about to be changed.

Related Topics

FileSystemSvc.IAdvanced.stopEventProcessing()


stopEventProcessing() Method

public void stopEventProcessing()
This method allows the caller to temporarily halt file system event notifictaions. Between calls to this method and it's counterpart FileSystemSvc.IAdvanced.resumeEventProcessing(), Listeners are guaranteed not to fire. This allows the caller to perform multiple changes to the file system without firing multiple events and to protect themselves from re-entrance if their file system listener needs this. Note that multiple calls may be made to this method. The events will resume when the corresponding number of calls to resumeEventProcessing have been made. All calls to this method should be guaranteed to be followed at some point by a call to resumeEventProcessing, usually in a finally block.

Related Topics

FileSystemEvent


synchronize(boolean) Method

public boolean synchronize(boolean waitForListeners)
This method synchronizes the file system. It waits until all outstanding file change events have been popogated to listeners and then returns. Note that it is inherently a transient state, and so no guarantees can be made about the complete state of the filesystem. However, if internal code makes a large number of modifications to the filesystem, then calls synchronize(), you are guaranteed that all changes that were committed to disk at the time of the call to synchronize() will have been propogated.

Parameters

waitForListeners
boolean indicating whether or not synchronize should wait for all listeners to be notified, or only for it's internal caches to be updated

synchronize(FileSystemSvc.ISynchronizeComplete) Method

public boolean synchronize(FileSystemSvc.ISynchronizeComplete sc)
This method synchronizes the file system. The synchronizer callback is invoked after periodically during the synchronization loop. Callers that are waiting for a particular event to be delivered can check state to insure that their event has been delivered.

Parameters

sc
callback to use to signal that the synchronization is complete.