Package org.jbpm.executor.impl
Class ClassCacheManager
- java.lang.Object
-
- org.jbpm.executor.impl.ClassCacheManager
-
public class ClassCacheManager extends Object
Simple cache to keep classes of commands and callback to not attempt to load them every time.
-
-
Constructor Summary
Constructors Constructor Description ClassCacheManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.kie.api.executor.CommandCallback>buildCommandCallback(org.kie.api.executor.CommandContext ctx, ClassLoader cl)Builds completely initialized list of callbacks for given context.protected voidcloseInstance(Object instance)voiddispose()org.kie.api.executor.CommandfindCommand(String name, ClassLoader cl)Finds command by FQCN and if not found loads the class and store the instance in the cache.org.kie.api.executor.CommandCallbackfindCommandCallback(String name, ClassLoader cl)Finds command callback by FQCN and if not found loads the class and store the instance in the cache.
-
-
-
Method Detail
-
findCommand
public org.kie.api.executor.Command findCommand(String name, ClassLoader cl)
Finds command by FQCN and if not found loads the class and store the instance in the cache.- Parameters:
name- - fully qualified class name of the command- Returns:
- initialized class instance
-
findCommandCallback
public org.kie.api.executor.CommandCallback findCommandCallback(String name, ClassLoader cl)
Finds command callback by FQCN and if not found loads the class and store the instance in the cache.- Parameters:
name- - fully qualified class name of the command callback- Returns:
- initialized class instance
-
buildCommandCallback
public List<org.kie.api.executor.CommandCallback> buildCommandCallback(org.kie.api.executor.CommandContext ctx, ClassLoader cl)
Builds completely initialized list of callbacks for given context.- Parameters:
ctx- contextual data given by execution service- Returns:
-
closeInstance
protected void closeInstance(Object instance)
-
dispose
public void dispose()
-
-