|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jde.debugger.Application
Application.java
Is the most important class of the jdebug: it holds control of what and how happens to the application, as it reacts to commands it receives from the jde side, and the events it receives from the debugee vm side.
Created: Wed Jul 7 16:16:59 1999
Field Summary | |
(package private) EventHandler |
eventHandler
The EventHandler manages the events received from the
debugee vm |
(package private) EventRequestSpecList |
eventRequestSpecs
EventRequestSpecList is responsible for
keeping track of the events that the user is interested in. |
(package private) GeneralCommands |
generalCommands
|
private long |
id
Some classes require a unique ID with which to refer to objects they are tracking: for instance eventRequestSpecs, which need a spec ID with which to identify the specs, and identifiableSpecRequests (in ApplicationCommands) |
(package private) Jdebug |
jdebug
Represents the jde. |
(package private) java.lang.Integer |
my_id
The ID that uniquely identifies this application in jdebug. |
(package private) java.net.Socket |
mySocket
Socket connection to do i/o |
(package private) java.util.Collection |
pendingCommands
A collection of the commands for which the reply (result/error) has not been sent. |
private boolean |
shuttingDown
keeps track of the state of the application: exceptions/error messages will not be raised if we're shutting down. |
(package private) SpecCommands |
specCommands
|
(package private) ObjectStore |
store
A store of all the objects jde knows about. |
(package private) ThreadCommands |
threadCommands
|
(package private) com.sun.jdi.VirtualMachine |
vm
The debugee VM |
Constructor Summary | |
Application(Jdebug jdebug,
java.lang.Integer app_id)
The constructor. |
Method Summary | |
private void |
attachShmem(com.sun.jdi.connect.AttachingConnector connector,
java.util.List args)
attaches to a vm via shared memory |
private void |
attachSocket(com.sun.jdi.connect.AttachingConnector connector,
java.util.List args)
attaches to a vm via a socket |
private void |
displayRemoteOutput(java.io.InputStream stream)
Create a Thread that will retrieve and display any output. |
private void |
dumpFailedAppStreams(java.lang.Process process)
after an app fails, dump its output |
private void |
dumpStream(java.io.InputStream stream)
|
java.util.List |
findClassesMatchingPattern(java.lang.String pattern)
Return a list of ReferenceType objects for all currently loaded classes and interfaces whose name matches the given pattern. |
private com.sun.jdi.connect.Connector |
getConnector(java.lang.String name)
|
com.sun.jdi.event.EventQueue |
getEventQueue()
|
java.lang.Integer |
getId()
|
java.lang.Long |
getNewID()
|
ObjectStore |
getStore()
|
com.sun.jdi.VirtualMachine |
getVM()
|
void |
handleCommand(java.lang.Integer cmd_id,
java.lang.String command,
java.util.List args)
Primary function called by Jdebug when a command specific to
a vm/app is received from jde. |
void |
informJDEInstallSuccessful(EventRequestSpec spec)
Inform jde on a successful spec resolution |
int |
initialize(java.lang.String connectType,
java.util.List args)
Start off |
private boolean |
isShuttingDown()
|
private int |
launch(com.sun.jdi.connect.LaunchingConnector connector,
java.util.List args)
launches a new vm,and returns the port no. |
private void |
listenShmem(com.sun.jdi.connect.ListeningConnector connector,
java.util.List args)
listenes to a vm via shared memory |
private void |
listenSocket(com.sun.jdi.connect.ListeningConnector connector,
java.util.List args)
listenes to a vm via a socket |
private int |
manageAppStreams(java.lang.Process process)
|
private void |
processRemoteInput(java.io.OutputStream stream)
Create a thread that reads the input from standard input and sends it to the process |
void |
removeSpecAndInformJDE(EventRequestSpec spec,
java.lang.String problem)
Removes a Spec from the specList, and informs jde. |
void |
resolve(com.sun.jdi.ReferenceType ref)
This method is executed whenever a new reference type is prepared. |
void |
shutdown()
|
void |
signal(java.lang.String type,
java.lang.Object obj)
|
void |
signalCommandError(java.lang.Integer cmd_id,
JDEException ex)
if a jde exception was caused somewhere (causing an error to be sent back for the command), we can use the string in the exception to create the error string |
void |
signalCommandError(java.lang.Integer cmd_id,
java.lang.String error)
|
void |
signalCommandResult(java.lang.Integer cmd_id)
|
void |
signalCommandResult(java.lang.Integer cmd_id,
java.lang.Object obj)
|
Methods inherited from class java.lang.Object |
|
Field Detail |
private long id
This variable keeps a monotonically increasing count, and can be
used to get a new id, using getNewID()
final java.lang.Integer my_id
final Jdebug jdebug
Jdebug
manages the jdebug link to jde.java.net.Socket mySocket
EventHandler eventHandler
EventHandler
manages the events received from the
debugee vmcom.sun.jdi.VirtualMachine vm
EventRequestSpecList eventRequestSpecs
EventRequestSpecList
is responsible for
keeping track of the events that the user is interested in. To do
this, it maintains a list of "eventRequestSpec"s.EventRequestSpecList
,
EventRequestSpec
java.util.Collection pendingCommands
Jdebug.pendingCommands
ObjectStore store
ObjectStore
GeneralCommands generalCommands
SpecCommands specCommands
ThreadCommands threadCommands
private boolean shuttingDown
Constructor Detail |
public Application(Jdebug jdebug, java.lang.Integer app_id)
jdebug
- Jdebug
classapp_id
- My identifying identifierMethod Detail |
public java.lang.Long getNewID()
private boolean isShuttingDown()
public int initialize(java.lang.String connectType, java.util.List args) throws JDEException
connectType
- Specifies how to connect to the application. We're
only supporting 'launch' right now.args
- A list of arguments: i does NOT contain the app_id at
index 0, that has already been stripped out.public com.sun.jdi.VirtualMachine getVM()
public java.lang.Integer getId()
public ObjectStore getStore()
public com.sun.jdi.event.EventQueue getEventQueue()
public void shutdown()
private com.sun.jdi.connect.Connector getConnector(java.lang.String name)
private int launch(com.sun.jdi.connect.LaunchingConnector connector, java.util.List args) throws JDEException
private void attachSocket(com.sun.jdi.connect.AttachingConnector connector, java.util.List args) throws JDEException
private void attachShmem(com.sun.jdi.connect.AttachingConnector connector, java.util.List args) throws JDEException
private void listenSocket(com.sun.jdi.connect.ListeningConnector connector, java.util.List args) throws JDEException
private void listenShmem(com.sun.jdi.connect.ListeningConnector connector, java.util.List args) throws JDEException
private int manageAppStreams(java.lang.Process process) throws JDEException
private void dumpFailedAppStreams(java.lang.Process process)
private void processRemoteInput(java.io.OutputStream stream)
private void displayRemoteOutput(java.io.InputStream stream)
private void dumpStream(java.io.InputStream stream) throws java.io.IOException
public java.util.List findClassesMatchingPattern(java.lang.String pattern) throws JDEException
public void handleCommand(java.lang.Integer cmd_id, java.lang.String command, java.util.List args)
Jdebug
when a command specific to
a vm/app is received from jde.cmd_id
- Identifies a command uniquely. See Jdebug.pendingCommands
command
- The commandargs
- And its argumentspublic void resolve(com.sun.jdi.ReferenceType ref)
EventRequestSpecList.resolve(ReferenceType)
public void informJDEInstallSuccessful(EventRequestSpec spec)
public void removeSpecAndInformJDE(EventRequestSpec spec, java.lang.String problem)
public void signal(java.lang.String type, java.lang.Object obj)
public void signalCommandResult(java.lang.Integer cmd_id)
public void signalCommandResult(java.lang.Integer cmd_id, java.lang.Object obj)
public void signalCommandError(java.lang.Integer cmd_id, java.lang.String error)
public void signalCommandError(java.lang.Integer cmd_id, JDEException ex)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |