Class InstanceInitiator
java.lang.Object
com.beassolution.rule.engine.InstanceInitiator
Component for dynamically loading and instantiating helper classes.
This class is responsible for loading helper classes from JAR files and creating instances of them for use in rule execution. It uses ClassGraph to scan JAR files and dynamically load classes.
Key features include:
- Dynamic JAR file loading
- Class scanning and instantiation
- Package-based class filtering
- Error handling for instantiation failures
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Beas Solution Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate
(RuleHelper helper) Creates instances of helper classes from a JAR file.
-
Constructor Details
-
InstanceInitiator
public InstanceInitiator()
-
-
Method Details
-
create
Creates instances of helper classes from a JAR file.This method loads a JAR file from the specified URL and creates instances of all concrete classes in the specified package path. The instances are returned as a map with class names as keys.
- Parameters:
helper
- The rule helper configuration containing JAR URL and package path- Returns:
- Map of class names to instantiated objects
- Throws:
OperationException
- if loading or instantiation fails
-