Package org.eclipse.e4.core.contexts
Class EclipseContextFactory
- java.lang.Object
-
- org.eclipse.e4.core.contexts.EclipseContextFactory
-
public final class EclipseContextFactory extends Object
This factory is used to create new context instances.- Since:
- 1.3
- See Also:
IEclipseContext
-
-
Constructor Summary
Constructors Constructor Description EclipseContextFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IEclipseContext
create()
Creates and returns a new empty context.static IEclipseContext
create(String name)
Creates and returns a new empty context.static IEclipseContext
createServiceContext(BundleContext bundleContext)
Creates and returns a new context that can be used to lookup OSGi services.static IEclipseContext
getServiceContext(BundleContext bundleContext)
Returns a context that can be used to lookup OSGi services.
-
-
-
Method Detail
-
create
public static IEclipseContext create()
Creates and returns a new empty context.- Returns:
- A new empty context.
-
create
public static IEclipseContext create(String name)
Creates and returns a new empty context.- Returns:
- A new empty context.
-
getServiceContext
public static IEclipseContext getServiceContext(BundleContext bundleContext)
Returns a context that can be used to lookup OSGi services. A client must never dispose the provided context, because it may be shared by multiple callers.- Parameters:
bundleContext
- The bundle context to use for service lookup- Returns:
- A context containing all OSGi services
-
createServiceContext
public static IEclipseContext createServiceContext(BundleContext bundleContext)
Creates and returns a new context that can be used to lookup OSGi services. A client must dispose the provided context.- Parameters:
bundleContext
- The bundle context to use for service lookup- Returns:
- A new context containing all OSGi services
- Since:
- 1.5
-
-