public ServiceEngine createServiceEngine(ServiceDescription serviceDescription,
AxisService axisService,
ResourceLoader resourceLoader) {
//TODO
RuleEngine ruleEngine =
RuleServiceManger.getInstance().getRuleServerManagerService().createRuleEngine(
axisService.getClassLoader());
RuleServiceExtensionDescription extensionDescription =
(RuleServiceExtensionDescription) serviceDescription.getServiceExtensionDescription();
RuleSetDescription ruleSetDescription = extensionDescription.getRuleSetDescription();
Object ruleSource = ruleSetDescription.getRuleSource();
int tenantId = SuperTenantCarbonContext.getCurrentContext(axisService).getTenantId();
if (ruleSource == null) {
Object value = loadRuleScript(axisService.getClassLoader(), ruleSetDescription,
resourceLoader,tenantId);
if (value == null) {
throw new LoggedRuntimeException("Cannot load the rule script from" +
" the " + ruleSetDescription, log);
}
ruleSetDescription.setRuleSource(value);
}
String uri = ruleEngine.addRuleSet(ruleSetDescription);
return new RuleServiceEngine(axisService, ruleEngine, uri);
}