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:
  • Constructor Details

    • EclipseContextFactory

      public EclipseContextFactory()
  • Method Details

    • 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
    • getServiceContext

      public static IEclipseContext getServiceContext(Class<?> contextClass)
      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:
      contextClass - The class that is used as a context to use for service lookup
      Returns:
      A context containing all OSGi services
      Since:
      1.10
    • 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