OSGi™ Service Platform
Release 4 Version 4.2

org.osgi.application
Class Framework

java.lang.Object
  extended by org.osgi.application.Framework

public final class Framework
extends java.lang.Object

Using this class, OSGi-aware applications can obtain their ApplicationContext.


Method Summary
static ApplicationContext getApplicationContext(java.lang.Object applicationInstance)
          This method needs an argument, an object that represents the application instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getApplicationContext

public static ApplicationContext getApplicationContext(java.lang.Object applicationInstance)
This method needs an argument, an object that represents the application instance. An application consists of a set of object, however there is a single object, which is used by the corresponding application container to manage the lifecycle on the application instance. The lifetime of this object equals the lifetime of the application instance; therefore, it is suitable to represent the instance.

The returned ApplicationContext object is singleton for the specified application instance. Subsequent calls to this method with the same application instance must return the same context object

Parameters:
applicationInstance - is the activator object of an application instance
Returns:
the ApplicationContext of the specified application instance.
Throws:
java.lang.NullPointerException - If applicationInstance is null
java.lang.IllegalArgumentException - if called with an object that is not the activator object of an application.

OSGi™ Service Platform
Release 4 Version 4.2

Copyright © OSGi Alliance (2000, 2010). All Rights Reserved. Licensed under the OSGi Specification License, Version 1.0