org.eclipse.osgi.framework.internal.core
Class OSGi

java.lang.Object
  extended by org.eclipse.osgi.framework.internal.core.OSGi

public class OSGi
extends java.lang.Object

Main class for the OSGi framework. This class is used to start the framework for production use. Objects of this class represent an instance of the OSGi framework and can be used to control the framework.


Field Summary
protected  Framework framework
           
 
Constructor Summary
OSGi(FrameworkAdaptor adaptor)
          Constructs an OSGi object with the specified FrameworkAdaptor.
 
Method Summary
 void close()
          Destroy the OSGi framework.
protected  Framework createFramework(FrameworkAdaptor adaptor)
          Create the internal framework object.
protected  void displayBanner()
          Display the banner to System.out.
 BundleContext getBundleContext()
          Retrieve the BundleContext for the system bundle.
 boolean isActive()
          This method returns the state of the OSGi framework.
 void launch()
          Start the framework.
 void shutdown()
          Stop the framework.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

framework

protected Framework framework
Constructor Detail

OSGi

public OSGi(FrameworkAdaptor adaptor)
Constructs an OSGi object with the specified FrameworkAdaptor. This method creates an OSGi framework.

Parameters:
adaptor - An adaptor object for the framework to use.
Method Detail

close

public void close()
Destroy the OSGi framework. This method stops the framework if it has been started. All resources associated with the framework are release and the OSGi object is no longer usable.


launch

public void launch()
Start the framework. The framework is started as described in the OSGi Framework specification.


shutdown

public void shutdown()
Stop the framework. The framework is stopped as described in the OSGi Framework specification.


isActive

public boolean isActive()
This method returns the state of the OSGi framework.

Returns:
true of the framework is launched, false if shutdown.

getBundleContext

public BundleContext getBundleContext()
Retrieve the BundleContext for the system bundle.

Returns:
The system bundle's BundleContext.

createFramework

protected Framework createFramework(FrameworkAdaptor adaptor)
Create the internal framework object. This method can be overridden to create a secure framework.

Parameters:
adaptor - FrameworkAdaptor object for the framework.
Returns:
New Framework object.

displayBanner

protected void displayBanner()
Display the banner to System.out.