|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.lenya.ac.file.FileItemManager
public abstract class FileItemManager
Abstract superclass for classes that manage items loaded from configuration files.
| Nested Class Summary | |
|---|---|
static class |
FileItemManager.DirectoryChangeNotifier
Helper class to observe a directory for changes. |
| Constructor Summary | |
|---|---|
protected |
FileItemManager(org.apache.lenya.ac.AccreditableManager accreditableManager)
Create a new ItemManager. |
| Method Summary | |
|---|---|
void |
add(org.apache.lenya.ac.Item item)
Add an Item to this manager |
void |
addItemManagerListener(org.apache.lenya.ac.ItemManagerListener listener)
Attaches an item manager listener to this item manager. |
void |
configure(java.io.File _configurationDirectory)
Configures the item manager. |
boolean |
contains(org.apache.lenya.ac.Item item)
Returns if the ItemManager contains an object. |
org.apache.lenya.ac.AccreditableManager |
getAccreditableManager()
|
java.io.File |
getConfigurationDirectory()
Get the directory where the items are located. |
protected java.io.FileFilter |
getFileFilter()
Get a file filter which filters for files containing items. |
org.apache.lenya.ac.Item |
getItem(java.lang.String id)
Returns an item for a given ID. |
protected org.apache.avalon.framework.configuration.Configuration |
getItemConfiguration(java.io.File file)
Loads teh configuration of an item from a file. |
org.apache.lenya.ac.Item[] |
getItems()
get all items |
protected abstract java.lang.String |
getSuffix()
Returns the file extension to be used. |
protected org.apache.lenya.ac.Item |
loadItem(java.io.File file)
Loads an item from a file. |
protected void |
loadItems()
Reloads the items if an item was changed / added / removed. |
protected void |
notifyAdded(org.apache.lenya.ac.Item item)
Notifies the listeners that an item was added. |
protected void |
notifyRemoved(org.apache.lenya.ac.Item item)
Notifies the listeners that an item was removed. |
void |
remove(org.apache.lenya.ac.Item item)
Remove an item from this manager |
protected void |
removeItem(java.io.File file)
|
void |
removeItemManagerListener(org.apache.lenya.ac.ItemManagerListener listener)
Removes an item manager listener from this item manager. |
void |
update(org.apache.lenya.ac.Item newItem)
Update an item. |
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
|---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected FileItemManager(org.apache.lenya.ac.AccreditableManager accreditableManager)
accreditableManager - The AccreditableManager.| Method Detail |
|---|
public void configure(java.io.File _configurationDirectory)
throws org.apache.lenya.ac.AccessControlException
_configurationDirectory - where the items are fetched from
org.apache.lenya.ac.AccessControlException - if the item manager cannot be instantiated
protected void loadItems()
throws org.apache.lenya.ac.AccessControlException
org.apache.lenya.ac.AccessControlException - when something went wrong.
protected org.apache.lenya.ac.Item loadItem(java.io.File file)
throws org.apache.lenya.ac.AccessControlException
file - The file.
org.apache.lenya.ac.AccessControlException - when something went wrong.
protected org.apache.avalon.framework.configuration.Configuration getItemConfiguration(java.io.File file)
throws org.apache.lenya.ac.AccessControlException
file - The file.
org.apache.lenya.ac.AccessControlException - when something went wrong.protected void removeItem(java.io.File file)
public org.apache.lenya.ac.Item getItem(java.lang.String id)
id - The id.
public org.apache.lenya.ac.Item[] getItems()
public void add(org.apache.lenya.ac.Item item)
throws org.apache.lenya.ac.AccessControlException
item - to be added
org.apache.lenya.ac.AccessControlException - when the notification threw this
exception.
public void remove(org.apache.lenya.ac.Item item)
throws org.apache.lenya.ac.AccessControlException
item - to be removed
org.apache.lenya.ac.AccessControlException - when the notification threw this
exception.
public void update(org.apache.lenya.ac.Item newItem)
throws org.apache.lenya.ac.AccessControlException
newItem - The new version of the item.
org.apache.lenya.ac.AccessControlException - when the notification threw this
exception.public boolean contains(org.apache.lenya.ac.Item item)
item - The object.
public java.io.File getConfigurationDirectory()
Fileprotected java.io.FileFilter getFileFilter()
FileFilterprotected abstract java.lang.String getSuffix()
public void addItemManagerListener(org.apache.lenya.ac.ItemManagerListener listener)
addItemManagerListener in interface org.apache.lenya.ac.ItemManagerlistener - An item manager listener.public void removeItemManagerListener(org.apache.lenya.ac.ItemManagerListener listener)
removeItemManagerListener in interface org.apache.lenya.ac.ItemManagerlistener - An item manager listener.
protected void notifyAdded(org.apache.lenya.ac.Item item)
throws org.apache.lenya.ac.AccessControlException
item - The item that was added.
org.apache.lenya.ac.AccessControlException - if an error occurs.
protected void notifyRemoved(org.apache.lenya.ac.Item item)
throws org.apache.lenya.ac.AccessControlException
item - The item that was removed.
org.apache.lenya.ac.AccessControlException - if an error occurs.public org.apache.lenya.ac.AccreditableManager getAccreditableManager()
getAccreditableManager in interface org.apache.lenya.ac.ItemManager
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||