Package akka.actor

Class DynamicAccess

  • Direct Known Subclasses:
    ReflectiveDynamicAccess

    public abstract class DynamicAccess
    extends java.lang.Object
    Convenience method which given a Class[_] object and a constructor description will create a new instance of that class.

    
     val obj = DynamicAccess.createInstanceFor(clazz, Seq(classOf[Config] -> config, classOf[String] -> name))
     
    • Constructor Summary

      Constructors 
      Constructor Description
      DynamicAccess()  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract boolean classIsOnClasspath​(java.lang.String fqcn)  
      abstract java.lang.ClassLoader classLoader()
      This is the class loader to be used in those special cases where the other factory method are not applicable (e.g.
      abstract <T> scala.util.Try<T> createInstanceFor​(java.lang.Class<?> clazz, scala.collection.immutable.Seq<scala.Tuple2<java.lang.Class<?>,​java.lang.Object>> args, scala.reflect.ClassTag<T> evidence$1)  
      abstract <T> scala.util.Try<T> createInstanceFor​(java.lang.String fqcn, scala.collection.immutable.Seq<scala.Tuple2<java.lang.Class<?>,​java.lang.Object>> args, scala.reflect.ClassTag<T> evidence$3)
      Obtain an object conforming to the type T, which is expected to be instantiated from a class designated by the fully-qualified class name given, where the constructor is selected and invoked according to the args argument.
      abstract <T> scala.util.Try<java.lang.Class<? extends T>> getClassFor​(java.lang.String fqcn, scala.reflect.ClassTag<T> evidence$2)
      Obtain a Class[_] object loaded with the right class loader (i.e.
      abstract <T> scala.util.Try<T> getObjectFor​(java.lang.String fqcn, scala.reflect.ClassTag<T> evidence$4)
      Obtain the Scala &ldquo;object&rdquo; instance for the given fully-qualified class name, if there is one.
      • Methods inherited from class java.lang.Object

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

      • DynamicAccess

        public DynamicAccess()
    • Method Detail

      • classIsOnClasspath

        public abstract boolean classIsOnClasspath​(java.lang.String fqcn)
      • classLoader

        public abstract java.lang.ClassLoader classLoader()
        This is the class loader to be used in those special cases where the other factory method are not applicable (e.g. when constructing a ClassLoaderBinaryInputStream).
        Returns:
        (undocumented)
      • createInstanceFor

        public abstract <T> scala.util.Try<T> createInstanceFor​(java.lang.Class<?> clazz,
                                                                scala.collection.immutable.Seq<scala.Tuple2<java.lang.Class<?>,​java.lang.Object>> args,
                                                                scala.reflect.ClassTag<T> evidence$1)
      • createInstanceFor

        public abstract <T> scala.util.Try<T> createInstanceFor​(java.lang.String fqcn,
                                                                scala.collection.immutable.Seq<scala.Tuple2<java.lang.Class<?>,​java.lang.Object>> args,
                                                                scala.reflect.ClassTag<T> evidence$3)
        Obtain an object conforming to the type T, which is expected to be instantiated from a class designated by the fully-qualified class name given, where the constructor is selected and invoked according to the args argument. The exact usage of args depends on which type is requested, see the relevant requesting code for details.
        Parameters:
        fqcn - (undocumented)
        args - (undocumented)
        evidence$3 - (undocumented)
        Returns:
        (undocumented)
      • getClassFor

        public abstract <T> scala.util.Try<java.lang.Class<? extends T>> getClassFor​(java.lang.String fqcn,
                                                                                     scala.reflect.ClassTag<T> evidence$2)
        Obtain a Class[_] object loaded with the right class loader (i.e. the one returned by classLoader).
        Parameters:
        fqcn - (undocumented)
        evidence$2 - (undocumented)
        Returns:
        (undocumented)
      • getObjectFor

        public abstract <T> scala.util.Try<T> getObjectFor​(java.lang.String fqcn,
                                                           scala.reflect.ClassTag<T> evidence$4)
        Obtain the Scala &ldquo;object&rdquo; instance for the given fully-qualified class name, if there is one.
        Parameters:
        fqcn - (undocumented)
        evidence$4 - (undocumented)
        Returns:
        (undocumented)