at.ac.tuwien.infosys.sm4all.copal.api.osgi
Class Tracker<T>

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.osgi.GenericActivator
      extended by at.ac.tuwien.infosys.sm4all.copal.api.osgi.Tracker<T>
Type Parameters:
T - the type of service.
All Implemented Interfaces:
DependencyTrackerCustomizer, org.osgi.framework.BundleActivator

public class Tracker<T>
extends GenericActivator

Abstract helper class to be used as a BundleActivator for bundles that require a service.

Author:
sanjin

Constructor Summary
Tracker(java.lang.String name)
          Creates instance of BundleActivator for bundles that require a service with specified name.
 
Method Summary
 T getService()
          Returns the currently available service or null if service is unavailable.
protected  void start()
          Called when all dependencies are met.
protected  void start(T service)
          Called when service becomes available.
protected  void stop()
          Called when GenericActivator.start() was previously called and one of the dependencies has been unregistered.
protected  void stop(T service)
          Called when service becomes unavailable.
 
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

Tracker

public Tracker(java.lang.String name)
Creates instance of BundleActivator for bundles that require a service with specified name.

Parameters:
name - the name of service.
Method Detail

start

protected void start(T service)
Called when service becomes available.

Parameters:
service - the service.

stop

protected void stop(T service)
Called when service becomes unavailable.

Parameters:
service - the service.

getService

public T getService()
Returns the currently available service or null if service is unavailable.

Returns:
the currently available service.

start

protected void start()
Description copied from class: GenericActivator
Called when all dependencies are met.

Specified by:
start in class GenericActivator

stop

protected void stop()
Description copied from class: GenericActivator
Called when GenericActivator.start() was previously called and one of the dependencies has been unregistered.

Specified by:
stop in class GenericActivator


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