|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.perfectjpattern.core.behavioral.observer.ObserverProxy<E>
E
- Type of event data that this IObserver
subscribes
to.public final class ObserverProxy<E>
Implementation of IObserver
interface that acts as a Proxy to
any plain non-Observer class type. Makes possible to have any given class
type to Observe more than one type of Subject without update
method name and signature clash.
IObserver
Constructor Summary | |
---|---|
ObserverProxy(Class aClass,
String aMethodName,
Class... aParameters)
Constructs ObserverProxy from a target static class |
|
ObserverProxy(Object anObject,
String aMethodName,
Class... aParameters)
Constructs ObserverProxy from a target instance |
Method Summary | |
---|---|
void |
update(E anEventData)
Notification from ISubject instance that a change
has ocurred. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObserverProxy(Object anObject, String aMethodName, Class... aParameters)
ObserverProxy
from a target instance
anObject
- Target Object that will handle the notification messageaMethodName
- Target method implemented in anObject that will
handle notification messagesaParameters
- Type of parameters passed in notification events e.g.
changed state etcpublic ObserverProxy(Class aClass, String aMethodName, Class... aParameters)
ObserverProxy
from a target static class
aClass
- Target helper static class that will handle the
notification messageaMethodName
- Target static method implemented in aClass that will
handle notification messagesaParameters
- Type of parameters passed in notification events e.g.
changed state etcMethod Detail |
---|
public void update(E anEventData)
ISubject
instance that a change
has ocurred.
update
in interface IObserver<E>
anEventData
- Event data pushed to IObserver
instances.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |