Class PrimaryObjectSupplier

java.lang.Object
org.eclipse.e4.core.di.suppliers.PrimaryObjectSupplier

public abstract class PrimaryObjectSupplier extends Object
The base class for an "object supplier" - something that knows how to instantiate objects corresponding to the object descriptor.

If supplier is asked to track changes, it should notify requestor whenever any of the objects produced by the get(IObjectDescriptor[], Object[], IRequestor, boolean, boolean, boolean) method change. The supplier can do this by performing calls to the IRequestor.resolveArguments(boolean) and IRequestor.execute().

Since:
1.7
See Also:
  • Constructor Details

    • PrimaryObjectSupplier

      public PrimaryObjectSupplier()
      Default constructor
  • Method Details

    • get

      public abstract void get(IObjectDescriptor[] descriptors, Object[] actualValues, IRequestor requestor, boolean initial, boolean track, boolean group)
      This method is called by the dependency injection mechanism to obtain objects corresponding to the object descriptors. If the supplier is asked to track changes, it should notify requestor whenever it detects a change that would result in a different result produced by this method.
      Parameters:
      descriptors - descriptors to the objects requested by the requestor
      actualValues - the values of actual arguments computed so far for the descriptors (in/out)
      requestor - the requestor originating this request
      initial - true true if this is the initial request from the requestor
      track - true if the object suppliers should notify requestor of changes to the returned objects; false otherwise
      group - true if the change notifications can be grouped; false otherwise
    • pauseRecording

      public abstract void pauseRecording()
      Pause tracking access to the supplier's objects.
    • resumeRecording

      public abstract void resumeRecording()
      Resume tracking access to the supplier's objects.
    • makeReference

      public WeakReference<Object> makeReference(Object object)
      Creates a new reference to the object.

      Suppliers may override to provide improved memory management, for instance, by to tracking references with reference queues.

      Parameters:
      object - the referred object
      Returns:
      a new weak reference to the object