usr/src/doc/rad-dev/c-client-java.xml
author Stephen Talley <stephen.talley@oracle.com>
Thu, 21 Jun 2012 16:17:18 -0400
changeset 866 30834681f9ce
parent 865 025928ac8888
permissions -rw-r--r--
7178819 radadrgen names Java implementation classes inconsistently
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
767
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
     2
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
     3
<!--
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
     4
  PDL HEADER START
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
     5
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
     6
  Public Documentation License Notice
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
     7
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
     8
  The contents of this Documentation are subject to the Public
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
     9
  Documentation License Version 1.01 (the "License"); you may only
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
    10
  use this Documentation if you comply with the terms of this License.
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
    11
  A copy of the License is available at
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
    12
  http://www.opensolaris.org/os/community/documentation/license.
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
    13
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
    14
  PDL HEADER END
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
    15
797
a33daeba9b4c CR7123217 - Rename adrgen to radadrgen
devjani.ray@oracle.com <devjani.ray@oracle.com>
parents: 767
diff changeset
    16
  Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
767
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
    17
-->
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
    18
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    19
<section>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    20
  <title>Java/JMX Client</title>
767
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
    21
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
    22
<!-- Files -->
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
    23
<!-- Java Packages -->
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    24
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    25
  <section>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    26
    <title>Connecting to the RAD server</title>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    27
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    28
    <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    29
      Connections to a RAD server in Java are made through JMX.  A JMX
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    30
      connection is established with:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    31
    </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    32
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    33
    <orderedlist>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    34
      <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    35
        a <code>javax.management.remote.JMXServiceURL</code> that identifies the
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    36
        protocol to be used, and a host, port, and path where appropriate
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    37
      </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    38
      <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    39
        a <code>Map&lt;String, Object></code> of protocol-specific options,
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    40
        where appropriate
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    41
      </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    42
    </orderedlist>
767
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
    43
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
    44
    <para>
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    45
      Several protocols for connecting to a RAD server are supported and are
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    46
      defined in the <code>com.oracle.solaris.rad.jmx</code> class.  Unless
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    47
      explicitly mentioned, a host, port, path, or options is not applicable:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    48
    </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    49
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    50
    <variablelist>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    51
      <varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    52
        <term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    53
          RadConnector.PROTOCOL_UNIX
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    54
        </term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    55
        <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    56
          <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    57
            A local UNIX domain socket connection.  The path is the
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    58
            fully-qualified name of the socket.
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    59
          </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    60
          <example>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    61
            <title>RadConnector.PROTOCOL_UNIX</title>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    62
            <programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    63
JMXServiceURL url = new JMXServiceURL(RadConnector.PROTOCOL_UNIX,
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    64
  "", 0, "/system/volatile/rad/radsocket");
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    65
JMXConnector connector = JMXConnectorFactory.connect(url);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    66
            </programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    67
          </example>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    68
        </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    69
      </varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    70
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    71
      <varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    72
        <term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    73
          RadConnector.PROTOCOL_TCP
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    74
        </term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    75
        <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    76
          <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    77
            A local/remote TCP connection.  A host and/or port may be
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    78
            specified.
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    79
          </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    80
          <example>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    81
            <title>RadConnector.PROTOCOL_TCP</title>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    82
            <programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    83
JMXServiceURL url = new JMXServiceURL(RadConnector.PROTOCOL_TCP,
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    84
    "myhost", 0);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    85
JMXConnector connector = JMXConnectorFactory.connect(url);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    86
            </programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    87
          </example>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    88
        </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    89
      </varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    90
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    91
      <varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    92
        <term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    93
          RadConnector.PROTOCOL_TLS
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    94
        </term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    95
        <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    96
          <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    97
            A local/remote TLS connection.  A host and/or port may be
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    98
            specified.
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
    99
          </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   100
          <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   101
            Expected parameters:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   102
          </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   103
          <variablelist>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   104
            <varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   105
              <term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   106
                RadConnector.KEY_TLS_TRUSTSTORE (required)
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   107
              </term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   108
              <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   109
                <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   110
                  the full path to a local RAD truststore file
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   111
                </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   112
              </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   113
            </varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   114
            <varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   115
              <term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   116
                RadConnector.KEY_TLS_TRUSTPASS (required)
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   117
              </term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   118
              <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   119
                <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   120
                  the password for the local RAD truststore
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   121
                </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   122
              </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   123
            </varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   124
            <varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   125
              <term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   126
                RadConnector.KEY_TLS_RADMANAGER (required)
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   127
              </term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   128
              <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   129
                <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   130
                  an instance of
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   131
                  <code>com.oracle.solaris.rad.RadTrustManager</code> for key
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   132
                  management
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   133
                </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   134
              </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   135
            </varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   136
          </variablelist>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   137
          <example>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   138
            <title>RadConnector.PROTOCOL_TLS</title>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   139
            <programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   140
Map&lt;String, Object> env = new HashMap&lt;String, Object>();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   141
env.put(RadConnector.KEY_TLS_TRUSTSTORE, "/etc/myapp/truststore");
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   142
env.put(RadConnector.KEY_TLS_TRUSTPASS, "trustpass");
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   143
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   144
JMXServiceURL url = new JMXServiceURL(
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   145
    RadConnector.PROTOCOL_TLS, host, 0);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   146
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   147
JMXConnector connector = JMXConnectorFactory.newJMXConnector(url, null);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   148
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   149
for (;;) {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   150
    RadTrustManager mtm = new RadTrustManager();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   151
    env.put(RadConnector.KEY_TLS_RADMANAGER, mtm);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   152
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   153
    try {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   154
        connector.connect(env);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   155
        break;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   156
    } catch (IOException e) {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   157
        X509Certificate[] chain = mtm.getBadChain();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   158
        if (chain == null) {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   159
            throw e;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   160
        }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   161
    }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   162
}
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   163
            </programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   164
          </example>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   165
        </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   166
      </varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   167
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   168
      <varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   169
        <term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   170
          RadConnector.PROTOCOL_PRIVATE
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   171
        </term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   172
        <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   173
          <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   174
            A local connection to a RAD instance private to this process,
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   175
            spawned when the connection is established.  The resulting
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   176
            <command>rad</command> communicates through its stdin/stdout.
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   177
          </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   178
          <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   179
            Expected parameters:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   180
          </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   181
          <variablelist>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   182
            <varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   183
              <term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   184
                RadConnector.PRIVATE_ROOT (<code>String</code>, optional)
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   185
              </term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   186
              <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   187
                <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   188
                  a full path to prefix the to each relatively-named module in
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   189
                  the <code>RadConnector.PRIVATE_MODULES</code> parameter, if
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   190
                  specified
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   191
                </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   192
              </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   193
            </varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   194
            <varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   195
              <term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   196
                RadConnector.PRIVATE_MODULES (<code>String[]</code>, optional)
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   197
              </term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   198
              <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   199
                <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   200
                  a list of modules to load, as with
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   201
                  <command>/usr/lib/rad/rad</command> <option>-M</option>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   202
                  <replaceable>module</replaceable>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   203
                </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   204
              </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   205
            </varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   206
            <varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   207
              <term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   208
                RadConnector.PRIVATE_AUXARGS (<code>String[]</code>, optional)
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   209
              </term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   210
              <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   211
                <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   212
                  additional arguments to pass to the spawned
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   213
                  <command>rad</command> instance
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   214
                </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   215
              </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   216
            </varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   217
          </variablelist>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   218
          <example>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   219
            <title>RadConnector.PROTOCOL_PRIVATE</title>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   220
            <programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   221
Map&lt;String, Object> env = new HashMap&lt;String, Object>();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   222
String[] auxargs = { "-d", "-e", "30" };
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   223
String[] modules = { "mod_usermgmt.so", "mod_nameservice.so" };
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   224
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   225
env.put(RadConnector.PRIVATE_AUXARGS, auxargs);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   226
env.put(RadConnector.PRIVATE_MODULES, modules);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   227
env.put(RadConnector.PRIVATE_ROOT, "/usr/share/modules");
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   228
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   229
JMXServiceURL url = new JMXServiceURL(
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   230
    RadConnector.PROTOCOL_PRIVATE, "", 0);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   231
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   232
JMXConnector connector = JMXConnectorFactory.newJMXConnector(url, env);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   233
            </programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   234
          </example>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   235
        </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   236
      </varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   237
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   238
      <varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   239
        <term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   240
          RadConnector.PROTOCOL_ZONESBRIDGE
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   241
        </term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   242
        <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   243
          <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   244
            A connection to a non-global zone's local UNIX RAD instance,
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   245
            through an existing local/remote RAD connection to its global
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   246
            zone.  The name of the non-global zone is specified as the host.
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   247
            The non-global zone user is specified as the path.
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   248
          </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   249
          <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   250
            Expected parameters:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   251
          </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   252
          <variablelist>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   253
            <varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   254
              <term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   255
                RadConnector.KEY_ZONESBRIDGE_MXBEAN
833
d41a5ad2fa96 api renaming to conform to dev-guide BP
devjani.ray@oracle.com <devjani.ray@oracle.com>
parents: 825
diff changeset
   256
                (<code>com.oracle.solaris.rad.zonesbridge.IOMXBean</code>,
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   257
                required)
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   258
              </term>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   259
              <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   260
                <para>
833
d41a5ad2fa96 api renaming to conform to dev-guide BP
devjani.ray@oracle.com <devjani.ray@oracle.com>
parents: 825
diff changeset
   261
                  an <code>IOMXBean</code> from an existing RAD connection to
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   262
                  the global zone, retrieved with a domain
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   263
                  "<code>com.oracle.solaris.rad.zonesbridge</code>" and a
842
abc3d63bd4da 7157438 RAD: need to change name of adr password type
devjani.ray@oracle.com <devjani.ray@oracle.com>
parents: 833
diff changeset
   264
                  "type=IO" key/value pair.
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   265
                </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   266
              </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   267
            </varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   268
          </variablelist>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   269
          <example>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   270
            <title>RadConnector.PROTOCOL_ZONESBRIDGE</title>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   271
            <programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   272
// Create a connection to some host
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   273
MBeanServerConnection mbsc = ...
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   274
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   275
ObjectName zioName = new ObjectName(
833
d41a5ad2fa96 api renaming to conform to dev-guide BP
devjani.ray@oracle.com <devjani.ray@oracle.com>
parents: 825
diff changeset
   276
  "com.oracle.solaris.rad.zonesbridge", "type", "IO");
d41a5ad2fa96 api renaming to conform to dev-guide BP
devjani.ray@oracle.com <devjani.ray@oracle.com>
parents: 825
diff changeset
   277
IOMXBean zio = JMX.newMXBeanProxy(mbsc, zioName, IOMXBean.class);
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   278
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   279
// The zone to connect to
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   280
String zone = "nerd-vpn";
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   281
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   282
// The non-global-zone user, or "" to connect as root
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   283
String zoneUser = "talley";
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   284
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   285
// Create a connection to the non-global zone on the connected host
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   286
JMXServiceURL zUrl = new JMXServiceURL(
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   287
    RadConnector.PROTOCOL_ZONESBRIDGE, zone, 0, "/" + zoneUser);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   288
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   289
Map&lt;String, Object> env = new HashMap&lt;String, Object>();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   290
env.put(RadConnector.KEY_ZONESBRIDGE_MXBEAN, zio);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   291
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   292
JMXConnector connector = JMXConnectorFactory.connect(zUrl, env);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   293
            </programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   294
          </example>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   295
        </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   296
      </varlistentry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   297
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   298
    </variablelist>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   299
  </section>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   300
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   301
  <section>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   302
    <title>radadrgen usage</title>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   303
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   304
    <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   305
      In the Java/JMX environment, elements declared in the module
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   306
      specification are translated to Java classes and interfaces.  The tool
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   307
      that does this translation is <command>/usr/bin/radadrgen</command>:
