|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.TimerTask
org.opensaml.util.resource.ResourceChangeWatcher
public class ResourceChangeWatcher
A watcher that invokes a callback when a resource update/deletion has been detected.
Field Summary | |
---|---|
static int |
DEFAULT_MAX_RETRY_ATTEMPTS
Default maximum retry attempts, 0. |
static long |
DEFAULT_POLL_FREQUENCY
Default polling frequency, 12 hours. |
Constructor Summary | |
---|---|
ResourceChangeWatcher(Resource resource)
Constructor. |
|
ResourceChangeWatcher(Resource resource,
long pollingFrequency)
Constructor. |
|
ResourceChangeWatcher(Resource resource,
long pollingFrequency,
int retryAttempts)
Constructor. |
Method Summary | |
---|---|
long |
getPollingFrequency()
Gets the frequency, in milliseconds, the watched resource should be polled. |
List<ResourceChangeListener> |
getResourceListeners()
Gets the list of registered resource listeners. |
void |
run()
|
protected void |
signalListeners(ResourceChangeListener.ResourceChange changeType)
Signals all registered listeners of a resource change. |
Methods inherited from class java.util.TimerTask |
---|
cancel, scheduledExecutionTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_POLL_FREQUENCY
public static final int DEFAULT_MAX_RETRY_ATTEMPTS
Constructor Detail |
---|
public ResourceChangeWatcher(Resource resource) throws ResourceException
resource
- the resource to be watched
ResourceException
- thrown if resource existence or last modification time can not be determinedpublic ResourceChangeWatcher(Resource resource, long pollingFrequency) throws ResourceException
resource
- the resource to be watchedpollingFrequency
- the frequency, in milliseconds, to poll the resource for changes
ResourceException
- thrown if resource existence or last modification time can not be determinedpublic ResourceChangeWatcher(Resource resource, long pollingFrequency, int retryAttempts) throws ResourceException
resource
- the resource to be watchedpollingFrequency
- the frequency, in milliseconds, to poll the resource for changesretryAttempts
- maximum number of poll attempts before the resource is considered inaccessible
ResourceException
- thrown if resource existence or last modification time can not be determinedMethod Detail |
---|
public long getPollingFrequency()
public List<ResourceChangeListener> getResourceListeners()
public void run()
run
in interface Runnable
run
in class TimerTask
protected void signalListeners(ResourceChangeListener.ResourceChange changeType)
changeType
- the resource change type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |