public final class DebugResourceManagerProxy extends DebugNameableProxy implements DebugResourceManager
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.
|
ResourceManager |
delegate() |
<L extends Listener> |
register(java.lang.Class<L> type,
Resource<? super L> resource)
Registers a resource with the given listener type.
|
boolean |
registered(java.lang.Class<? extends Listener> type,
Resource<?> resource)
Determines whether the specified resource is registered
with the specified listener type by this resource manager.
|
<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.
|
static ResourceManager |
unwrap(ResourceManager manager) |
static DebugResourceManagerProxy |
wrap(ResourceManager manager) |
static DebugResourceManagerProxy |
wrap(ResourceManager manager,
DebugConsole console) |
getName
equals, hashCode, toString
error, getDebugConsole, notice, notice, print, print, put, put, tab, untab, warning, warning
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDebugConsole
equals, hashCode
public static DebugResourceManagerProxy wrap(ResourceManager manager)
public static DebugResourceManagerProxy wrap(ResourceManager manager, DebugConsole console)
public static ResourceManager unwrap(ResourceManager manager)
public ResourceManager delegate()
delegate
in class DebugNameableProxy
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
public boolean registered(java.lang.Class<? extends Listener> type, Resource<?> resource)
ResourceManager
registered
in interface ResourceManager
type
- the listener type to be checked, not null
resource
- the resource to be checked, not null
true
if the specified resource is registered
with the specified listener type by this resource manager,
false
otherwise