public abstract class ForwardingResourceManager extends ForwardingManager implements ResourceManager
Note that this class does not forward the equals
and hashCode
methods through to the backing object. See
ForwardingObject
for more details.
Modifier | Constructor and Description |
---|---|
protected |
ForwardingResourceManager()
Constructor for use by subclasses.
|
Modifier and Type | Method and Description |
---|---|
<L extends Listener> |
assignables(java.lang.Class<L> type)
Returns a set of resources assignable to the specified listener type.
|
protected abstract ResourceManager |
delegate() |
<L extends Listener> |
register(java.lang.Class<L> type,
Resource<? super L> resource)
Registers a resource with the given listener type.
|
<L extends Listener> |
registrables(java.lang.Class<L> type)
Returns a set of resources registrable with the specified listener type.
|
com.google.common.collect.SetMultimap<java.lang.Class<? extends Listener>,Resource<?>> |
registrations()
Returns a set multimap of listener types to all registered resources.
|
<L extends Listener> |
unregister(java.lang.Class<L> type,
Resource<? super L> resource)
Unregisters a resource with the given listener type.
|
<L extends Listener> |
unregisterAll(java.lang.Class<L> type)
Unregisters all resources assignable to the specified listener type.
|
getName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode, registered
protected ForwardingResourceManager()
protected abstract ResourceManager delegate()
delegate
in class ForwardingManager
public <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 <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
public <L extends Listener> void unregisterAll(java.lang.Class<L> type)
ResourceManager
Note that this method collects all exceptions thrown by resources
during the unregistration process and propagates them as suppressed
exceptions of a ResourceUnregistrationException
instance.
unregisterAll
in interface ResourceManager
type
- the listener type to which the assignable resources
are going be unregistered, not null
public <L extends Listener> java.util.Set<Resource<? extends L>> assignables(java.lang.Class<L> type)
ResourceManager
A resource is assignable to a given listener type if the listener type supported by the resource is assignable to the given listener type.
assignables
in interface ResourceManager
public <L extends Listener> java.util.Set<Resource<? super L>> registrables(java.lang.Class<L> type)
ResourceManager
A resource is registrable with a given listener type if the listener type supported by the resource is equal to the given listener type or one of its superinterfaces.
registrables
in interface ResourceManager
public com.google.common.collect.SetMultimap<java.lang.Class<? extends Listener>,Resource<?>> registrations()
ResourceManager
registrations
in interface ResourceManager