at.ac.tuwien.infosys.sm4all.copal.api.helpers
Class AbstractProcessorActivator

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.helpers.AbstractProcessorActivator
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public abstract class AbstractProcessorActivator
extends Object
implements org.osgi.framework.BundleActivator

Abstract helper class to be used as an OSGi Activator for bundles that need to register ContextProcessors.

Author:
sanjin

Constructor Summary
AbstractProcessorActivator()
          Creates instance of OSGi Activator for bundles that need to register ContextProcessors.
 
Method Summary
 ContextEventType[] getRegisteredEventTypes()
           
 void register(ContextProcessor processor)
          Register specified ContextProcessor when ContextProcessorRegistry becomes available (or register it immediately if it is already available).
protected  void setRegistry(ContextProcessorRegistry registry)
          Sets the ContextProcessorRegistry, unregisters all ContextProcessors from previously set ContextProcessorRegistry if it was not null and registers all ContextProcessors with specified ContextProcessorRegistry if it is not null .
protected  void start()
          Called when bundle is started.
 void start(org.osgi.framework.BundleContext bundleContext)
           
protected  void start(ContextProcessorRegistry processorRegistry)
          Called when ContextProcessorRegistry becomes available.
protected  void stop()
          Called when ContextProcessorRegistry becomes unavailable.
 void stop(org.osgi.framework.BundleContext bundleContext)
           
 void unregister(ContextProcessor processor)
          Do not register specified ContextProcessor when ContextProcessorRegistry becomes available (or unregister it immediately if it is already available).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractProcessorActivator

public AbstractProcessorActivator()
Creates instance of OSGi Activator for bundles that need to register ContextProcessors.

Method Detail

start

protected void start()
Called when bundle is started.


start

protected void start(ContextProcessorRegistry processorRegistry)
Called when ContextProcessorRegistry becomes available.

Parameters:
processorRegistry - the ContextProcessorRegistry.

stop

protected void stop()
Called when ContextProcessorRegistry becomes unavailable.


getRegisteredEventTypes

public ContextEventType[] getRegisteredEventTypes()
Returns:
all successfully registered ContextEventTypes defined in the context.cfg.xml file.

start

public final void start(org.osgi.framework.BundleContext bundleContext)
Specified by:
start in interface org.osgi.framework.BundleActivator

stop

public final void stop(org.osgi.framework.BundleContext bundleContext)
Specified by:
stop in interface org.osgi.framework.BundleActivator

register

public final void register(ContextProcessor processor)
Register specified ContextProcessor when ContextProcessorRegistry becomes available (or register it immediately if it is already available).

Parameters:
processor - the ContextProcessor to register.

unregister

public final void unregister(ContextProcessor processor)
Do not register specified ContextProcessor when ContextProcessorRegistry becomes available (or unregister it immediately if it is already available).

Parameters:
processor - the ContextProcessor to unregister.

setRegistry

protected void setRegistry(ContextProcessorRegistry registry)
Sets the ContextProcessorRegistry, unregisters all ContextProcessors from previously set ContextProcessorRegistry if it was not null and registers all ContextProcessors with specified ContextProcessorRegistry if it is not null .

Parameters:
registry - the ContextProcessorRegistry.


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