|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bluemarsh.jswat.Session
This class is responsible for maintaining references to all of the objects pertaining to an active debugging session. Session is used to perform some basic operations on the debugging session. Many of the useful objects in the debugging session are accessible from this Session class.
Field Summary | |
protected UIAdapter |
interfaceAdapter
Our very own user interface adapter. |
protected com.bluemarsh.jswat.SessionListenerList |
listenerList
List of SessionListener objects. |
protected static Category |
logCategory
Reporting category. |
protected java.util.Hashtable |
managerTable
Table of Manager objects keyed by their Class. |
protected static int |
SESSION_ACTIVATING
Session is presently activating. |
protected static int |
SESSION_ACTIVE
Session is active. |
protected static int |
SESSION_CLOSED
Session is permanently closed. |
protected static int |
SESSION_CLOSING
Session is presently closing. |
protected static int |
SESSION_DEACTIVATING
Session is presently deactivating. |
protected static int |
SESSION_INACTIVE
Session is inactive. |
protected static int |
SESSION_NEW
Session is brand new. |
protected java.util.Properties |
sessionProperties
Session properties. |
protected int |
sessionState
State of the Session at this time. |
protected Log |
statusLog
Status log to which messages are written. |
protected VMConnection |
vmConnection
VMConnection for connecting to the debuggee VM. |
Fields inherited from interface com.bluemarsh.jswat.event.VMEventListener |
PRIORITY_BREAKPOINT, PRIORITY_DEFAULT, PRIORITY_HIGH, PRIORITY_HIGHEST, PRIORITY_LOW, PRIORITY_LOWEST, PRIORITY_SESSION |
Constructor Summary | |
Session()
Creates a Session object. |
Method Summary | |
void |
activate(VMConnection connection)
Activates the Session now that a connection has been made. |
void |
addListener(SessionListener listener)
Adds a SessionListener to this session. |
void |
close()
Shutdown the session permanently. |
void |
deactivate(boolean forceExit)
Set this session inactive, clearing all the objects associated with this session. |
boolean |
eventOccurred(com.sun.jdi.event.Event e)
Invoked when a VM event has occurred. |
VMConnection |
getConnection()
Returns the VMConnection object for this Session, if any. |
com.sun.jdi.ThreadReference |
getCurrentThread()
Returns the ThreadReference to the current thread object. |
Manager |
getManager(java.lang.Class managerClass)
Retrieve an instance of a manager of the given class. |
java.lang.String |
getProperty(java.lang.String key)
Searches for the property with the specified key in this property list. |
Log |
getStatusLog()
Returns a reference to the Log object that receives messages. |
UIAdapter |
getUIAdapter()
Returns a reference to the interface adapter associated with this session. |
com.sun.jdi.VirtualMachine |
getVM()
Returns a reference to the virtual machine associated with this session. |
void |
handleLocatableEvent(com.sun.jdi.event.LocatableEvent event)
Do the usual thing when a locatable event has occurred. |
void |
init(UIAdapter uiadapter)
Initialize the Session by loading the session properties from disk. |
boolean |
isActive()
Returns true if this session is active and attached to a virtual machine. |
protected void |
loadProperties()
Load the session properties from the user's home directory. |
void |
loadProperties(java.io.File propsFile)
Load the session properties from the given file. |
void |
removeListener(SessionListener listener)
Removes a Session listener from this session. |
void |
resumeVM()
Resume execution of the debuggee VM, from a suspended state. |
protected boolean |
saveProperties()
Save the session properties to a file in the user's home directory. |
boolean |
saveProperties(java.io.File propsFile)
Save the session properties to the given file. |
java.lang.Object |
setProperty(java.lang.String key,
java.lang.String value)
Stores the given value in the properties list with the given key as a reference. |
void |
setStatus(java.lang.String status)
Set the status indicator using a short message. |
protected void |
showEventLocation(com.sun.jdi.event.LocatableEvent le)
Shows the location of the event, including the class type, method name, and possibly the source file name and line number (if available). |
protected void |
showSourceFile(com.sun.jdi.Location loc)
Show the source file for the given class. |
protected void |
showSourceFile(java.lang.String classname)
Show the source file for the given class. |
void |
suspendVM()
Suspend execution of the debuggee VM. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int SESSION_NEW
protected static final int SESSION_ACTIVE
protected static final int SESSION_INACTIVE
protected static final int SESSION_ACTIVATING
protected static final int SESSION_DEACTIVATING
protected static final int SESSION_CLOSING
protected static final int SESSION_CLOSED
protected static Category logCategory
protected UIAdapter interfaceAdapter
protected Log statusLog
protected VMConnection vmConnection
protected java.util.Hashtable managerTable
protected com.bluemarsh.jswat.SessionListenerList listenerList
protected java.util.Properties sessionProperties
protected int sessionState
Constructor Detail |
public Session()
init()
method.init(com.bluemarsh.jswat.ui.UIAdapter)
Method Detail |
public void activate(VMConnection connection)
connection
- VMConnection used to represent the debuggee
VM connection.java.lang.IllegalStateException
- Thrown if the session state is not 'inactive'.public void addListener(SessionListener listener)
init()
method on the listener.
It may also call the activate()
method if
the Session is already active.listener
- SessionListener to add to this session.public void close()
java.lang.IllegalStateException
- Thrown if session state is not 'inactive'.public void deactivate(boolean forceExit)
forceExit
- true to close debuggee VM forcibly in all
cases; false to leave remote debuggee running.java.lang.IllegalStateException
- Thrown if the session state is not 'active'.activate(com.bluemarsh.jswat.VMConnection)
public boolean eventOccurred(com.sun.jdi.event.Event e)
eventOccurred
in interface VMEventListener
e
- VM eventpublic VMConnection getConnection()
public com.sun.jdi.ThreadReference getCurrentThread()
public Manager getManager(java.lang.Class managerClass)
managerClass
- Class of Manager to retrieve.public java.lang.String getProperty(java.lang.String key)
key
- the property key.public Log getStatusLog()
public com.sun.jdi.VirtualMachine getVM()
public UIAdapter getUIAdapter()
public void handleLocatableEvent(com.sun.jdi.event.LocatableEvent event)
event
- locatable event.public void init(UIAdapter uiadapter)
uiadapter
- interface adapter.java.lang.IllegalStateException
- Thrown if the session state is not 'new'.public boolean isActive()
activate(com.bluemarsh.jswat.VMConnection)
,
deactivate(boolean)
protected void loadProperties()
public void loadProperties(java.io.File propsFile)
propsFile
- properties file.public void removeListener(SessionListener listener)
close()
method of the listener.listener
- SessionListener to remove from this session.public void resumeVM() throws NotActiveException
NotActiveException
- Thrown if session is not actively debugging a VM.protected boolean saveProperties()
public boolean saveProperties(java.io.File propsFile)
propsFile
- properties file.public java.lang.Object setProperty(java.lang.String key, java.lang.String value)
key
- the key to be placed into this property list.value
- the value corresponding to key, or null to remove
the key and value from the properties.public void setStatus(java.lang.String status)
showStatus()
method. In addition, the message will be printed to the log.status
- short message indicating program status.protected void showEventLocation(com.sun.jdi.event.LocatableEvent le)
le
- LocatableEvent whose location will be displayed.protected void showSourceFile(com.sun.jdi.Location loc)
loc
- location for which to show the source.protected void showSourceFile(java.lang.String classname)
classname
- Fully-qualified name of class.public void suspendVM() throws NotActiveException
NotActiveException
- Thrown if session is not actively debugging a VM.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |