public final class RuleEngineFactory extends Object
RuleEngine
instance.
The following code snippet illustrate how the API can be used to get RuleEngine
instance,// Get an instance of factory RuleEngineFactory factory = RuleEngineFactory.getInstance(); // Create persistence and configuration // Assuming SDAs of Rules Composer DCs are stored at "c:\sap\rules\sdas\" File sdaLocation = new File("c:\\sap\rules\\sdas\\"); Persistence persistence = new BuildPersistence(sdaLocation); Properties configuration = new Properties(); configuration.setProperty(RuleEngineFactory.POLLING_FREQUENCY,"60000"); // Other properties can be configured as well ..... // Configure factory factory.configure(persistence, configuration); // Get RuleEngine instance RuleEngine engine = factory.getRuleEngine();
Modifier and Type | Field and Description |
---|---|
static String |
BUSINESS_LOG_LEVEL
The string that denotes the "business log level" property of the Rule Engine.
|
static String |
INITIAL_POOLSIZE
The String initial poolsize that denotes the initial pool size capacity of the
Rule Engine.
|
static String |
MAXIMUM_POOLSIZE
The string that denotes the "pool size" property of the Rule Engine.
|
static String |
NETWORK_CACHE_SIZE
The string that denotes the "network cache size" property of the Rule Engine.
|
static String |
POLLING_FREQUENCY
The string that denotes the "polling frequency" property of the Rule Engine.
|
static String |
POOLSIZE_INCREMENT
The String that denotes the "capacity increment of pool size" of the Rule Engine.
|
Modifier and Type | Method and Description |
---|---|
void |
configure(Persistence<?> persistence,
Properties configuration)
Configures the RuleEngine factory with given persistence and configuration.
|
static RuleEngineFactory |
getInstance()
Returns singleton instance of RuleEngine factory.
|
RuleEngine |
getRuleEngine()
Returns RuleEngine instance created using the persistence and configuration provided through
configure(Persistence, Properties) . |
void |
reset()
Resets the RuleEngine factory to configure it with different persistence and configuration.
|
public static final String MAXIMUM_POOLSIZE
Properties props= new Properties(); props.setProperty(RuleEngineFactory.MAXIMUM_POOLSIZE,"10"); // you can set other properties too. ... RuleEngineFactory.getInstance().configure(persistence,props);
public static final String INITIAL_POOLSIZE
Properties props= new Properties(); props.setProperty(RuleEngineFactory.INITIAL_POOLSIZE, "2"); // you can set other properties too. ... RuleEngineFactory.getInstance().configure(persistence,props);
public static final String POOLSIZE_INCREMENT
Properties props= new Properties(); props.setProperty(RuleEngineFactory.POOLSIZE_INCREMENT, "5"); // you can set other properties too. ... RuleEngineFactory.getFactory().setProperties(props);
public static final String NETWORK_CACHE_SIZE
Properties props= new Properties(); props.setProperty(RuleEngineFactory.NETWORK_CACHE_SIZE, "60"); // you can set other properties too. ... RuleEngineFactory.getFactory().setProperties(props);
public static final String POLLING_FREQUENCY
Properties props= new Properties(); props.setProperty(RuleEngineFactory.POLLING_FREQUENCY, "300000"); // you can set other properties too. ... RuleEngineFactory.getFactory().setProperties(props);
public static final String BUSINESS_LOG_LEVEL
public static RuleEngineFactory getInstance()
public void configure(Persistence<?> persistence, Properties configuration) throws RuleException
POLLING_FREQUENCY
,MAXIMUM_POOLSIZE
, INITIAL_POOLSIZE
, POOLSIZE_INCREMENT
and NETWORK_CACHE_SIZE
for the configuration parameters.persistence
- persistence where rulesets are storedconfiguration
- factory configurationRuleException
- Thrown when RuleEngine factory is already configured and at least once getRuleEngine()
was called.public RuleEngine getRuleEngine() throws RuleException
configure(Persistence, Properties)
.
After this method is called, subsequent calls to configure(Persistence, Properties)
will throw RuleException
.RuleException
- Thrown if the RuleEngine factory is not configured using configure(Persistence, Properties)
.public void reset()
Access Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] BRMS-FACADE
|
[sap.com] tc/brms/facade
|
api
|
BC-BMT-BRM-ENG
|
Copyright 2018 SAP AG Complete Copyright Notice