Package com.ibm.di.util
Class DebugServer
- java.lang.Object
-
- com.ibm.di.util.DebugServer
-
public class DebugServer extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ABORTED
static java.lang.String
BREAK
static java.lang.String
BREAKAT
static java.lang.String
BREAKPOINT
static java.lang.String
BREAKPOINTS
static java.lang.String
CONFIG
static java.lang.String
CONT
static java.lang.String
CONTEXT
static java.lang.String
CONTROL
static int
DEBUG_PORT
static java.lang.String
ENGINE_VARS
static java.lang.String
EVAL
static java.lang.String
FLAGS
static java.lang.String
HELLO
static java.lang.String
INIT
static java.lang.String
INIT_BREAK
static java.lang.String
LOGMSG
static java.lang.String
QUIT
static java.lang.String
RUN_TO_CYCLE
static java.lang.String
SCRIPT
static java.lang.String
STATS
static java.lang.String
STATUS
static java.lang.String
STEP
static java.lang.String
STEP_OVER
static java.lang.String
STOP
static java.lang.String
UNIQUE_ID
-
Constructor Summary
Constructors Constructor Description DebugServer(java.lang.String taskname)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
aborted(java.lang.Throwable t)
void
addScriptEngine(ScriptEngine engine, java.lang.String name)
Add a ScriptEngine to be listened tovoid
addScriptObject(java.lang.String key, java.lang.Object value)
void
clearScriptObjects()
Attribute
convertAttribute(Attribute a)
Converts the values in the attribute to a serializable representation if needed.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.java.lang.Object
convertObject(java.lang.Object value)
Converts an object to a serializable representation if needed.void
debugBreak(java.lang.Object obj)
void
debugBreak(java.lang.Object obj, boolean onerror)
void
debugBreak(java.lang.Object obj, boolean onerror, int linenumber)
void
debugBreak(java.lang.Object obj, boolean onerror, int linenumber, java.lang.Integer scriptRef)
void
debugClose()
void
debugClose(java.lang.Object msg)
boolean
debugConnect()
boolean
debugConnect(int port)
boolean
debugConnect(java.lang.String host, int tcpport)
boolean
debugConnect(java.lang.String host, int tcpport, boolean onerror)
void
debugInit()
void
debugMsg(java.lang.Object msg)
java.util.Hashtable<java.lang.String,Breakpoint>
getBreakpoints()
This method returns a table of Breakpoints.java.lang.Object
getConnectorList(boolean includestats)
DebugMessage
getDebuggerFlags()
java.util.List<java.lang.String>
getHookNames(AssemblyLineComponent tc, java.lang.Object[] hooks)
java.lang.String
getLastKnownLocation()
Returns the last known location.java.util.Hashtable<java.lang.String,java.lang.Object>
getScriptEngineVariables(java.lang.String filter)
Returns a table with the script engine variables.java.lang.String
getUniqueID()
boolean
isAborted()
Returns true if an ABORT message has been sent to the remote CEboolean
isConnected()
boolean
isOnerror()
void
logmsg(java.lang.Object str)
void
reachedCycle(long cycle)
Tells the debugger that we have reached this cycle in the AL run.void
safeWriteObject(java.lang.Object obj)
This method write an object or an exception to the debugger.void
setLog(Log log)
void
setOnerror(boolean onerror)
Sets the onerror flag.void
setScriptEngine(ScriptEngine se)
void
setTask(java.lang.Object task)
void
setUniqueID(java.lang.String id)
void
switchTo(java.lang.String name)
-
-
-
Field Detail
-
DEBUG_PORT
public static final int DEBUG_PORT
- See Also:
- Constant Field Values
-
CONTROL
public static final java.lang.String CONTROL
- See Also:
- Constant Field Values
-
STOP
public static final java.lang.String STOP
- See Also:
- Constant Field Values
-
CONT
public static final java.lang.String CONT
- See Also:
- Constant Field Values
-
BREAK
public static final java.lang.String BREAK
- See Also:
- Constant Field Values
-
LOGMSG
public static final java.lang.String LOGMSG
- See Also:
- Constant Field Values
-
HELLO
public static final java.lang.String HELLO
- See Also:
- Constant Field Values
-
EVAL
public static final java.lang.String EVAL
- See Also:
- Constant Field Values
-
STATS
public static final java.lang.String STATS
- See Also:
- Constant Field Values
-
QUIT
public static final java.lang.String QUIT
- See Also:
- Constant Field Values
-
INIT
public static final java.lang.String INIT
- See Also:
- Constant Field Values
-
FLAGS
public static final java.lang.String FLAGS
- See Also:
- Constant Field Values
-
BREAKPOINTS
public static final java.lang.String BREAKPOINTS
- See Also:
- Constant Field Values
-
BREAKPOINT
public static final java.lang.String BREAKPOINT
- See Also:
- Constant Field Values
-
ENGINE_VARS
public static final java.lang.String ENGINE_VARS
- See Also:
- Constant Field Values
-
STATUS
public static final java.lang.String STATUS
- See Also:
- Constant Field Values
-
ABORTED
public static final java.lang.String ABORTED
- See Also:
- Constant Field Values
-
STEP_OVER
public static final java.lang.String STEP_OVER
- See Also:
- Constant Field Values
-
STEP
public static final java.lang.String STEP
- See Also:
- Constant Field Values
-
BREAKAT
public static final java.lang.String BREAKAT
- See Also:
- Constant Field Values
-
CONFIG
public static final java.lang.String CONFIG
- See Also:
- Constant Field Values
-
UNIQUE_ID
public static final java.lang.String UNIQUE_ID
- See Also:
- Constant Field Values
-
INIT_BREAK
public static final java.lang.String INIT_BREAK
- See Also:
- Constant Field Values
-
SCRIPT
public static final java.lang.String SCRIPT
- See Also:
- Constant Field Values
-
CONTEXT
public static final java.lang.String CONTEXT
- See Also:
- Constant Field Values
-
RUN_TO_CYCLE
public static final java.lang.String RUN_TO_CYCLE
- See Also:
- Constant Field Values
-
-
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
-
getDebuggerFlags
public DebugMessage getDebuggerFlags()
-
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
-
-
-