@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { try { configFileURL = applicationContext.getResource("classpath:/").getURL(); } catch (Exception e) { e.printStackTrace(); } }
private InternalKieModule createOsgiKModule(KieModuleModel kieProject) { Method m; try { Class<?> c = Class.forName( ClasspathKieProject.OSGI_KIE_MODULE_CLASS_NAME, true, KieBuilderImpl.class.getClassLoader()); m = c.getMethod("create", URL.class, ReleaseId.class, KieModuleModel.class); } catch (Exception e) { throw new RuntimeException( "It is necessary to have the drools-osgi-integration module on the path in order to create a KieProject from an ogsi bundle", e); } try { return (InternalKieModule) m.invoke(null, configFileURL, releaseId, kieProject); } catch (Exception e) { throw new RuntimeException( "Failure creating a OsgiKieModule caused by: " + e.getMessage(), e); } }