public class FilePublisher extends IzouModule
FileSubscriber
objects. It is triggered when a file is reloaded. Particularly
file subscribers are mapped to ReloadableFile
objects. When a reloadable file is reloaded, all file
subscribers belonging to it are notified. All file subscribers in general can also be notified.log, main
Constructor and Description |
---|
FilePublisher(Main main)
Creates a new FilePublisher object.
|
Modifier and Type | Method and Description |
---|---|
IdentificationSet<FileSubscriber> |
getFileSubscribersForReloadableFile(ReloadableFile reloadableFile)
Get all subscribers for a
reloadableFile |
void |
notifyAllFileSubcribers()
Notifies all file subscribers.
|
void |
notifyDefaultFileSubscribers()
Notifies all default file subscribers, that is those that will all be notified no matter what.
|
void |
notifyFileSubscribers(ReloadableFile reloadableFile)
Notifies all file subscribers registered to
reloadableFile |
void |
register(FileSubscriber fileSubscriber,
Identification identification)
Registers a
FileSubscriber so that whenever any file is reloaded, the fileSubscriber is notified. |
void |
register(ReloadableFile reloadableFile,
FileSubscriber fileSubscriber,
Identification identification)
Registers a
FileSubscriber with a ReloadableFile . |
void |
unregister(FileSubscriber fileSubscriber)
Unregisters all instances of fileSubscriber found.
|
debug, debug, error, error, fatal, fatal, getID, getMain
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isOwner
public FilePublisher(Main main)
main
- an Instance of main, used to get all the other classespublic void register(ReloadableFile reloadableFile, FileSubscriber fileSubscriber, Identification identification) throws IllegalIDException
FileSubscriber
with a ReloadableFile
. So when the reloadableFile
is reloaded,
the fileSubscriber will be notified. Multiple file subscribers can be registered with the same reloadable file.reloadableFile
- the reloadable file that should be observedfileSubscriber
- the fileSubscriber that should be notified when the reloadable file is reloadedidentification
- the Identification of the FileSubscriberIllegalIDException
- not yet implementedpublic void register(FileSubscriber fileSubscriber, Identification identification) throws IllegalIDException
FileSubscriber
so that whenever any file is reloaded, the fileSubscriber is notified.fileSubscriber
- the fileSubscriber that should be notified when the reloadable file is reloadedidentification
- the Identification of the FileSubscriberIllegalIDException
- not yet implementedpublic void unregister(FileSubscriber fileSubscriber)
fileSubscriber
- the fileSubscriber to unregisterpublic void notifyFileSubscribers(ReloadableFile reloadableFile)
reloadableFile
reloadableFile
- the ReloadableFile object for which to notify all pertaining file subscriberspublic void notifyAllFileSubcribers()
public void notifyDefaultFileSubscribers()
public IdentificationSet<FileSubscriber> getFileSubscribersForReloadableFile(ReloadableFile reloadableFile)
reloadableFile
reloadableFile
- the reloadableFile
for which to get all subscribersreloadableFile
Copyright © 2016. All rights reserved.