|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.grinder.console.distribution.FileDistributionImplementation
public final class FileDistributionImplementation
FileDistribution implementation.
Instantiated by PicoContainer.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface net.grinder.console.distribution.FileChangeWatcher |
|---|
FileChangeWatcher.FileChangedListener |
| Constructor Summary | |
|---|---|
FileDistributionImplementation(DistributionControl distributionControl,
ProcessControl processControl,
Directory directory,
Pattern distributionFileFilterPattern)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addFileChangedListener(FileChangeWatcher.FileChangedListener listener)
Add a listener that will be sent events about files that have changed when scanDistributionFiles() is called. |
AgentCacheState |
getAgentCacheState()
Accessor for our AgentCacheState. |
FileFilter |
getDistributionFileFilter()
Return a FileFilter that can be used to test whether the given file is one that will be distributed. |
FileDistributionHandler |
getHandler()
Get a FileDistributionHandler for a new file
distribution. |
void |
scanDistributionFiles()
Scan the given directory for files that have been recently modified. |
void |
setDirectory(Directory directory)
Update the distribution directory. |
void |
setFileFilterPattern(Pattern distributionFileFilterPattern)
Update the pattern used to filter out files that shouldn't be distributed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileDistributionImplementation(DistributionControl distributionControl,
ProcessControl processControl,
Directory directory,
Pattern distributionFileFilterPattern)
distributionControl - A DistributionControl.processControl - A process control.directory - The base distribution directory.distributionFileFilterPattern - -
The filter. Files with names that match this pattern will be
filtered out.| Method Detail |
|---|
public void setDirectory(Directory directory)
setDirectory in interface FileDistributiondirectory - The base distribution directory.public void setFileFilterPattern(Pattern distributionFileFilterPattern)
setFileFilterPattern in interface FileDistributiondistributionFileFilterPattern - -
The filter. Files with names that match this pattern will be
filtered out.public AgentCacheState getAgentCacheState()
AgentCacheState.
getAgentCacheState in interface FileDistributionpublic FileDistributionHandler getHandler()
FileDistributionHandler for a new file
distribution.
The FileDistributionHandler updates our simple model of the remote cache state. Callers should only use one FileDistributionHandler at a time for a given FileDistribution. Using multiple instances concurrently will result in undefined behaviour.
getHandler in interface FileDistributionpublic void scanDistributionFiles()
This method is too coupled to the agent cache. Perhaps this and the file watcher support should be factored out into a separate class.
Currently, the file listeners only get notification for things that match the distribution filter.
scanDistributionFiles in interface FileDistributionpublic void addFileChangedListener(FileChangeWatcher.FileChangedListener listener)
scanDistributionFiles() is called.
addFileChangedListener in interface FileChangeWatcherlistener - The listener.public FileFilter getDistributionFileFilter()
getDistributionFileFilter in interface FileDistributionsetFileFilterPattern(Pattern)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||