author | dsamersoff |
Mon, 11 Feb 2013 18:44:22 +0400 | |
changeset 15653 | ce470531e852 |
parent 15531 | 071efc9f31ad |
child 17721 | 1d6516794d05 |
permissions | -rw-r--r-- |
15653
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
1 |
/* |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
2 |
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
4 |
* |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
10 |
* |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
15 |
* accompanied this code). |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
16 |
* |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
20 |
* |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
23 |
* questions. |
ce470531e852
8007536: Incorrect copyright header in JDP files
dsamersoff
parents:
15531
diff
changeset
|
24 |
*/ |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
25 |
/** |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
26 |
* Summary |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
27 |
* ------- |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
28 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
29 |
* Define a lightweight network protocol for discovering running and |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
30 |
* manageable Java processes within a network subnet. |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
31 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
32 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
33 |
* Description |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
34 |
* ----------- |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
35 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
36 |
* The protocol is lightweight multicast based, and works like a beacon, |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
37 |
* broadcasting the JMXService URL needed to connect to the external JMX |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
38 |
* agent if an application is started with appropriate parameters. |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
39 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
40 |
* The payload is structured like this: |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
41 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
42 |
* 4 bytes JDP magic (0xC0FFEE42) |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
43 |
* 2 bytes JDP protocol version (1) |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
44 |
* 2 bytes size of the next entry |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
45 |
* x bytes next entry (UTF-8 encoded) |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
46 |
* 2 bytes size of next entry |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
47 |
* ... Rinse and repeat... |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
48 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
49 |
* The payload will be parsed as even entries being keys, odd entries being |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
50 |
* values. |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
51 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
52 |
* The standard JDP packet contains four entries: |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
53 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
54 |
* - `DISCOVERABLE_SESSION_UUID` -- Unique id of the instance; this id changes every time |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
55 |
* the discovery protocol starts and stops |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
56 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
57 |
* - `MAIN_CLASS` -- The value of the `sun.java.command` property |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
58 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
59 |
* - `JMX_SERVICE_URL` -- The URL to connect to the JMX agent |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
60 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
61 |
* - `INSTANCE_NAME` -- The user-provided name of the running instance |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
62 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
63 |
* The protocol sends packets to 239.255.255.225:7095 by default. |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
64 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
65 |
* The protocol uses system properties to control it's behaviour: |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
66 |
* - `com.sun.management.jdp.port` -- override default port |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
67 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
68 |
* - `com.sun.management.jdp.address` -- override default address |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
69 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
70 |
* - `com.sun.management.jmxremote.autodiscovery` -- whether we should start autodiscovery or |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
71 |
* not. Autodiscovery starts if and only if following conditions are met: (autodiscovery is |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
72 |
* true OR (autodiscovery is not set AND jdp.port is set)) |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
73 |
* |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
74 |
* - `com.sun.management.jdp.ttl` -- set ttl for broadcast packet, default is 1 |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
75 |
* - `com.sun.management.jdp.pause` -- set broadcast interval in seconds default is 5 |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
76 |
* - `com.sun.management.jdp.source_addr` -- an address of interface to use for broadcast |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
77 |
*/ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
78 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
79 |
package sun.management.jdp; |