Package org.drools.core.rule
Class JavaDialectRuntimeData
- java.lang.Object
-
- org.drools.core.rule.JavaDialectRuntimeData
-
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,DialectRuntimeData
public class JavaDialectRuntimeData extends Object implements DialectRuntimeData, Externalizable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JavaDialectRuntimeData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DialectRuntimeDataclone(DialectRuntimeRegistry registry, ClassLoader rootClassLoader)DialectRuntimeDataclone(DialectRuntimeRegistry registry, ClassLoader rootClassLoader, boolean excludeClasses)byte[]getBytecode(String resourceName)byte[]getClassDefinition(String className)ClassLoadergetClassLoader()ClassLoadergetRootClassLoader()Map<String,byte[]>getStore()booleanisDirty()voidmerge(DialectRuntimeRegistry registry, DialectRuntimeData newData)voidmerge(DialectRuntimeRegistry registry, DialectRuntimeData newData, boolean excludeClasses)voidonAdd(DialectRuntimeRegistry registry, ClassLoader rootClassLoader)voidonBeforeExecute()voidonRemove()voidputAllClassDefinitions(Map classDefinitions)voidputAllInvokers(Map<String,Wireable> invokers)voidputClassDefinition(String className, byte[] classDef)voidputInvoker(String className, Wireable invoker)byte[]read(String resourceName)voidreadExternal(ObjectInput stream)Handles the read serialization of the PackageCompilationData.voidreload()This class drops the classLoader and reloads it.booleanremove(String resourceName)voidremoveFunction(KnowledgePackageImpl pkg, Function function)voidremoveRule(KnowledgePackageImpl pkg, RuleImpl rule)voidsetDirty(boolean dirty)StringtoString()voidwrite(String resourceName, byte[] clazzData)voidwriteExternal(ObjectOutput stream)Handles the write serialization of the PackageCompilationData.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.rule.DialectRuntimeData
compile, resetParserConfiguration
-
-
-
-
Method Detail
-
writeExternal
public void writeExternal(ObjectOutput stream) throws IOException
Handles the write serialization of the PackageCompilationData. Patterns in Rules may reference generated data which cannot be serialized by default methods. The PackageCompilationData holds a reference to the generated bytecode. The generated bytecode must be restored before any Rules.- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput stream) throws IOException, ClassNotFoundException
Handles the read serialization of the PackageCompilationData. Patterns in Rules may reference generated data which cannot be serialized by default methods. The PackageCompilationData holds a reference to the generated bytecode; which must be restored before any Rules. A custom ObjectInputStream, able to resolve classes against the bytecode, is used to restore the Rules.- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
onAdd
public void onAdd(DialectRuntimeRegistry registry, ClassLoader rootClassLoader)
- Specified by:
onAddin interfaceDialectRuntimeData
-
onRemove
public void onRemove()
- Specified by:
onRemovein interfaceDialectRuntimeData
-
onBeforeExecute
public void onBeforeExecute()
- Specified by:
onBeforeExecutein interfaceDialectRuntimeData
-
clone
public DialectRuntimeData clone(DialectRuntimeRegistry registry, ClassLoader rootClassLoader)
- Specified by:
clonein interfaceDialectRuntimeData
-
clone
public DialectRuntimeData clone(DialectRuntimeRegistry registry, ClassLoader rootClassLoader, boolean excludeClasses)
- Specified by:
clonein interfaceDialectRuntimeData
-
merge
public void merge(DialectRuntimeRegistry registry, DialectRuntimeData newData)
- Specified by:
mergein interfaceDialectRuntimeData
-
merge
public void merge(DialectRuntimeRegistry registry, DialectRuntimeData newData, boolean excludeClasses)
- Specified by:
mergein interfaceDialectRuntimeData
-
isDirty
public boolean isDirty()
- Specified by:
isDirtyin interfaceDialectRuntimeData
-
setDirty
public void setDirty(boolean dirty)
- Specified by:
setDirtyin interfaceDialectRuntimeData
-
getBytecode
public byte[] getBytecode(String resourceName)
-
getClassLoader
public ClassLoader getClassLoader()
-
getRootClassLoader
public ClassLoader getRootClassLoader()
-
removeRule
public void removeRule(KnowledgePackageImpl pkg, RuleImpl rule)
- Specified by:
removeRulein interfaceDialectRuntimeData
-
removeFunction
public void removeFunction(KnowledgePackageImpl pkg, Function function)
- Specified by:
removeFunctionin interfaceDialectRuntimeData
-
read
public byte[] read(String resourceName)
-
write
public void write(String resourceName, byte[] clazzData)
-
remove
public boolean remove(String resourceName)
-
reload
public void reload()
This class drops the classLoader and reloads it. During this process it must re-wire all the invokeables.- Specified by:
reloadin interfaceDialectRuntimeData
-
putClassDefinition
public void putClassDefinition(String className, byte[] classDef)
-
putAllClassDefinitions
public void putAllClassDefinitions(Map classDefinitions)
-
getClassDefinition
public byte[] getClassDefinition(String className)
-
-