< prev index next >

src/jdk.jdi/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java

Print this page




  47     TransportService transportService;
  48     Transport transport;
  49     boolean usingSharedMemory = false;
  50 
  51     TransportService transportService() {
  52         return transportService;
  53     }
  54 
  55     public Transport transport() {
  56         return transport;
  57     }
  58 
  59     public SunCommandLineLauncher() {
  60         super();
  61 
  62         /**
  63          * By default this connector uses either the shared memory
  64          * transport or the socket transport
  65          */
  66         try {
  67             Class<?> c = Class.forName("com.sun.tools.jdi.SharedMemoryTransportService");
  68             transportService = (TransportService)c.newInstance();


  69             transport = new Transport() {
  70                 public String name() {
  71                     return "dt_shmem";
  72                 }
  73             };
  74             usingSharedMemory = true;
  75         } catch (ClassNotFoundException x) {
  76         } catch (UnsatisfiedLinkError x) {
  77         } catch (InstantiationException x) {
  78         } catch (IllegalAccessException x) {
  79         };
  80         if (transportService == null) {
  81             transportService = new SocketTransportService();
  82             transport = new Transport() {
  83                 public String name() {
  84                     return "dt_socket";
  85                 }
  86             };
  87         }
  88 
  89         addStringArgument(
  90                 ARG_HOME,
  91                 getString("sun.home.label"),
  92                 getString("sun.home"),
  93                 System.getProperty("java.home"),
  94                 false);
  95         addStringArgument(
  96                 ARG_OPTIONS,
  97                 getString("sun.options.label"),
  98                 getString("sun.options"),




  47     TransportService transportService;
  48     Transport transport;
  49     boolean usingSharedMemory = false;
  50 
  51     TransportService transportService() {
  52         return transportService;
  53     }
  54 
  55     public Transport transport() {
  56         return transport;
  57     }
  58 
  59     public SunCommandLineLauncher() {
  60         super();
  61 
  62         /**
  63          * By default this connector uses either the shared memory
  64          * transport or the socket transport
  65          */
  66         try {
  67             @SuppressWarnings("deprecation")
  68             Object o =
  69                 Class.forName("com.sun.tools.jdi.SharedMemoryTransportService").newInstance();
  70             transportService = (TransportService)o;
  71             transport = new Transport() {
  72                 public String name() {
  73                     return "dt_shmem";
  74                 }
  75             };
  76             usingSharedMemory = true;
  77         } catch (ClassNotFoundException |
  78                  UnsatisfiedLinkError | 
  79                  InstantiationException | 
  80                  IllegalAccessException x) {
  81         };
  82         if (transportService == null) {
  83             transportService = new SocketTransportService();
  84             transport = new Transport() {
  85                 public String name() {
  86                     return "dt_socket";
  87                 }
  88             };
  89         }
  90 
  91         addStringArgument(
  92                 ARG_HOME,
  93                 getString("sun.home.label"),
  94                 getString("sun.home"),
  95                 System.getProperty("java.home"),
  96                 false);
  97         addStringArgument(
  98                 ARG_OPTIONS,
  99                 getString("sun.options.label"),
 100                 getString("sun.options"),


< prev index next >