public abstract class ForwardingResource<L extends Listener> extends ForwardingRegistrable implements Resource<L>
Note that this class does not forward the equals
and hashCode
methods through to the backing object. See
ForwardingObject
for more details.
Resource
Modifier | Constructor and Description |
---|---|
protected |
ForwardingResource()
Constructor for use by subclasses.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Resource<L> |
delegate() |
java.lang.String |
getName()
Returns a fully qualified name of this resource.
|
void |
register(L listener)
Registers a listener to this resource.
|
<U extends Listener> |
registered(java.lang.Class<U> type)
Returns all registered listeners assignable to the specified
listener type.
|
boolean |
registered(Listener listener)
Determines whether the specified listener
is registered to this resource.
|
void |
unregister(L listener)
Unregisters a listener from this resource.
|
postRegister, postUnregister, preRegister, preUnregister
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
postRegister, postUnregister, preRegister, preUnregister
protected ForwardingResource()
protected abstract Resource<L> delegate()
delegate
in class ForwardingRegistrable
public void register(L listener)
Resource
Warning: Does not invoke listener registration hooks.
Only ListenerManager.register(Listener)
is responsible
for proper hook method invocation during the registration process.
public void unregister(L listener)
Resource
Warning: Does not invoke listener unregistration hooks.
Only ListenerManager.unregister(Listener)
is responsible
for proper hook method invocation during the unregistration process.
unregister
in interface Resource<L extends Listener>
listener
- the listener to be unregistered, not null
public <U extends Listener> java.util.Collection<U> registered(java.lang.Class<U> type)
Resource
registered
in interface Resource<L extends Listener>
type
- the listener type of the registered listeners,
not null
public boolean registered(Listener listener)
Resource
registered
in interface Resource<L extends Listener>
listener
- the listener to be checked, not null
true
if the specified listener is registered
to this resource, false
otherwise