T - The resource type being managed by SharedResourceCache.public class BaseResourceListener<T> extends Object implements ResourceListener<T>
ResourceListener implementation with no-op implementations. Implementers interested only
in handling specific events can subclass this class and override the handler methods that they care about.| Constructor and Description |
|---|
BaseResourceListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
onError(String name,
Throwable throwable)
Invoked when an error occurs in one of the resource operations.
|
void |
onResourceDelete(String name)
Invoked when a resource is removed from the shared cache.
|
void |
onResourceUpdate(String name,
T instance)
Invoked on an update to an individual resource.
|
void |
onUpdate()
Invoked when the entire set of cached resources has changed.
|
public void onUpdate()
ResourceListeneronUpdate in interface ResourceListener<T>public void onResourceUpdate(String name, T instance)
ResourceListeneronResourceUpdate in interface ResourceListener<T>name - the key for the resource being updatedinstance - the resource instance which was updatedpublic void onResourceDelete(String name)
ResourceListeneronResourceDelete in interface ResourceListener<T>name - the key for the resource that has been removedpublic void onError(String name, Throwable throwable)
ResourceListeneronError in interface ResourceListener<T>name - the key for the resource on which the error occurredthrowable - the exception that was thrownCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.