/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
private boolean shouldListen = true;
private boolean eventsHeld = false;
/*
* TO DO: The limit numbers below are somewhat arbitrary and should
* be configurable in the future.
*/
this.connection = connection;
this, "JDI Target VM Interface");
this.readerThread.setDaemon(true);
}
void start() {
}
if (sending) {
} else {
"Reply" : "Event";
}
if ((i > 0) && (i % 16 == 0)) {
}
}
}
}
}
}
public void run() {
}
while(shouldListen) {
boolean done = false;
try {
byte b[] = connection.readPacket();
if (b.length == 0) {
done = true;
}
p = Packet.fromByteArray(b);
} catch (IOException e) {
done = true;
}
if (done) {
shouldListen = false;
try {
connection.close();
} catch (IOException ioe) { }
break;
}
dumpPacket(p, false);
}
// It's a command
handleVMCommand(p);
} else {
/*if(p.errorCode != Packet.ReplyNoError) {
System.err.println("Packet " + p.id + " returned failure = " + p.errorCode);
}*/
synchronized(waitingQueue) {
}
// Whoa! a reply without a sender. Problem.
// FIX ME! Need to post an error.
continue;
}
synchronized(p2) {
}
}
}
// inform the VM mamager that this VM is history
// close down all the event queues
// Closing a queue causes a VMDisconnectEvent to
// be put onto the queue.
synchronized(eventQueues) {
}
}
// indirectly throw VMDisconnectedException to
// command requesters.
synchronized(waitingQueue) {
synchronized(packet) {
}
}
}
}
}
switch (p.cmdSet) {
break;
default:
return;
}
}
/* Events should not be constructed on this thread (the thread
* which reads all data from the transport). This means that the
* packet cannot be converted to real JDI objects as that may
* involve further communications with the back end which would
* deadlock.
*
* Instead the whole packet is passed for lazy eval by a queue
* reading thread.
*/
}
}
if (eventController == null) {
}
return eventController;
}
eventController().hold();
eventsHeld = true;
eventController().release();
eventsHeld = false;
}
}
void notifyDequeueEventSet() {
int maxQueueSize = 0;
synchronized(eventQueues) {
}
}
}
int maxQueueSize = 0;
synchronized(eventQueues) {
}
}
}
synchronized(waitingQueue) {
}
dumpPacket(packet, true);
}
try {
} catch (IOException e) {
throw new VMDisconnectedException(e.getMessage());
}
}
synchronized(packet) {
}
throw new VMDisconnectedException();
}
}
}
}
}
void stopListening() {
}
shouldListen = false;
try {
connection.close();
} catch (IOException ioe) { }
}
setDaemon(true);
super.start();
}
synchronized void hold() {
notifyAll();
}
synchronized void release() {
notifyAll();
}
public void run() {
while(true) {
int currentRequest;
synchronized(this) {
while (controlRequest == 0) {
try {wait();} catch (InterruptedException e) {}
}
controlRequest = 0;
}
try {
if (currentRequest > 0) {
} else {
}
} catch (JDWPException e) {
/*
* Don't want to terminate the thread, so the
* stack trace is printed and we continue.
*/
}
}
}
}
}