com.squeakysand.osgi.framework
Class BasicBundleActivator

java.lang.Object
  extended by com.squeakysand.osgi.framework.BasicBundleActivator
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public class BasicBundleActivator
extends Object
implements org.osgi.framework.BundleActivator

Simple BundleActivator that logs start and stop events, and holds on to a reference to the BundleContext object.

Author:
Craig S. Dickson

Constructor Summary
BasicBundleActivator()
          Creates a BasicBundleActivator instance that logs using its own logger.
BasicBundleActivator(Logger logger)
          Creates a BasicBundleActivator instance that logs using the supplied logger.
 
Method Summary
 org.osgi.framework.BundleContext getContext()
          Accessor for the BundleContext object associated with this BundleActivator.
 void start(org.osgi.framework.BundleContext context)
           
 void stop(org.osgi.framework.BundleContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicBundleActivator

public BasicBundleActivator()
Creates a BasicBundleActivator instance that logs using its own logger.


BasicBundleActivator

public BasicBundleActivator(Logger logger)
Creates a BasicBundleActivator instance that logs using the supplied logger.

Parameters:
logger - the Logger instance to use, cannot be null.
Method Detail

start

public void start(org.osgi.framework.BundleContext context)
           throws Exception
Specified by:
start in interface org.osgi.framework.BundleActivator
Throws:
Exception

stop

public void stop(org.osgi.framework.BundleContext context)
          throws Exception
Specified by:
stop in interface org.osgi.framework.BundleActivator
Throws:
Exception

getContext

public org.osgi.framework.BundleContext getContext()
Accessor for the BundleContext object associated with this BundleActivator.

Returns:
the BundleContext object supplied when the start(BundleContext) method was called.


Copyright 2010-2012 Craig S. Dickson (http://craigsdickson.com)