|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openharbor.beck.map.PollableResource
A resource with a relatively efficient method to check whether it has changed. This class is not thread-safe.
| Field Summary | |
protected java.lang.ClassLoader |
loader
|
protected org.apache.commons.logging.Log |
log
|
protected java.lang.String |
resourceName
|
| Fields inherited from interface com.openharbor.beck.map.PollableInput |
SECONDS |
| Constructor Summary | |
PollableResource(java.lang.ClassLoader loader,
java.lang.String name)
|
|
| Method Summary | |
protected java.net.URL |
getResource()
|
java.lang.String |
getSystemID()
The SystemID that identifies the input source, or null if its SystemID is unknown. |
java.io.InputStream |
input()
Begin reading the data (as a stream of bytes). |
java.io.InputStream |
inputIfModified()
Begin reading the data (as a stream of bytes) if it has changed since the last call to input() or inputIfModified(). |
protected PollableURL |
newPollableURL(java.net.URL url)
|
void |
pollSoon()
Check for a change in the data next time inputIfModified is called, regardless of the currently acceptable staleness. |
void |
setAcceptableStaleness(long msec)
Set the maximum amount of time that may elapse from a change in the data until the change is detected by this object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final org.apache.commons.logging.Log log
protected java.lang.ClassLoader loader
protected java.lang.String resourceName
| Constructor Detail |
public PollableResource(java.lang.ClassLoader loader,
java.lang.String name)
| Method Detail |
public void setAcceptableStaleness(long msec)
PollableInput
setAcceptableStaleness in interface PollableInputmsec - the acceptable staleness, in units of milliseconds.public java.lang.String getSystemID()
PollableInput
getSystemID in interface PollableInput
public java.io.InputStream input()
throws java.io.IOException
PollableInput
input in interface PollableInputjava.io.IOException
public java.io.InputStream inputIfModified()
throws java.io.IOException
PollableInput
inputIfModified in interface PollableInputjava.io.IOExceptionpublic void pollSoon()
PollableInput
pollSoon in interface PollableInput
protected java.net.URL getResource()
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionprotected PollableURL newPollableURL(java.net.URL url)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||