Interface AutoWireStateManager

  • All Superinterfaces:
    java.lang.AutoCloseable
    All Known Implementing Classes:
    AutoWireStateManagerImpl

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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <O> O getObject​(java.lang.String qualifier, java.lang.Class<? extends O> objectType, long timeoutInMilliseconds)
      Obtains the object for the ManagedObject synchronously.
      boolean isObjectAvailable​(java.lang.String qualifier, java.lang.Class<?> objectType)
      Indicates if the object by auto-wiring is available.
      <O> void load​(java.lang.String qualifier, java.lang.Class<? extends O> objectType, ObjectUser<O> user)
      Loads the object from the ManagedObject asynchronously.
      • Methods inherited from interface java.lang.AutoCloseable

        close
    • Method Detail

      • isObjectAvailable

        boolean isObjectAvailable​(java.lang.String qualifier,
                                  java.lang.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​(java.lang.String qualifier,
                      java.lang.Class<? extends O> objectType,
                      ObjectUser<O> user)
               throws UnknownObjectException
        Loads the object from the ManagedObject asynchronously.
        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​(java.lang.String qualifier,
                        java.lang.Class<? extends O> objectType,
                        long timeoutInMilliseconds)
                 throws UnknownObjectException,
                        java.lang.Throwable
        Obtains the object for the ManagedObject synchronously.
        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.
        java.lang.Throwable - If failure in obtaining the bound object.