public abstract class AbstractResourceManager extends AbstractManager implements ResourceManager
ResourceManager. This class
implements the resource registration mechanism based on an underlying
SetMultimap of listener types to registered resources.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractResourceManager()
Constructor for use by subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
protected static <L extends Listener> |
check(java.lang.Class<L> type,
Resource<? super L> resource) |
<L extends Listener> |
register(java.lang.Class<L> type,
Resource<? super L> resource)
Registers a resource with the given listener type.
|
protected abstract com.google.common.collect.SetMultimap<java.lang.Class<? extends Listener>,Resource<?>> |
typeToResources() |
<L extends Listener> |
unregister(java.lang.Class<L> type,
Resource<? super L> resource)
Unregisters a resource with the given listener type.
|
equals, getName, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitassignables, equals, hashCode, registered, registrables, registrations, unregisterAllprotected AbstractResourceManager()
protected abstract com.google.common.collect.SetMultimap<java.lang.Class<? extends Listener>,Resource<?>> typeToResources()
protected static final <L extends Listener> void check(java.lang.Class<L> type, Resource<? super L> resource)
public final <L extends Listener> void register(java.lang.Class<L> type, Resource<? super L> resource)
ResourceManagerNote that this method propagates any exception
thrown by the specified resource as a cause of a
ResourceRegistrationException instance.
register in interface ResourceManagertype - the listener type with which the specified
resource is to be registered, not nullresource - the resource to be registered with the specified
listener type, not nullpublic final <L extends Listener> void unregister(java.lang.Class<L> type, Resource<? super L> resource)
ResourceManagerNote that this method propagates any exception
thrown by the specified resource as a cause of a
ResourceUnregistrationException instance.
unregister in interface ResourceManagertype - the listener type with which the specified
resource is to be unregistered, not nullresource - the resource to be unregistered from the specified
listener type, not null