org.drools.rule
Class JavaDialectRuntimeData

java.lang.Object
  extended by org.drools.rule.JavaDialectRuntimeData
All Implemented Interfaces:
Externalizable, Serializable, Cloneable, DialectRuntimeData

public class JavaDialectRuntimeData
extends Object
implements DialectRuntimeData, Externalizable

See Also:
Serialized Form

Nested Class Summary
static class JavaDialectRuntimeData.PackageClassLoader
          This is an Internal Drools Class
static class JavaDialectRuntimeData.TypeDeclarationClassLoader
          This is an Internal Drools Class
 
Constructor Summary
JavaDialectRuntimeData()
           
 
Method Summary
 void clear()
           
 DialectRuntimeData clone(DialectRuntimeRegistry registry, org.drools.util.CompositeClassLoader rootClassLoader)
           
 DialectRuntimeData clone(DialectRuntimeRegistry registry, org.drools.util.CompositeClassLoader rootClassLoader, boolean excludeClasses)
           
static String convertClassToResourcePath(String pName)
          Please do not use - internal org.my.Class -> org/my/Class.class
static String convertResourceToClassName(String pResourceName)
          Please do not use - internal org/my/Class.xxx -> org.my.Class
 byte[] getClassDefinition(String className)
           
 Map getClassDefinitions()
           
 ClassLoader getClassLoader()
           
 Map<String,Object> getInvokers()
           
protected  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, org.drools.util.CompositeClassLoader 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)
           
static String stripExtension(String pResourceName)
          Please do not use - internal org/my/Class.xxx -> org/my/Class
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaDialectRuntimeData

public JavaDialectRuntimeData()
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:
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,
                  org.drools.util.CompositeClassLoader 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,
                                org.drools.util.CompositeClassLoader rootClassLoader)
Specified by:
clone in interface DialectRuntimeData

clone

public DialectRuntimeData clone(DialectRuntimeRegistry registry,
                                org.drools.util.CompositeClassLoader 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

protected Map<String,byte[]> getStore()

getClassLoader

public ClassLoader getClassLoader()

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 getClassDefinitions()

getClassDefinition

public byte[] getClassDefinition(String className)

removeClassDefinition

public void removeClassDefinition(String className)

convertResourceToClassName

public static String convertResourceToClassName(String pResourceName)
Please do not use - internal org/my/Class.xxx -> org.my.Class


convertClassToResourcePath

public static String convertClassToResourcePath(String pName)
Please do not use - internal org.my.Class -> org/my/Class.class


stripExtension

public static String stripExtension(String pResourceName)
Please do not use - internal org/my/Class.xxx -> org/my/Class



Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.