Class DynamicAccess

java.lang.Object
org.apache.pekko.actor.DynamicAccess
Direct Known Subclasses:
ReflectiveDynamicAccess

public abstract class DynamicAccess extends Object
The DynamicAccess implementation is the class which is used for loading all configurable parts of an actor system (the pekko.actor.ReflectiveDynamicAccess is the default implementation).

This is an internal facility and users are not expected to encounter it unless they are extending Pekko in ways which go beyond simple Extensions.

Not for user extension

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract boolean
     
    abstract 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(Class<?> clazz, scala.collection.immutable.Seq<scala.Tuple2<Class<?>,Object>> args, scala.reflect.ClassTag<T> evidence$1)
    Convenience method which given a Class[_] object and a constructor description will create a new instance of that class.
    abstract <T> scala.util.Try<T>
    createInstanceFor(String fqcn, scala.collection.immutable.Seq<scala.Tuple2<Class<?>,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<Class<? extends T>>
    getClassFor(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(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 Details

    • DynamicAccess

      public DynamicAccess()
  • Method Details

    • classIsOnClasspath

      public abstract boolean classIsOnClasspath(String fqcn)
    • classLoader

      public abstract 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).
    • createInstanceFor

      public abstract <T> scala.util.Try<T> createInstanceFor(Class<?> clazz, scala.collection.immutable.Seq<scala.Tuple2<Class<?>,Object>> args, scala.reflect.ClassTag<T> evidence$1)
      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))
       
    • createInstanceFor

      public abstract <T> scala.util.Try<T> createInstanceFor(String fqcn, scala.collection.immutable.Seq<scala.Tuple2<Class<?>,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.
    • getClassFor

      public abstract <T> scala.util.Try<Class<? extends T>> getClassFor(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).
    • getObjectFor

      public abstract <T> scala.util.Try<T> getObjectFor(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.