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
|
Method Summary |
void |
clear()
|
DialectRuntimeData |
clone(DialectRuntimeRegistry registry,
ClassLoader rootClassLoader)
|
DialectRuntimeData |
clone(DialectRuntimeRegistry registry,
ClassLoader rootClassLoader,
boolean excludeClasses)
|
byte[] |
getBytecode(String resourceName)
|
byte[] |
getClassDefinition(String className)
|
Map<String,byte[]> |
getClassDefinitions()
|
ClassLoader |
getClassLoader()
|
Map<String,Object> |
getInvokers()
|
ClassLoader |
getRootClassLoader()
|
Map<String,byte[]> |
getStore()
|
boolean |
isDirty()
|
String[] |
list()
|
void |
merge(DialectRuntimeRegistry registry,
DialectRuntimeData newData)
|
void |
merge(DialectRuntimeRegistry registry,
DialectRuntimeData newData,
boolean excludeClasses)
|
void |
onAdd(DialectRuntimeRegistry registry,
ClassLoader rootClassLoader)
|
void |
onBeforeExecute()
|
void |
onRemove()
|
void |
putAllClassDefinitions(Map classDefinitions)
|
void |
putAllInvokers(Map<String,Object> invokers)
|
void |
putClassDefinition(String className,
byte[] classDef)
|
void |
putInvoker(String className,
Object invoker)
|
byte[] |
read(String resourceName)
|
void |
readExternal(ObjectInput stream)
Handles the read serialization of the PackageCompilationData. |
void |
reload()
This class drops the classLoader and reloads it. |
boolean |
remove(String resourceName)
|
void |
removeClassDefinition(String className)
|
void |
removeFunction(Package pkg,
Function function)
|
void |
removeInvoker(String className)
|
void |
removeRule(Package pkg,
Rule rule)
|
void |
setDirty(boolean dirty)
|
String |
toString()
|
void |
wire(String className)
|
void |
wire(String className,
Object invoker)
|
void |
write(String resourceName,
byte[] clazzData)
|
void |
writeExternal(ObjectOutput stream)
Handles the write serialization of the PackageCompilationData. |
JavaDialectRuntimeData
public JavaDialectRuntimeData()
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:
writeExternal in interface Externalizable
- 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:
readExternal in interface Externalizable
- Throws:
IOException
ClassNotFoundException
onAdd
public void onAdd(DialectRuntimeRegistry registry,
ClassLoader rootClassLoader)
- Specified by:
onAdd in interface DialectRuntimeData
onRemove
public void onRemove()
- Specified by:
onRemove in interface DialectRuntimeData
onBeforeExecute
public void onBeforeExecute()
- Specified by:
onBeforeExecute in interface DialectRuntimeData
clone
public DialectRuntimeData clone(DialectRuntimeRegistry registry,
ClassLoader rootClassLoader)
- Specified by:
clone in interface DialectRuntimeData
clone
public DialectRuntimeData clone(DialectRuntimeRegistry registry,
ClassLoader rootClassLoader,
boolean excludeClasses)
- Specified by:
clone in interface DialectRuntimeData
merge
public void merge(DialectRuntimeRegistry registry,
DialectRuntimeData newData)
- Specified by:
merge in interface DialectRuntimeData
merge
public void merge(DialectRuntimeRegistry registry,
DialectRuntimeData newData,
boolean excludeClasses)
- Specified by:
merge in interface DialectRuntimeData
isDirty
public boolean isDirty()
- Specified by:
isDirty in interface DialectRuntimeData
setDirty
public void setDirty(boolean dirty)
- Specified by:
setDirty in interface DialectRuntimeData
getStore
public Map<String,byte[]> getStore()
getBytecode
public byte[] getBytecode(String resourceName)
getClassLoader
public ClassLoader getClassLoader()
getRootClassLoader
public ClassLoader getRootClassLoader()
removeRule
public void removeRule(Package pkg,
Rule rule)
- Specified by:
removeRule in interface DialectRuntimeData
removeFunction
public void removeFunction(Package pkg,
Function function)
- Specified by:
removeFunction in interface DialectRuntimeData
read
public byte[] read(String resourceName)
write
public void write(String resourceName,
byte[] clazzData)
throws RuntimeDroolsException
- Throws:
RuntimeDroolsException
wire
public void wire(String className)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
- Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
wire
public void wire(String className,
Object invoker)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
- Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
remove
public boolean remove(String resourceName)
throws RuntimeDroolsException
- Throws:
RuntimeDroolsException
list
public String[] list()
reload
public void reload()
throws RuntimeDroolsException
- This class drops the classLoader and reloads it. During this process it must re-wire all the invokeables.
- Specified by:
reload in interface DialectRuntimeData
- Throws:
RuntimeDroolsException
clear
public void clear()
toString
public String toString()
- Overrides:
toString in class Object
putInvoker
public void putInvoker(String className,
Object invoker)
putAllInvokers
public void putAllInvokers(Map<String,Object> invokers)
getInvokers
public Map<String,Object> getInvokers()
removeInvoker
public void removeInvoker(String className)
putClassDefinition
public void putClassDefinition(String className,
byte[] classDef)
putAllClassDefinitions
public void putAllClassDefinitions(Map classDefinitions)
getClassDefinitions
public Map<String,byte[]> getClassDefinitions()
getClassDefinition
public byte[] getClassDefinition(String className)
removeClassDefinition
public void removeClassDefinition(String className)
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.