-
Notifications
You must be signed in to change notification settings - Fork 0
/
dynamic_access.go
17 lines (14 loc) · 1.12 KB
/
dynamic_access.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// GNU GPL v3 License
// Copyright (c) 2017 github.com:iTrellis
package classloader
import "reflect"
// The DynamicAccess implementation is the class which is used for loading all configurable parts of an actor system (the ReflectiveDynamicAccess is the default implementation).
// This is an internal facility and users are not expected to encounter it unless they are extending Akka in ways which go beyond simple Extensions.
type DynamicAccess interface {
// Convenience method which given a Class[_] object and a constructor description will create a new instance of that class.
CreateInstanceByType(typ reflect.Type, args ...interface{}) (ins interface{}, err error)
// 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.
CreateInstanceByName(name string, args ...interface{}) (ins interface{}, err error)
// Obtain a Class[_] object loaded with the right class loader (i.e. the one returned by classLoader).
GetClassFor(name string) (reflect.Type, bool)
}