Interface AutoWireStateManager

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
AutoWireStateManagerImpl

public interface AutoWireStateManager extends AutoCloseable
StateManager that enables obtaining ManagedObject objects by their qualifications and types.
Author:
Daniel Sagenschneider
  • Method Details

    • isObjectAvailable

      boolean isObjectAvailable(String qualifier, Class<?> objectType)
      Indicates if the object by auto-wiring is available.
      Parameters:
      qualifier - Qualifier. May be null.
      objectType - Required object type.
      Returns:
      true if the object is available.
    • load

      <O> void load(String qualifier, Class<? extends O> objectType, ObjectUser<O> user) throws UnknownObjectException
      Loads the object from the ManagedObject asynchronously.
      Type Parameters:
      O - Object type.
      Parameters:
      qualifier - Qualifier. May be null.
      objectType - Required object type.
      user - ObjectUser to receive the loaded object (or possible failure).
      Throws:
      UnknownObjectException - If unknown bound object name.
    • getObject

      <O> O getObject(String qualifier, Class<? extends O> objectType, long timeoutInMilliseconds) throws UnknownObjectException, Throwable
      Obtains the object for the ManagedObject synchronously.
      Type Parameters:
      O - Object type.
      Parameters:
      qualifier - Qualifier. May be null.
      objectType - Required object type.
      timeoutInMilliseconds - Time out in milliseconds to wait for the ManagedObject creation.
      Returns:
      Object.
      Throws:
      UnknownObjectException - If unknown bound object name.
      Throwable - If failure in obtaining the bound object.