public class ResourceWatcher extends Object implements Destroyable
| Modifier and Type | Class and Description |
|---|---|
static interface |
ResourceWatcher.Callback |
static class |
ResourceWatcher.CallbackSupport
Default implementation of
ResourceWatcher.Callback which does nothing by default. |
| Constructor and Description |
|---|
ResourceWatcher() |
| Modifier and Type | Method and Description |
|---|---|
void |
check(CacheKey cacheKey)
Default constructor with a NoOP callback.
|
void |
check(CacheKey cacheKey,
ResourceWatcher.Callback callback)
Check if resources from a group were changed.
|
void |
destroy()
Destroy this object or any other internal state created during initialization.
|
protected void |
onException(Exception e)
Invoked when exception occurs.
|
boolean |
tryAsyncCheck(CacheKey cacheKey)
Will try an asynchronous check if the async configuration is enabled.
|
public void check(CacheKey cacheKey)
public boolean tryAsyncCheck(CacheKey cacheKey)
ResourceWatcherRequestHandler is
enabled.
If the async check is not allowed (the request was not passed through WroFilter) - no check will be
performed. This is important for use-cases when wro resource is included using a taglib which performs a wro api
call directly, without being invoked through WroFilter.public void check(CacheKey cacheKey, ResourceWatcher.Callback callback)
cacheKey - the cache key which was requested. The key contains the groupName which has to be checked for changes.protected void onException(Exception e)
public void destroy()
throws Exception
Destroyabledestroy in interface DestroyableException - if the destroy operation failed.Copyright © 2008-2014. All Rights Reserved.