Class JavaDialectRuntimeData

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, DialectRuntimeData

    public class JavaDialectRuntimeData
    extends java.lang.Object
    implements DialectRuntimeData, java.io.Externalizable
    See Also:
    Serialized Form
    • Constructor Detail

      • JavaDialectRuntimeData

        public JavaDialectRuntimeData()
    • Method Detail

      • writeExternal

        public void writeExternal​(java.io.ObjectOutput stream)
                           throws java.io.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 java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput stream)
                          throws java.io.IOException,
                                 java.lang.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 java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • getStore

        public java.util.Map<java.lang.String,​byte[]> getStore()
      • getBytecode

        public byte[] getBytecode​(java.lang.String resourceName)
      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
      • getRootClassLoader

        public java.lang.ClassLoader getRootClassLoader()
      • read

        public byte[] read​(java.lang.String resourceName)
      • write

        public void write​(java.lang.String resourceName,
                          byte[] clazzData)
      • remove

        public boolean remove​(java.lang.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:
        reload in interface DialectRuntimeData
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • putInvoker

        public void putInvoker​(java.lang.String className,
                               Wireable invoker)
      • putAllInvokers

        public void putAllInvokers​(java.util.Map<java.lang.String,​Wireable> invokers)
      • putClassDefinition

        public void putClassDefinition​(java.lang.String className,
                                       byte[] classDef)
      • putAllClassDefinitions

        public void putAllClassDefinitions​(java.util.Map classDefinitions)
      • getClassDefinition

        public byte[] getClassDefinition​(java.lang.String className)