jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/TransportService.java
changeset 45564 0149773a140c
parent 45532 ff4b62180768
equal deleted inserted replaced
45563:ece4ae6beba3 45564:0149773a140c
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    24  */
    24  */
    25 
    25 
    26 package com.sun.jdi.connect.spi;
    26 package com.sun.jdi.connect.spi;
    27 
    27 
    28 import java.io.IOException;
    28 import java.io.IOException;
       
    29 
       
    30 import com.sun.jdi.connect.Transport;
    29 import com.sun.jdi.connect.TransportTimeoutException;
    31 import com.sun.jdi.connect.TransportTimeoutException;
    30 
    32 
    31 /**
    33 /**
    32  * A transport service for connections between a debugger and
    34  * A transport service for connections between a debugger and
    33  * a target VM.
    35  * a target VM.
    34  *
    36  *
    35  * <p> A transport service is a concrete subclass of this class
    37  * <p> A transport service is a concrete subclass of this class
    36  * that has a zero-argument constructor and implements the abstract
    38  * that has a zero-argument constructor and implements the abstract
    37  * methods specified below. It is the underlying service
    39  * methods specified below. It is the underlying service
    38  * used by a {@link com.sun.jdi.connect.Transport} for
    40  * used by a {@link Transport} for connections between a debugger
    39  * connections between a debugger and a target VM.
    41  * and a target VM.
    40  *
    42  *
    41  * <p> A transport service is used to establish a connection
    43  * <p> A transport service is used to establish a connection
    42  * between a debugger and a target VM, and to transport Java
    44  * between a debugger and a target VM, and to transport Java
    43  * Debug Wire Protocol (JDWP) packets over an underlying
    45  * Debug Wire Protocol (JDWP) packets over an underlying
    44  * communication protocol. In essence a transport service
    46  * communication protocol. In essence a transport service
    74  * method is used to accept a connection initiated by a
    76  * method is used to accept a connection initiated by a
    75  * target VM.
    77  * target VM.
    76  *
    78  *
    77  * @since 1.5
    79  * @since 1.5
    78  */
    80  */
    79 
       
    80 public abstract class TransportService {
    81 public abstract class TransportService {
    81 
    82 
    82     /**
    83     /**
    83      * Returns a name to identify the transport service.
    84      * Returns a name to identify the transport service.
    84      *
    85      *
   106          * @return  {@code true} if, and only if, this transport
   107          * @return  {@code true} if, and only if, this transport
   107          *          service supports multiple connections.
   108          *          service supports multiple connections.
   108          */
   109          */
   109         public abstract boolean supportsMultipleConnections();
   110         public abstract boolean supportsMultipleConnections();
   110 
   111 
   111 
       
   112         /**
   112         /**
   113          * Tell whether or not this transport service supports a timeout
   113          * Tell whether or not this transport service supports a timeout
   114          * when attaching to a target VM.
   114          * when attaching to a target VM.
   115          *
   115          *
   116          * @return      {@code true} if, and only if, this transport
   116          * @return      {@code true} if, and only if, this transport
   142          *
   142          *
   143          * @see #attach(String,long,long)
   143          * @see #attach(String,long,long)
   144          * @see #accept(TransportService.ListenKey,long,long)
   144          * @see #accept(TransportService.ListenKey,long,long)
   145          */
   145          */
   146         public abstract boolean supportsHandshakeTimeout();
   146         public abstract boolean supportsHandshakeTimeout();
   147 
       
   148     }
   147     }
   149 
   148 
   150     /**
   149     /**
   151      * Returns the capabilities of the transport service.
   150      * Returns the capabilities of the transport service.
   152      *
   151      *
   371      *
   370      *
   372      * @see TransportService.Capabilities#supportsAcceptTimeout()
   371      * @see TransportService.Capabilities#supportsAcceptTimeout()
   373      */
   372      */
   374     public abstract Connection accept(ListenKey listenKey, long acceptTimeout,
   373     public abstract Connection accept(ListenKey listenKey, long acceptTimeout,
   375         long handshakeTimeout) throws IOException;
   374         long handshakeTimeout) throws IOException;
   376 
       
   377 }
   375 }