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, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
assignables, equals, hashCode, registered, registrables, registrations, unregisterAll
protected 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)
ResourceManager
Note that this method propagates any exception
thrown by the specified resource as a cause of a
ResourceRegistrationException
instance.
register
in interface ResourceManager
type
- the listener type with which the specified
resource is to be registered, not null
resource
- the resource to be registered with the specified
listener type, not null
public final <L extends Listener> void unregister(java.lang.Class<L> type, Resource<? super L> resource)
ResourceManager
Note that this method propagates any exception
thrown by the specified resource as a cause of a
ResourceUnregistrationException
instance.
unregister
in interface ResourceManager
type
- the listener type with which the specified
resource is to be unregistered, not null
resource
- the resource to be unregistered from the specified
listener type, not null