Class DebugServer


  • public class DebugServer
    extends java.lang.Object
    • Constructor Detail

      • DebugServer

        public DebugServer​(java.lang.String taskname)
    • Method Detail

      • setLog

        public void setLog​(Log log)
      • setScriptEngine

        public void setScriptEngine​(ScriptEngine se)
      • setTask

        public void setTask​(java.lang.Object task)
      • addScriptObject

        public void addScriptObject​(java.lang.String key,
                                    java.lang.Object value)
      • clearScriptObjects

        public void clearScriptObjects()
      • debugInit

        public void debugInit()
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • switchTo

        public void switchTo​(java.lang.String name)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • debugConnect

        public boolean debugConnect()
      • debugConnect

        public boolean debugConnect​(int port)
      • debugConnect

        public boolean debugConnect​(java.lang.String host,
                                    int tcpport)
      • debugConnect

        public boolean debugConnect​(java.lang.String host,
                                    int tcpport,
                                    boolean onerror)
      • debugClose

        public void debugClose()
      • isConnected

        public boolean isConnected()
      • debugMsg

        public void debugMsg​(java.lang.Object msg)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • debugClose

        public void debugClose​(java.lang.Object msg)
      • aborted

        public void aborted​(java.lang.Throwable t)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • debugBreak

        public void debugBreak​(java.lang.Object obj)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • debugBreak

        public void debugBreak​(java.lang.Object obj,
                               boolean onerror)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • debugBreak

        public void debugBreak​(java.lang.Object obj,
                               boolean onerror,
                               int linenumber)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • debugBreak

        public void debugBreak​(java.lang.Object obj,
                               boolean onerror,
                               int linenumber,
                               java.lang.Integer scriptRef)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getBreakpoints

        public java.util.Hashtable<java.lang.String,​Breakpoint> getBreakpoints()
                                                                              throws java.lang.Exception
        This method returns a table of Breakpoints. There is one Breakpoint object for each component and its hooks in this table.
        Returns:
        Returns a Hashtable with a Breakpoint object for each possible breakpoint in the AL
        Throws:
        java.lang.Exception
      • getScriptEngineVariables

        public java.util.Hashtable<java.lang.String,​java.lang.Object> getScriptEngineVariables​(java.lang.String filter)
        Returns a table with the script engine variables. The variables that are not Serializable are returned as NotSerializable Objects instead of the actual object.
        Parameters:
        filter - regex to filter specific variables. Not used.
        Returns:
        Returns a Hashtable of script engine variables
      • convertEntry

        public Entry convertEntry​(Entry entry)
        Checks if entry is of type Entry and traverses all attributes and values to see if any of them are not serializable. Non serializable values are converted to its string representation in the new returned entry.
        Parameters:
        entry - The Entry object to convert
        Returns:
        The converted Entry
      • convertAttribute

        public Attribute convertAttribute​(Attribute a)
        Converts the values in the attribute to a serializable representation if needed.
        Parameters:
        a - The attribute to convert
        Returns:
        A new Attribute with serializable values
      • convertObject

        public java.lang.Object convertObject​(java.lang.Object value)
        Converts an object to a serializable representation if needed.
        Parameters:
        value - Object to convert.
        Returns:
        A serializable representation of the object.
      • getHookNames

        public java.util.List<java.lang.String> getHookNames​(AssemblyLineComponent tc,
                                                             java.lang.Object[] hooks)
      • getConnectorList

        public java.lang.Object getConnectorList​(boolean includestats)
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • logmsg

        public void logmsg​(java.lang.Object str)
      • safeWriteObject

        public void safeWriteObject​(java.lang.Object obj)
                             throws java.lang.Exception
        This method write an object or an exception to the debugger.
        Throws:
        java.lang.Exception
      • isOnerror

        public boolean isOnerror()
        Returns:
        the onerror flag
      • setOnerror

        public void setOnerror​(boolean onerror)
        Sets the onerror flag. When true breakpoints are disabled except when there is an error.
        Parameters:
        onerror -
      • getLastKnownLocation

        public java.lang.String getLastKnownLocation()
        Returns the last known location. This is the last call to debugBreak with a valid breakpoint name (e.g. conn.after_getnext etc).
        Returns:
        Last known location
      • isAborted

        public boolean isAborted()
        Returns true if an ABORT message has been sent to the remote CE
        Returns:
        Returns true if an ABORT message has been sent to the remote CE. Otherwise, false is returned.
      • getUniqueID

        public java.lang.String getUniqueID()
      • setUniqueID

        public void setUniqueID​(java.lang.String id)
      • addScriptEngine

        public void addScriptEngine​(ScriptEngine engine,
                                    java.lang.String name)
        Add a ScriptEngine to be listened to
        Parameters:
        engine -
        name - Component name used to identify the script
        Since:
        7.2
      • reachedCycle

        public void reachedCycle​(long cycle)
        Tells the debugger that we have reached this cycle in the AL run.
        Parameters:
        cycle -