767
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
   308
    </para>
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
   309
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   310
    <cmdsynopsis>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   311
      <command>/usr/bin/radadrgen</command>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   312
      <arg choice="opt">
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   313
        <option>-N</option>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   314
      </arg>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   315
      <arg choice="plain">
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   316
        <option>-j</option>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   317
      </arg>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   318
      <arg choice="plain">
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   319
        <replaceable>dir</replaceable>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   320
      </arg>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   321
      <arg choice="opt">
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   322
        <option>-i</option>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   323
      </arg>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   324
      <arg choice="plain">
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   325
        <replaceable>spec.xml</replaceable>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   326
      </arg>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   327
    </cmdsynopsis>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   328
767
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
   329
    <para>
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   330
      The Java classes and interfaces generated by <command>radadrgen</command>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   331
      are as follows:
767
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
   332
    </para>
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   333
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   334
    <informaltable>
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   335
      <tgroup cols='3'>
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   336
        <thead>
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   337
          <row><entry>Element</entry><entry><command>radadrgen</command>-generated class</entry><entry>Description</entry></row>
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   338
        </thead>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   339
        <tbody>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   340
          <row>
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   341
            <entry><code>&lt;interface> </code></entry>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   342
	    <entry><emphasis>package.interface</emphasis>MXBean</entry>
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   343
            <entry><code>MXBean</code> interface, implemented by object returned
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   344
            by the RAD server</entry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   345
          </row>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   346
          <row>
842
abc3d63bd4da 7157438 RAD: need to change name of adr password type
devjani.ray@oracle.com <devjani.ray@oracle.com>
parents: 833
diff changeset
   347
            <entry><code>&lt;struct></code></entry>
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   348
	    <entry><emphasis>package.struct</emphasis></entry>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   349
            <entry>struct interface</entry>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   350
          </row>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   351
          <row>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   352
            <entry></entry>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   353
	    <entry><emphasis>package.struct</emphasis>Impl</entry>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   354
            <entry>struct implementation (if <option>-i</option> is
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   355
            used)</entry>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   356
          </row>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   357
          <row>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   358
            <entry><code>&lt;union></code></entry>
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   359
	    <entry><emphasis>package.union</emphasis></entry>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   360
            <entry>union interface</entry>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   361
          </row>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   362
          <row>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   363
            <entry></entry>
866
30834681f9ce 7178819 radadrgen names Java implementation classes inconsistently
Stephen Talley <stephen.talley@oracle.com>
parents: 865
diff changeset
   364
	    <entry><emphasis>package.union</emphasis>Impl</entry>
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   365
            <entry>union implementation</entry>
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   366
          </row>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   367
          <row>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   368
            <entry><code>&lt;enum></code></entry>
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   369
            <entry><emphasis>package.enum</emphasis></entry>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   370
	    <entry>enum class</entry>
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   371
          </row>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   372
        </tbody>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   373
      </tgroup>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   374
    </informaltable>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   375
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   376
    <para>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   377
      ...where <emphasis>package</emphasis> is determined from the
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   378
      <code>&lt;api&gt;</code> name or a supplied 
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   379
      <link linkend="adr-idl.pragmas">pragma</link>.  
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   380
      See the section on <link linkend="best-practices.naming.object">object
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   381
      naming</link> for details.
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   382
    </para>
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   383
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   384
    <section>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   385
      <title>Enums</title>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   386
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   387
      <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   388
        For example, given the RAD module specification
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   389
        <code>example.xml</code>:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   390
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   391
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   392
      <programlisting><![CDATA[
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   393
<api xmlns="http://xmlns.oracle.com/radadr"
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   394
  name="com.example.foo">
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   395
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   396
  <enum name="Color">
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   397
    <value name="Red" />
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   398
    <value name="Green" />
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   399
    <value name="Blue" />
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   400
  </enum>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   401
  ...
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   402
</api>
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   403
]]></programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   404
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   405
      <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   406
        Calling:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   407
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   408
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   409
      <programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   410
/usr/bin/radadrgen -j <emphasis>dir</emphasis> example.xml</programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   411
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   412
      <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   413
        ...generates a native Java enum class:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   414
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   415
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   416
      <programlisting><![CDATA[
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   417
package com.example.foo;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   418
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   419
public enum Color {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   420
    Red,
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   421
    Green,
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   422
    Blue,
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   423
}
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   424
]]></programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   425
    </section>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   426
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   427
    <section>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   428
      <title>Structured types</title>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   429
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   430
      <para>
842
abc3d63bd4da 7157438 RAD: need to change name of adr password type
devjani.ray@oracle.com <devjani.ray@oracle.com>
parents: 833
diff changeset
   431
        Adding a <code>&lt;struct></code> to the module API:
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   432
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   433
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   434
      <programlisting><![CDATA[
842
abc3d63bd4da 7157438 RAD: need to change name of adr password type
devjani.ray@oracle.com <devjani.ray@oracle.com>
parents: 833
diff changeset
   435
<struct name="Person">
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   436
  <field type="string" name="name" />
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   437
  <field type="integer" name="age" />
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   438
  <field typeref="Color" name="favoriteColor" />
842
abc3d63bd4da 7157438 RAD: need to change name of adr password type
devjani.ray@oracle.com <devjani.ray@oracle.com>
parents: 833
diff changeset
   439
</struct>
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   440
]]></programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   441
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   442
      <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   443
        ...produces a Java interface that models the structured type:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   444
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   445
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   446
      <programlisting><![CDATA[
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   447
package com.example.foo;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   448
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   449
public interface Person {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   450
    String getName();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   451
    int getAge();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   452
    Color getFavoriteColor();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   453
}
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   454
]]></programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   455
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   456
      <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   457
        If the <option>-i</option> is also passed to
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   458
        <command>radadrgen</command>, an implementation of the
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   459
        <code>Person</code> interface is also generated:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   460
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   461
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   462
      <programlisting><![CDATA[
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   463
package com.example.foo;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   464
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   465
public class PersonImpl implements Person {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   466
    private String name_;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   467
    private int age_;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   468
    private Color favoriteColor_;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   469
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   470
    public PersonImpl() {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   471
    }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   472
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   473
    public PersonImpl(String name, int age, Color favoriteColor) {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   474
        name_ = name;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   475
        age_ = age;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   476
        favoriteColor_ = favoriteColor;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   477
    }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   478
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   479
    public String getName() {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   480
        return name_;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   481
    }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   482
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   483
    public int getAge() {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   484
        return age_;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   485
    }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   486
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   487
    public Color getFavoriteColor() {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   488
        return favoriteColor_;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   489
    }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   490
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   491
    public void setName(String arg) {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   492
        name_ = arg;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   493
    }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   494
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   495
    public void setAge(int arg) {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   496
        age_ = arg;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   497
    }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   498
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   499
    public void setFavoriteColor(Color arg) {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   500
        favoriteColor_ = arg;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   501
    }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   502
}
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   503
]]></programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   504
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   505
      <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   506
        This can be useful in client code to quickly create and use a basic
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   507
        object that implements a structured type's interface.
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   508
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   509
    </section>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   510
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   511
    <section>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   512
      <title>Unions</title>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   513
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   514
      <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   515
        When adding a discriminated union to a module API:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   516
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   517
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   518
      <programlisting><![CDATA[
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   519
<union name="ColorData" typeref="Color">
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   520
  <arm value="Red" type="string" />
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   521
  <arm value="Green" type="integer" />
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   522
  <arm value="Blue" type="float" />
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   523
</union>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   524
]]></programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   525
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   526
      <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   527
        <command>radadrgen</command> produces a Java interface that models the
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   528
        union:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   529
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   530
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   531
      <programlisting><![CDATA[
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   532
package com.example.foo;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   533
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   534
public interface ColorData {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   535
    Color getArm();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   536
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   537
    String getData_Red();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   538
    Integer getData_Green();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   539
    Float getData_Blue();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   540
    ...
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   541
}
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   542
]]></programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   543
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   544
      <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   545
        To use a union, the <code>getArm()</code> method is first called to
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   546
        determine which of the union arms is active.  Based on the return value
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   547
        of that method, the appropriate <code>getData_*()</code> method can be
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   548
        called to get the data encapsulated in the union.
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   549
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   550
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   551
      <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   552
        To create a union, the generated Java interface also includes several
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   553
        static convenience classes:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   554
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   555
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   556
      <programlisting><![CDATA[
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   557
public interface ColorData {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   558
    ...
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   559
866
30834681f9ce 7178819 radadrgen names Java implementation classes inconsistently
Stephen Talley <stephen.talley@oracle.com>
parents: 865
diff changeset
   560
    static class arm_Red extends ColorDataImpl {
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   561
        private String armdata_;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   562
        public arm_Red(String armdata) {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   563
            super(Color.Red);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   564
            armdata_ = armdata;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   565
        }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   566
        @Override
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   567
        public String getData_Red() { return armdata_; }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   568
    }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   569
866
30834681f9ce 7178819 radadrgen names Java implementation classes inconsistently
Stephen Talley <stephen.talley@oracle.com>
parents: 865
diff changeset
   570
    static class arm_Green extends ColorDataImpl {
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   571
        ...
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   572
    }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   573
866
30834681f9ce 7178819 radadrgen names Java implementation classes inconsistently
Stephen Talley <stephen.talley@oracle.com>
parents: 865
diff changeset
   574
    static class arm_Blue extends ColorDataImpl {
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   575
        ...
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   576
    }
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   577
}
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   578
]]></programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   579
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   580
      <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   581
        These inner classes provide a quick way to quickly create and use a
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   582
        basic object that implements the generated union interface for a given
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   583
        union arm.
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   584
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   585
    </section>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   586
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   587
    <section>
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   588
      <title>Interfaces</title>
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   589
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   590
      <para>
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   591
        Interfaces are a module's <emphasis>raison d’être</emphasis>.  For an
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   592
        <code>&lt;interface></code> added to a module:
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   593
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   594
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   595
      <programlisting><![CDATA[
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   596
<interface name="Population">
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   597
  <property name="groupName" access="rw" type="string"/>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   598
  <property name="people" access="ro">
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   599
    <list typeref="Person" />
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   600
  </property>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   601
  <method name="add">
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   602
    <argument typeref="Person" name="person" />
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   603
  </method>
865
025928ac8888 rad dev guide changes for api<->interface rename
Stephen Talley <stephen.talley@oracle.com>
parents: 842
diff changeset
   604
</interface>
825
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   605
]]></programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   606
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   607
      <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   608
        <command>radadrgen</command> produces a Java <code>MXBean</code>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   609
        interface:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   610
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   611
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   612
      <programlisting><![CDATA[
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   613
package com.example.foo;
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   614
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   615
public interface PopulationMXBean {
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   616
    String getgroupName();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   617
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   618
    void setgroupName(String groupName);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   619
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   620
    java.util.List<Person> getpeople();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   621
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   622
    void add(Person person);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   623
}
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   624
]]></programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   625
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   626
      <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   627
        This <code>MXBean</code> is implemented by the objects returned by the
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   628
        RAD server:
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   629
      </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   630
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   631
      <programlisting><![CDATA[
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   632
// Retrieve the Population object
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   633
ObjectName oName = new ObjectName("com.example.foo",
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   634
    "type", "Population");
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   635
PopulationMXBean pop = JMX.newMXBeanProxy(mbsc,
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   636
    oName, PopulationMXBean.class);
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   637
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   638
// Access a property
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   639
List<Person> people = pop.getpeople();
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   640
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   641
// Call a method
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   642
pop.add(new PersonImpl("talley", Color.GREEN));
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   643
]]></programlisting>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   644
    </section>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   645
  </section>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   646
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   647
  <section>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   648
    <title>Caveats</title>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   649
    <itemizedlist>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   650
      <listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   651
        <para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   652
          To eliminate the ambiguity inherent to the JMX ObjectName quoting
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   653
          rules, all key values returned by interfaces that return
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   654
          ObjectNames are quoted by the JMX client connector before being
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   655
          passed to the caller.  (For compatibility, the JMX client connector
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   656
          will accept object names with unquoted key values).
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   657
        </para>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   658
      </listitem>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   659
    </itemizedlist>
96e896682211 7092753 Integrate RAD into ON
Stephen Talley <stephen.talley@oracle.com>
parents: 797
diff changeset
   660
  </section>
767
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
   661
a7b6e6d4061d 18861 Complete libadr dev guide chapter
David Powell <david.e.powell@oracle.com>
parents:
diff changeset
   662
</section>