org.objectweb.dsrg.sofa.osgi
Class Framework

java.lang.Object
  extended by org.objectweb.dsrg.sofa.osgi.Framework

public class Framework
extends java.lang.Object

The OSGi Framework wrapper

This class respresents the embedded OSGi Framework. It uses the Apache Felix as the Framework implementation.


Method Summary
 RegistrationListener addRegistrationListener(java.lang.String bundle, RegistrationListener listener)
          Adds a RegistrationListener
 java.lang.Object clone()
          clone method, prevents cloning
 org.osgi.framework.BundleContext getContext()
          Get the execution context
static Framework getInstance()
          Return the singleton Framework instance
 RegistrationListener getRegistrationListener(java.lang.String bundle)
          Get a RegistrationListener for a bundle name
 RegistrationListener removeRegistrationListener(java.lang.String bundle)
          Remove a RegistrationListener for a bundle name
 void shutdown()
          Shuts down the embedded OSGi Framework
 boolean startup()
          Starts an embedded OSGi Framework
 boolean startup(org.osgi.framework.BundleActivator[] activators)
          Starts an embedded OSGi Framework
 java.lang.String toString()
          toString method
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static Framework getInstance()
Return the singleton Framework instance

Returns:
the Framework instance

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
clone method, prevents cloning

Overrides:
clone in class java.lang.Object
Returns:
object
Throws:
java.lang.CloneNotSupportedException

startup

public boolean startup()
Starts an embedded OSGi Framework

Returns:
true if success, false otherwise

startup

public boolean startup(org.osgi.framework.BundleActivator[] activators)
Starts an embedded OSGi Framework

Parameters:
activators - list of activators
Returns:
true if success, false otherwise

shutdown

public void shutdown()
Shuts down the embedded OSGi Framework


getContext

public org.osgi.framework.BundleContext getContext()
Get the execution context

Returns:
the SystemBundle's context

addRegistrationListener

public RegistrationListener addRegistrationListener(java.lang.String bundle,
                                                    RegistrationListener listener)
Adds a RegistrationListener

Parameters:
bundle - bundle name
listener - RegistrationListener bundle
Returns:
RegistrationListener bundle if added, null otherwise

getRegistrationListener

public RegistrationListener getRegistrationListener(java.lang.String bundle)
Get a RegistrationListener for a bundle name

Parameters:
bundle - bundle name
Returns:
RegistrationListener bundle if found, null otherwise

removeRegistrationListener

public RegistrationListener removeRegistrationListener(java.lang.String bundle)
Remove a RegistrationListener for a bundle name

Parameters:
bundle - bundle name
Returns:
RegistrationListener bundle if removed, null otherwise

toString

public java.lang.String toString()
toString method

Overrides:
toString in class java.lang.Object
Returns:
The Felix version information