jdk/src/java.management/share/classes/sun/management/AgentConfigurationError.java
author weijun
Thu, 11 Dec 2014 15:23:02 +0800
changeset 27957 24b4e6082f19
parent 25859 3317bb8137f4
child 29099 766801b4d95d
permissions -rw-r--r--
8055723: Replace concat String to append in StringBuilder parameters (dev) Reviewed-by: redestad, ulfzibis, weijun, prappo, igerasim, alanb Contributed-by: Otavio Santana <otaviojava@java.net>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 17197
diff changeset
     2
 * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4173
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4173
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4173
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4173
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4173
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.management;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * Configuration Error thrown by a management agent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
public class AgentConfigurationError extends Error {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
    public static final String AGENT_EXCEPTION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
        "agent.err.exception";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
    public static final String CONFIG_FILE_NOT_FOUND    =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
        "agent.err.configfile.notfound";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
    public static final String CONFIG_FILE_OPEN_FAILED  =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
        "agent.err.configfile.failed";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
    public static final String CONFIG_FILE_CLOSE_FAILED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
        "agent.err.configfile.closed.failed";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    public static final String CONFIG_FILE_ACCESS_DENIED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
        "agent.err.configfile.access.denied";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    public static final String EXPORT_ADDRESS_FAILED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
        "agent.err.exportaddress.failed";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    public static final String AGENT_CLASS_NOT_FOUND =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
        "agent.err.agentclass.notfound";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    public static final String AGENT_CLASS_FAILED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        "agent.err.agentclass.failed";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    public static final String AGENT_CLASS_PREMAIN_NOT_FOUND =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
        "agent.err.premain.notfound";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    public static final String AGENT_CLASS_ACCESS_DENIED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        "agent.err.agentclass.access.denied";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    public static final String AGENT_CLASS_INVALID =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        "agent.err.invalid.agentclass";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    public static final String INVALID_JMXREMOTE_PORT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        "agent.err.invalid.jmxremote.port";
11991
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents: 5506
diff changeset
    56
    public static final String INVALID_JMXREMOTE_RMI_PORT =
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents: 5506
diff changeset
    57
        "agent.err.invalid.jmxremote.rmi.port";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    public static final String PASSWORD_FILE_NOT_SET =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        "agent.err.password.file.notset";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    public static final String PASSWORD_FILE_NOT_READABLE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        "agent.err.password.file.not.readable";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    public static final String PASSWORD_FILE_READ_FAILED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        "agent.err.password.file.read.failed";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    public static final String PASSWORD_FILE_NOT_FOUND =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        "agent.err.password.file.notfound";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    public static final String ACCESS_FILE_NOT_SET =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        "agent.err.access.file.notset";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    public static final String ACCESS_FILE_NOT_READABLE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        "agent.err.access.file.not.readable";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    public static final String ACCESS_FILE_READ_FAILED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        "agent.err.access.file.read.failed";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    public static final String ACCESS_FILE_NOT_FOUND =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        "agent.err.access.file.notfound";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    public static final String PASSWORD_FILE_ACCESS_NOT_RESTRICTED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        "agent.err.password.file.access.notrestricted";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    public static final String FILE_ACCESS_NOT_RESTRICTED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        "agent.err.file.access.not.restricted";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    public static final String FILE_NOT_FOUND =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        "agent.err.file.not.found";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    public static final String FILE_NOT_READABLE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        "agent.err.file.not.readable";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    public static final String FILE_NOT_SET =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        "agent.err.file.not.set";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    public static final String FILE_READ_FAILED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        "agent.err.file.read.failed";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    public static final String CONNECTOR_SERVER_IO_ERROR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        "agent.err.connector.server.io.error";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    public static final String INVALID_OPTION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        "agent.err.invalid.option";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    public static final String INVALID_SNMP_PORT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        "agent.err.invalid.snmp.port";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    public static final String INVALID_SNMP_TRAP_PORT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        "agent.err.invalid.snmp.trap.port";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    public static final String UNKNOWN_SNMP_INTERFACE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        "agent.err.unknown.snmp.interface";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    public static final String SNMP_ACL_FILE_NOT_SET =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        "agent.err.acl.file.notset";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    public static final String SNMP_ACL_FILE_NOT_FOUND =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        "agent.err.acl.file.notfound";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    public static final String SNMP_ACL_FILE_NOT_READABLE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        "agent.err.acl.file.not.readable";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    public static final String SNMP_ACL_FILE_READ_FAILED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        "agent.err.acl.file.read.failed";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    public static final String SNMP_ACL_FILE_ACCESS_NOT_RESTRICTED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        "agent.err.acl.file.access.notrestricted";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    public static final String SNMP_ADAPTOR_START_FAILED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        "agent.err.snmp.adaptor.start.failed";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    public static final String SNMP_MIB_INIT_FAILED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        "agent.err.snmp.mib.init.failed";
11991
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents: 5506
diff changeset
   110
    public static final String INVALID_STATE =
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents: 5506
diff changeset
   111
        "agent.err.invalid.state";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    private final String error;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    private final String[] params;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    public AgentConfigurationError(String error) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        this.error = error;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        this.params = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    public AgentConfigurationError(String error, Throwable cause) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        super(cause);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        this.error = error;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        this.params = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    public AgentConfigurationError(String error, String... params) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        this.error = error;
17197
8ee6909f1320 8003671: [findbugs] sun.management.AgentConfigurationError.getParams() may expose internal representation by returning AgentConfigurationError.params
sla
parents: 11991
diff changeset
   131
        this.params = params.clone();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    public AgentConfigurationError(String error, Throwable cause, String... params) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        super(cause);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        this.error = error;
17197
8ee6909f1320 8003671: [findbugs] sun.management.AgentConfigurationError.getParams() may expose internal representation by returning AgentConfigurationError.params
sla
parents: 11991
diff changeset
   137
        this.params = params.clone();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    public String getError() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        return error;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    public String[] getParams() {
17197
8ee6909f1320 8003671: [findbugs] sun.management.AgentConfigurationError.getParams() may expose internal representation by returning AgentConfigurationError.params
sla
parents: 11991
diff changeset
   145
        return params.clone();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    }
4173
d01972926813 6895875: Missing serialVersionUID in sun.management classes
mchung
parents: 2
diff changeset
   147
d01972926813 6895875: Missing serialVersionUID in sun.management classes
mchung
parents: 2
diff changeset
   148
    private static final long serialVersionUID = 1211605593516195475L;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
}