|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bluemarsh.jswat.DefaultManager | +--com.bluemarsh.jswat.event.VMEventManager
This class is responsible for maintaining a list of all the objects interested in events sent from the back-end of the JPDA debugger. Listeners registered for VM events are listed according to the event they are interested in. Within each of these lists the listeners are sorted in priority order. Those with a higher priority will be notified of the event before those of a lower priority.
Field Summary | |
protected com.sun.jdi.event.EventQueue |
eventQueue
VM event queue. |
protected java.lang.Object[] |
listenerList
The list of event class-listener pairs. |
protected static Category |
logCategory
Reporting category. |
protected static java.lang.Object[] |
NULL_ARRAY
A null array to be shared by all empty listener lists. |
protected Session |
owningSession
Owning session. |
protected java.lang.Thread |
runningThread
Thread running this runnable object. |
protected boolean |
vmConnected
True if we are connected to the debuggee VM. |
Fields inherited from class com.bluemarsh.jswat.DefaultManager |
swat |
Constructor Summary | |
VMEventManager()
Creates a new VMEventManager object. |
Method Summary | |
void |
activate(Session session)
Called when the Session is about to begin an active debugging session. |
void |
addListener(java.lang.Class event,
VMEventListener listener,
int priority)
Adds the given listener as a listener for events of the given type. |
void |
close(Session session)
Called when the Session is about to close down. |
void |
deactivate(Session session)
Called when the Session is about to end an active debugging session. |
protected com.bluemarsh.adt.PriorityList |
getList(java.lang.Object event)
Get the priority list matching the given event. |
void |
init(Session session)
Called after the Session has instantiated this mananger. |
protected boolean |
processEvent(com.sun.jdi.event.Event event,
com.bluemarsh.adt.PriorityList listeners)
Send the given event to the listeners on the list. |
protected void |
processExitEvents()
A VMDisconnectedException has happened while dealing with another event. |
void |
removeListener(java.lang.Class event,
VMEventListener listener)
Removes the given listener from the event listener list. |
void |
run()
Start waiting for events from the back-end of the JPDA debugger. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.Object[] NULL_ARRAY
protected static Category logCategory
protected com.sun.jdi.event.EventQueue eventQueue
protected java.lang.Thread runningThread
protected boolean vmConnected
protected Session owningSession
protected java.lang.Object[] listenerList
Constructor Detail |
public VMEventManager()
Method Detail |
public void activate(Session session)
activate
in class DefaultManager
session
- Session being activated.public void addListener(java.lang.Class event, VMEventListener listener, int priority)
event
occurs,
all registered listeners for that type will be notified.event
- VM event to listen for.listener
- Listener to add for event.priority
- Priority for this listener (1-255), where
higher values give higher priority.java.lang.IllegalArgumentException
- Thrown if listener is null or priority out of bounds.public void close(Session session)
close
in class DefaultManager
session
- Session being closed.public void deactivate(Session session)
deactivate
in class DefaultManager
session
- Session being deactivated.protected com.bluemarsh.adt.PriorityList getList(java.lang.Object event)
event
- VM event to find in list.public void init(Session session)
Session.getManager()
.init
in class DefaultManager
session
- Session initializing this manager.protected boolean processEvent(com.sun.jdi.event.Event event, com.bluemarsh.adt.PriorityList listeners)
event
- event to process.listeners
- list of listeners to handle event.protected void processExitEvents()
public void removeListener(java.lang.Class event, VMEventListener listener)
event
- VM event to listen for.listener
- Listener to remove from list.public void run()
run
in interface java.lang.Runnable
activate(com.bluemarsh.jswat.Session)
,
deactivate(com.bluemarsh.jswat.Session)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |