Class LoadedFunctionPackage
- java.lang.Object
-
- org.apache.pulsar.functions.utils.LoadedFunctionPackage
-
- All Implemented Interfaces:
ValidatableFunctionPackage
public class LoadedFunctionPackage extends java.lang.Object implements ValidatableFunctionPackage
LoadedFunctionPackage is a class that represents a function package and implements the ValidatableFunctionPackage interface which decouples the function package from classloading. This implementation is backed by a ClassLoader, and it is used when the function package is already loaded by a ClassLoader. This is the case in the LocalRunner and in some of the unit tests.
-
-
Constructor Summary
Constructors Constructor Description LoadedFunctionPackage(java.lang.ClassLoader classLoader, java.lang.Class<?> configMetadataClass)LoadedFunctionPackage(java.lang.ClassLoader classLoader, java.lang.Class<T> configMetadataClass, T configMetadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ClassLoadergetClassLoader()Returns the classloader for the function package.<T> TgetFunctionMetaData(java.lang.Class<T> clazz)Returns the function or connector definition metadata.net.bytebuddy.pool.TypePoolgetTypePool()Returns the Byte Buddy TypePool instance for the function package.booleanisEnableClassloading()Returns if classloading is enabled for the function package.net.bytebuddy.description.type.TypeDescriptionresolveType(java.lang.String className)Resolves the type description for the given class name within the function package.
-
-
-
Method Detail
-
resolveType
public net.bytebuddy.description.type.TypeDescription resolveType(java.lang.String className)
Description copied from interface:ValidatableFunctionPackageResolves the type description for the given class name within the function package.- Specified by:
resolveTypein interfaceValidatableFunctionPackage
-
getTypePool
public net.bytebuddy.pool.TypePool getTypePool()
Description copied from interface:ValidatableFunctionPackageReturns the Byte Buddy TypePool instance for the function package.- Specified by:
getTypePoolin interfaceValidatableFunctionPackage
-
getFunctionMetaData
public <T> T getFunctionMetaData(java.lang.Class<T> clazz)
Description copied from interface:ValidatableFunctionPackageReturns the function or connector definition metadata. Supports FunctionDefinition and ConnectorDefinition as the metadata type.- Specified by:
getFunctionMetaDatain interfaceValidatableFunctionPackage
-
isEnableClassloading
public boolean isEnableClassloading()
Description copied from interface:ValidatableFunctionPackageReturns if classloading is enabled for the function package.- Specified by:
isEnableClassloadingin interfaceValidatableFunctionPackage
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Description copied from interface:ValidatableFunctionPackageReturns the classloader for the function package. The classloader is lazily initialized when classloading is enabled.- Specified by:
getClassLoaderin interfaceValidatableFunctionPackage
-
-