at.ac.tuwien.infosys.sm4all.copal.api.listener
Class AnnotatedListener

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.listener.BaseListener
      extended by at.ac.tuwien.infosys.sm4all.copal.api.listener.AnnotatedListener
All Implemented Interfaces:
ContextListener

public class AnnotatedListener
extends BaseListener

Wrapper class that implements ContextListener around an Object which uses annotations to define its Name and Events Methods.

Author:
sanjin

Constructor Summary
AnnotatedListener(java.lang.Object listener)
          Creates instance of wrapper ContextListener that wraps around specified annotated listener.
 
Method Summary
 void onEvent(ContextEvent event)
          Invokes all Events Methods of the underlying annotated listener that can handle specified ContextEvent.
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.listener.BaseListener
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotatedListener

public AnnotatedListener(java.lang.Object listener)
Creates instance of wrapper ContextListener that wraps around specified annotated listener.

Parameters:
listener - the annotated listener.
Throws:
java.lang.NullPointerException - if specified annotated listener is null.
java.lang.IllegalArgumentException - if specified annotated listener has no Name annotation or there are no methods with Event or Events annotations.
Method Detail

onEvent

public void onEvent(ContextEvent event)
Invokes all Events Methods of the underlying annotated listener that can handle specified ContextEvent.

Parameters:
event - the ContextEvent.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.