It became evident that Drools caches ClassLoaders by default.
The problem that showcased this was that on redeploy of the business_rules* quickstarts, none of the LHS of the DRL rules were matching. When we deploy a new ESB archive, there is a new ClassLoader. However Drools was holding onto the old ClassLoader. Because an Object is only ever "equal" to another Object if it came from the same ClassLoader, none of the Objects on the LHS matched the expression.
Two things need to happen to fix this problem:
1. KnowledgeBuilderConfigurations need to be created with a Properties argument containing ClassLoaderCacheOption.PROPERTY_NAME="false".
2. KnowledgeBuilderConfigurations need to be created with a ClassLoader argument containing a custom ESB ClassLoader, which under-the-hood uses the LifecycleResource mechanism to associate the original Thread ContextClassLoader (the deployment's ClassLoader) with calls to loadClass(), findResource(), etc. Luckily most of what is needed here already exists in the DroolsRuleAgentHelper code.