Class ClassStandAlone


  • public class ClassStandAlone
    extends java.lang.Object

    Loads Class via ClassManagedObjectSource for stand alone use.

    This is typically for unit testing of the Class with mock injections.

    Author:
    Daniel Sagenschneider
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassStandAlone()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T create​(java.lang.Class<T> clazz)
      Instantiates the objects and injects the dependencies.
      <T,​I extends T>
      void
      registerDependency​(java.lang.Class<T> type, I dependency)
      Registers an unqualified dependency for a dependency type.
      void registerDependency​(java.lang.Object dependency)
      Registers an unqualified dependency for concrete type.
      <T,​I extends T>
      void
      registerDependency​(java.lang.String qualifier, java.lang.Class<T> type, I dependency)
      Registers a dependency for a dependency type.
      void registerDependency​(java.lang.String qualifier, java.lang.Object dependency)
      Registers a qualified dependency for concrete type.
      void registerFlow​(java.lang.String flowName, InvokedProcessServicer servicer)
      Registers an invoked Flow (process).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassStandAlone

        public ClassStandAlone()
    • Method Detail

      • registerDependency

        public void registerDependency​(java.lang.Object dependency)
        Registers an unqualified dependency for concrete type.
        Parameters:
        dependency - Dependency.
      • registerDependency

        public void registerDependency​(java.lang.String qualifier,
                                       java.lang.Object dependency)
        Registers a qualified dependency for concrete type.
        Parameters:
        qualifier - Qualifier.
        dependency - Dependency.
      • registerDependency

        public <T,​I extends T> void registerDependency​(java.lang.Class<T> type,
                                                             I dependency)
        Registers an unqualified dependency for a dependency type.
        Type Parameters:
        T - Dependency type.
        I - Implementation type.
        Parameters:
        type - Dependency type.
        dependency - Implementing dependency.
      • registerDependency

        public <T,​I extends T> void registerDependency​(java.lang.String qualifier,
                                                             java.lang.Class<T> type,
                                                             I dependency)
        Registers a dependency for a dependency type.
        Type Parameters:
        T - Dependency type.
        I - Implementation type.
        Parameters:
        qualifier - Qualifier.
        type - Dependency type.
        dependency - Implementing dependency.
      • create

        public <T> T create​(java.lang.Class<T> clazz)
                     throws java.lang.Throwable
        Instantiates the objects and injects the dependencies.
        Type Parameters:
        T - Object type.
        Parameters:
        clazz - Object Class.
        Returns:
        Instantiated object with dependencies injected.
        Throws:
        java.lang.Throwable - If fails to create.