1 11 package org.eclipse.jdi.internal.connect; 12 13 14 import java.io.IOException ; 15 16 import com.sun.jdi.connect.spi.Connection; 17 18 22 public abstract class PacketManager implements Runnable { 23 24 private Connection fConnection; 25 26 private Thread fPartnerThread; 27 private IOException fDisconnectException; 28 29 32 protected PacketManager(Connection connection) { 33 fConnection = connection; 34 } 35 36 public Connection getConnection() { 37 return fConnection; 38 } 39 40 45 public void disconnectVM(IOException disconnectException) { 46 fDisconnectException= disconnectException; 47 disconnectVM(); 48 } 49 50 53 public void disconnectVM() { 54 try { 55 fConnection.close(); 56 } catch (IOException e) { 57 fDisconnectException = e; 58 } 59 if (fPartnerThread != null) { 61 fPartnerThread.interrupt(); 62 } 63 } 64 65 68 public boolean VMIsDisconnected() { 69 return fConnection == null || !fConnection.isOpen(); 70 } 71 72 76 public IOException getDisconnectException() { 77 return fDisconnectException; 78 } 79 80 83 public void setPartnerThread(Thread thread) { 84 fPartnerThread = thread; 85 } 86 } 87 | Popular Tags |