Framework Professional Edition Package


org.mbs.services.device.abstractdriver
Class AbstractDeviceActivator

java.lang.Object
  extended by org.mbs.services.device.abstractdriver.AbstractDeviceActivator
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public abstract class AbstractDeviceActivator
extends java.lang.Object
implements org.osgi.framework.BundleActivator

This abstract class should be used to implement bundle activators for all device drivers. The only task of subclasses is to implement the abstract createDrivers method.

Since:
$Date: 2007/08/01 06:50:50 $
Author:
Stoyan Zoubev

Field Summary
protected  org.osgi.framework.BundleContext bc
          BundleContext instance passed to the start method
protected  AbstractDeviceDriver[] drivers
          AbstractDeviceDriver services, registered in the framework
 
Constructor Summary
AbstractDeviceActivator()
           
 
Method Summary
abstract  AbstractDeviceDriver[] createDrivers()
          Creates the Driver service instances.
 void start(org.osgi.framework.BundleContext bc)
          Starts the driver bundle.
 void stop(org.osgi.framework.BundleContext bc)
          Stops the driver bundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bc

protected org.osgi.framework.BundleContext bc
BundleContext instance passed to the start method


drivers

protected AbstractDeviceDriver[] drivers
AbstractDeviceDriver services, registered in the framework

Constructor Detail

AbstractDeviceActivator

public AbstractDeviceActivator()
Method Detail

start

public void start(org.osgi.framework.BundleContext bc)
           throws java.lang.Exception
Starts the driver bundle. Driver services are created and registered as services in the framework.

Specified by:
start in interface org.osgi.framework.BundleActivator
Parameters:
bc - this Bundle's BundleContext object
Throws:
java.lang.Exception - if driver instantiation fails

stop

public void stop(org.osgi.framework.BundleContext bc)
Stops the driver bundle. Unregisters drivers and all devices registered by the drivers.

Specified by:
stop in interface org.osgi.framework.BundleActivator
Parameters:
bc - this Bundle's bundle context object

createDrivers

public abstract AbstractDeviceDriver[] createDrivers()
                                              throws java.lang.Exception
Creates the Driver service instances.

Returns:
a set of Driver services provided by the bundle
Throws:
java.lang.Exception - if the driver cannot be created for some reason

Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved