jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/Connector.java
changeset 45564 0149773a140c
parent 34894 3248b89d1921
equal deleted inserted replaced
45563:ece4ae6beba3 45564:0149773a140c
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 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
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package com.sun.jdi.connect;
    26 package com.sun.jdi.connect;
    27 
    27 
       
    28 import java.io.Serializable;
       
    29 import java.util.List;
    28 import java.util.Map;
    30 import java.util.Map;
    29 import java.util.List;
       
    30 import java.io.Serializable;
       
    31 
    31 
    32 /**
    32 /**
    33  * A method of connection between a debugger and a target VM.
    33  * A method of connection between a debugger and a target VM.
    34  * A connector encapsulates exactly one {@link Transport}. used
    34  * A connector encapsulates exactly one {@link Transport}. used
    35  * to establish the connection. Each connector has a set of arguments
    35  * to establish the connection. Each connector has a set of arguments
    44  *
    44  *
    45  * @author Gordon Hirsch
    45  * @author Gordon Hirsch
    46  * @since  1.3
    46  * @since  1.3
    47  */
    47  */
    48 public interface Connector {
    48 public interface Connector {
       
    49 
    49     /**
    50     /**
    50      * Returns a short identifier for the connector. Connector implementors
    51      * Returns a short identifier for the connector. Connector implementors
    51      * should follow similar naming conventions as are used with packages
    52      * should follow similar naming conventions as are used with packages
    52      * to avoid name collisions. For example, the Sun connector
    53      * to avoid name collisions. For example, the Sun connector
    53      * implementations have names prefixed with "com.sun.jdi.".
    54      * implementations have names prefixed with "com.sun.jdi.".
    80      * information about the argument and its default value.
    81      * information about the argument and its default value.
    81      *
    82      *
    82      * @return the map associating argument names with argument
    83      * @return the map associating argument names with argument
    83      * information and default value.
    84      * information and default value.
    84      */
    85      */
    85     Map<String,Connector.Argument> defaultArguments();
    86     Map<String, Connector.Argument> defaultArguments();
    86 
    87 
    87     /**
    88     /**
    88      * Specification for and value of a Connector argument.
    89      * Specification for and value of a Connector argument.
    89      * Will always implement a subinterface of Argument:
    90      * Will always implement a subinterface of Argument:
    90      * {@link Connector.StringArgument}, {@link Connector.BooleanArgument},
    91      * {@link Connector.StringArgument}, {@link Connector.BooleanArgument},
    91      * {@link Connector.IntegerArgument},
    92      * {@link Connector.IntegerArgument},
    92      * or {@link Connector.SelectedArgument}.
    93      * or {@link Connector.SelectedArgument}.
    93      */
    94      */
    94     public interface Argument extends Serializable {
    95     public interface Argument extends Serializable {
       
    96 
    95         /**
    97         /**
    96          * Returns a short, unique identifier for the argument.
    98          * Returns a short, unique identifier for the argument.
    97          * Not intended for exposure to end-user.
    99          * Not intended for exposure to end-user.
    98          *
   100          *
    99          * @return the name of this argument.
   101          * @return the name of this argument.
   155      * Specification for and value of a Connector argument,
   157      * Specification for and value of a Connector argument,
   156      * whose value is Boolean.  Boolean values are represented
   158      * whose value is Boolean.  Boolean values are represented
   157      * by the localized versions of the strings "true" and "false".
   159      * by the localized versions of the strings "true" and "false".
   158      */
   160      */
   159     public interface BooleanArgument extends Argument {
   161     public interface BooleanArgument extends Argument {
       
   162 
   160         /**
   163         /**
   161          * Sets the value of the argument.
   164          * Sets the value of the argument.
   162          */
   165          */
   163         void setValue(boolean value);
   166         void setValue(boolean value);
   164 
   167 
   195      * Specification for and value of a Connector argument,
   198      * Specification for and value of a Connector argument,
   196      * whose value is an integer.  Integer values are represented
   199      * whose value is an integer.  Integer values are represented
   197      * by their corresponding strings.
   200      * by their corresponding strings.
   198      */
   201      */
   199     public interface IntegerArgument extends Argument {
   202     public interface IntegerArgument extends Argument {
       
   203 
   200         /**
   204         /**
   201          * Sets the value of the argument.
   205          * Sets the value of the argument.
   202          * The value should be checked with {@link #isValid(int)}
   206          * The value should be checked with {@link #isValid(int)}
   203          * before setting it; invalid values will throw an exception
   207          * before setting it; invalid values will throw an exception
   204          * when the connection is established - for example,
   208          * when the connection is established - for example,