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

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

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

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

Author:
sanjin

Constructor Summary
AbstractPublisherActivator()
          Creates instance of OSGi Activator for bundles that need to register ContextPublishers.
 
Method Summary
 ContextEventType[] getRegisteredEventTypes()
           
 void register(ContextPublisher publisher)
          Register specified ContextPublisher when ContextPublisherRegistry becomes available (or immediately if it is already available).
protected  void setRegistry(ContextPublisherRegistry registry)
          Sets the ContextPublisherRegistry, unregisters all ContextPublishers from previously set ContextPublisherRegistry if it was not null and registers all ContextPublishers with specified ContextPublisherRegistry if it is not null .
protected  void start()
          Called when bundle is started.
 void start(org.osgi.framework.BundleContext bundleContext)
           
protected  void start(ContextPublisherRegistry publisherRegistry)
          Called when ContextPublisherRegistry becomes available.
protected  void stop()
          Called when ContextPublisherRegistry becomes unavailable.
 void stop(org.osgi.framework.BundleContext bundleContext)
           
 void unregister(ContextPublisher publisher)
          Do not register specified ContextPublisher when ContextPublisherRegistry becomes available (and 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

AbstractPublisherActivator

public AbstractPublisherActivator()
Creates instance of OSGi Activator for bundles that need to register ContextPublishers.

Method Detail

start

protected void start()
Called when bundle is started.


start

protected void start(ContextPublisherRegistry publisherRegistry)
Called when ContextPublisherRegistry becomes available.

Parameters:
publisherRegistry - the ContextPublisherRegistry.

stop

protected void stop()
Called when ContextPublisherRegistry 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(ContextPublisher publisher)
Register specified ContextPublisher when ContextPublisherRegistry becomes available (or immediately if it is already available).

Parameters:
publisher - the ContextPublisher to register.

unregister

public final void unregister(ContextPublisher publisher)
Do not register specified ContextPublisher when ContextPublisherRegistry becomes available (and unregister it immediately if it is already available).

Parameters:
publisher - the ContextPublisher to unregister.

setRegistry

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

Parameters:
registry - the ContextPublisherRegistry.


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