[rules-users] CPU Spike creating a StatefulKnowledgeSession using OSGi

Barry Knapp barry.knapp at railinc.com
Tue Jan 10 09:17:57 EST 2012


I've seen similar issues and addressed it by overriding
ChainedProperties.getResources with a map to hold the enumeration once it is
found rather than constantly going back to the classloader-


	Map<String, Enumeration&lt;URL>> resourceMap = new TreeMap<String,
Enumeration&lt;URL>>();
	private Enumeration<URL> getResources(String name, ClassLoader classLoader)
{

		if (resourceMap.containsKey(name)) {
			return resourceMap.get(name);
		}
		Enumeration<URL> enumeration = null;
		try {
			enumeration = classLoader.getResources(name);
		} catch (IOException e) {
			e.printStackTrace();
		}
		resourceMap.put(name, enumeration);
		return enumeration;

	}

--
View this message in context: http://drools.46999.n3.nabble.com/CPU-Spike-creating-a-StatefulKnowledgeSession-using-OSGi-tp1053579p3647726.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list