- java.lang.Object
-
- com.pervasive.datarush.modules.Modules
-
public class Modules extends Object
-
-
Constructor Summary
Constructors Constructor Description Modules()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
newInstance(Class<T> interfaze, Module module, String className)
Create a new instance of an object within a module.static <T> T
rawInstance(Class<T> interfaze, Module module, String className)
Create a new instance of an object within a module.static <T> T
wrapInstance(Class<T> interfaze, T instance)
Wrap an object created in the context of a Shim interface with the context class loader proxy.
-
-
-
Method Detail
-
newInstance
public static <T> T newInstance(Class<T> interfaze, Module module, String className)
Create a new instance of an object within a module. The object is expected to take a constructor of typeModule
. The returned instance will be a proxy onto the underlying class.- Parameters:
interfaze
-module
-className
-- Returns:
-
wrapInstance
public static <T> T wrapInstance(Class<T> interfaze, T instance)
Wrap an object created in the context of a Shim interface with the context class loader proxy. The proxy handles setting the context class loader whenever a method of the given object is invoked. This is needed for Shim methods that return objects that expose methods the Shim user calls.- Parameters:
interfaze
- the interface type of the classinstance
- an instance of the class already created- Returns:
- a wrapped instance of the class (wrapped with the context class loader proxy)
-
rawInstance
public static <T> T rawInstance(Class<T> interfaze, Module module, String className)
Create a new instance of an object within a module. The object is expected to take a constructor of typeModule
. The returned instance will not be a proxy.- Parameters:
interfaze
-module
-className
-- Returns:
-
-