|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.excalibur.monitor.Resource
Managed Resource. All resources must have a constructor that takes a String and converts it to the needed format (i.e. File). A Managed Resource in the Monitor section has only one property needed to be changed: last modified. The property name for the last modified event will be the same as the resource key. Implementations may add additional properties, but for most instances the last modified property will be enough.
Field Summary | |
protected java.beans.PropertyChangeSupport |
m_eventSupport
Deprecated. Developers should use the setter/getters associated with field. |
protected long |
m_previousModified
Deprecated. Developers should use the setter/getters associated with field. |
protected static java.lang.String |
MODIFIED
|
Constructor Summary | |
Resource(java.lang.String resourceKey)
Required constructor. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
This is the prefered method of registering a PropertyChangeListener . |
protected void |
addPropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
This is a convenience if you want to expose other properties for the Resource. |
void |
addPropertyChangeListenersFrom(Resource other)
Abstract method to add the PropertyChangeListeners in another Resource to this one. |
protected void |
fireAndSetModifiedTime(long lastModified)
Fire a modify event and set the lastModified time as appropraite. |
protected java.beans.PropertyChangeSupport |
getEventSupport()
|
protected long |
getPreviousModified()
|
java.lang.String |
getResourceKey()
Return the key for the resource. |
boolean |
hasListeners()
This is the preferred method of determining if a Resource has listeners. |
protected boolean |
hasListeners(java.lang.String property)
This is a convenience if you want to expose other properties for the Resource. |
abstract long |
lastModified()
The time this was last modified. |
void |
removeAllPropertyChangeListeners()
This cleanup method removes all listeners |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
This is the prefered method of unregistering a PropertyChangeListener . |
protected void |
removePropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
This is a convenience if you want to expose other properties for the Resource. |
protected void |
setPreviousModified(long previousModified)
|
void |
testModifiedAfter(long time)
Test whether this has been modified since time X |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final java.lang.String MODIFIED
protected java.beans.PropertyChangeSupport m_eventSupport
protected long m_previousModified
Constructor Detail |
public Resource(java.lang.String resourceKey) throws java.lang.Exception
String
location is transformed by
the specific resource monitor. For instance, a FileResource will be able
to convert a string representation of a path to the proper File object.
Method Detail |
public final java.lang.String getResourceKey()
public abstract long lastModified()
lastModified
in interface Modifiable
public void testModifiedAfter(long time)
testModifiedAfter
in interface Modifiable
protected void fireAndSetModifiedTime(long lastModified)
lastModified
- the time modified atpublic void addPropertyChangeListenersFrom(Resource other)
public final void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
PropertyChangeListener
.
It automatically registers the listener for the last modified event.
protected void addPropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)
public final void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
PropertyChangeListener
.
It automatically registers the listener for the last modified event.
protected void removePropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)
public final boolean hasListeners()
public void removeAllPropertyChangeListeners()
protected boolean hasListeners(java.lang.String property)
protected final long getPreviousModified()
protected final void setPreviousModified(long previousModified)
protected final java.beans.PropertyChangeSupport getEventSupport()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |