at.ac.tuwien.infosys.sm4all.copal.api.processor
Class AnnotatedProcessor

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.osgi.GenericActivator
      extended by at.ac.tuwien.infosys.sm4all.copal.api.processor.BaseProcessor
          extended by at.ac.tuwien.infosys.sm4all.copal.api.processor.AnnotatedProcessor
All Implemented Interfaces:
DependencyTrackerCustomizer, ContextProcessor, org.osgi.framework.BundleActivator

public class AnnotatedProcessor
extends BaseProcessor

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

Author:
sanjin

Constructor Summary
AnnotatedProcessor(java.lang.Object processor)
          Creates instance of wrapper ContextProcessor that wraps around specified annotated processor.
 
Method Summary
 ContextEvent[] process(ProcessorAction action, ContextEvent event)
          Invokes all Actions Methods of the underlying annotated processor that can handle specified ContextEvent.
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.processor.BaseProcessor
getActions, getName, start, stop
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.osgi.GenericActivator
addingService, getDependency, modifiedService, register, register, removedService, start, stop, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotatedProcessor

public AnnotatedProcessor(java.lang.Object processor)
Creates instance of wrapper ContextProcessor that wraps around specified annotated processor.

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

process

public ContextEvent[] process(ProcessorAction action,
                              ContextEvent event)
Invokes all Actions Methods of the underlying annotated processor that can handle specified ContextEvent. Results of all invocations are merged and returned.

Parameters:
action - the ProcessorAction (ignored and instead the CurrentAction of specified ContextEvent is used).
event - the ContextEvent.
Returns:
the resulting ContextEvents of the underlying Actions Method.


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