home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / JBuilder8.iso / Solaris / resource / jre / man / sman1 / rmid.1 < prev    next >
Encoding:
Text File  |  2002-09-06  |  18.2 KB  |  158 lines

  1. <!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
  2. <!--ArborText, Inc., 1988-1999, v.4002-->
  3. <!ENTITY % javaents SYSTEM "javaman.ent">
  4. %javaents;
  5. ]>
  6. <?Pub UDT _bookmark _target>
  7. <?Pub Inc>
  8. <refentry id="rmid-1">
  9. <!--@(#)rmid.1 1.11 01/03/14 SMI;-->
  10. <refmeta><refentrytitle>rmid</refentrytitle><manvolnum>1</manvolnum>
  11. <refmiscinfo class="date">23 Apr 2001</refmiscinfo>
  12. <refmiscinfo class="sectdesc">&man1;</refmiscinfo>
  13. <refmiscinfo class="software">&java-release;</refmiscinfo>
  14. <refmiscinfo class="arch">generic</refmiscinfo>
  15. <refmiscinfo class="copyright"> Copyright 2001 Sun Microsystems, Inc. All rights reserved.  Copyright 2001 Sun Microsystems, Inc. Tous droits réservés.  </refmiscinfo>
  16. </refmeta>
  17. <refnamediv><refname>rmid</refname><refpurpose>RMI activation system daemon</refpurpose></refnamediv>
  18. <refsynopsisdiv><title>&synp-tt;</title>
  19. <cmdsynopsis><command>rmid</command><arg choice="opt"><replaceable>options</replaceable></arg>
  20. </cmdsynopsis></refsynopsisdiv>
  21. <refsect1><title>&desc-tt;</title>
  22. <indexterm id="rmid-1-indx-1"><primary sortas="RMI activation system daemon">RMI activation system daemon — rmid</primary></indexterm><indexterm id="rmid-1-indx-2"><primary sortas="rmid">rmid — RMI activation system daemon</primary></indexterm><para>The <command>rmid</command> tool starts the activation system daemon. Before activatable objects can be either registered with the activation
  23. system or activated in a Java VM, the activation system daemon must be started. See the <citetitle>RMI Specification</citetitle> and <citetitle>Activation Tutorials</citetitle> for details on how to write programs that use activatable remote objects.</para>
  24. <para>The daemon can be started by executing the <command>rmid</command> command, and specifying a security policy file, as follows:<informalexample><screen>example% <userinput>rmid –J–Djava.security.policy=rmid.policy</userinput></screen>
  25. </informalexample></para>
  26. <para><emphasis>Note:</emphasis> When running Sun's implementation of <command>rmid</command>, by default you will need to specify a security policy file so that <command>rmid</command> can verify whether or not <literal>ActivationGroupDesc</literal> is allowed to be used to launch a <acronym>JVM</acronym> for an activation group. Specifically, the command and options specified by the <literal>CommandEnvironment
  27. </literal> and any <literal>Properties</literal> passed to an <literal>ActivationGroupDesc</literal>'s constructor must now be explicitly allowed in the security policy file for <command>rmid</command>. The value of the <literal>sun.rmi.activation.execPolicy</literal> property dictates the policy that <command>rmid</command> uses to determine whether or not the information in an <literal>ActivationGroupDesc
  28. </literal> may be used to launch a <acronym>JVM</acronym> for an activation group.</para>
  29. <para>Executing <command>rmid</command> by default</para>
  30. <itemizedlist>
  31. <listitem><para>starts the Activator and an internal registry on the default port, <literal>1098</literal>, and </para></listitem>
  32. <listitem><para>binds an <literal>ActivationSystem</literal> to the name <literal>java.rmi.activation.ActivationSystem</literal> in this internal registry.</para></listitem>
  33. </itemizedlist>
  34. <para>To specify an alternate port for the registry, you must specify the <option>port</option> option when starting up <command>rmid</command>. For example,<informalexample><screen><userinput>rmid –J–Djava.security.policy=rmid.policy –port 1099</userinput></screen>
  35. </informalexample>starts the activation system daemon and a registry on the registry's default port, <literal>1099</literal>.</para>
  36. </refsect1>
  37. <refsect1><title>&opts-tt;</title>
  38. <para>The following options are supported:</para>
  39. <variablelist termlength="wholeline"><varlistentry><term><option>C</option><replaceable>someCommandLineOption</replaceable> </term><listitem><para>Specifies an option that is passed as a command-line argument to each child process (activation group) of <command>rmid</command> when that process is created.  For example, you could pass a property to each Java virtual machine spawned by the activation
  40. system daemon:<informalexample><screen><userinput>rmid –C–Dsome.property=value</userinput></screen>
  41. </informalexample>This ability to pass command-line arguments  to child processes can be useful for debugging. For example, the following command:<informalexample><screen><userinput>rmid –C–Djava.rmi.server.logCalls=true</userinput></screen>
  42. </informalexample>will enable server-call logging in all child <acronym>JVM</acronym>s.</para>
  43. </listitem></varlistentry>
  44. <varlistentry><term><option>J</option><replaceable>someCommandLineOption</replaceable></term><listitem><para>Specifies an option that is passed to the java interpreter running <command>rmid</command>. For example, to specify that <command>rmid</command> use a policy file named <literal>rmid.policy</literal>, the <option>J</option> option can be used to define the <literal>java.security.policy</literal>
  45. property on <command>rmid</command>'s command line. For example:<informalexample><screen><userinput>rmid –J–Djava.security.policy=rmid.policy</userinput></screen>
  46. </informalexample></para>
  47. </listitem></varlistentry>
  48. <varlistentry><term><option>J</option><option>D</option>sun.rmi.activation.execPolicy=<replaceable>policy</replaceable> </term><listitem><para>Specifies the policy that <command>rmid</command> employs to check commands and command-line options used to launch the <acronym>JVM</acronym> in which an activation group runs. Please notice that this option exists only in Sun's implementation of the <acronym>
  49. RMI</acronym> activation daemon. If this property is not specified on the command line, the result is the same as if <literal>–J-Dsun.rmi.activation.execPolicy=default</literal> were specified. The possible values of <replaceable>policy</replaceable> can be <literal>default</literal>, <replaceable>policyClassName</replaceable>, or <literal>none</literal>:  <itemizedlist>
  50. <listitem><para><literal>default</literal> (or if this property is <emphasis>unspecified</emphasis>).</para>
  51. <para>The default <literal>execPolicy</literal> allows <command>rmid</command> to execute commands with specific command-line options only if <command>rmid</command> has been granted permission to execute those commands and options in the security policy file that <command>rmid</command> uses. Only the default activation group implementation can be used with the <literal>default</literal> execution
  52. policy.</para>
  53. <para><command>rmid</command> launches a <acronym>JVM</acronym> for an activation group using the information in the group's registered activation group descriptor, an <literal>ActivationGroupDesc</literal>. The group descriptor specifies an optional <literal>ActivationGroupDesc.CommandEnvironment</literal> that includes the <emphasis>command</emphasis> to execute to start the activation group as well
  54. as any command line <replaceable>options</replaceable> to be added to the command line. By default, <command>rmid</command> uses the <command>java</command> command found in <literal>java.home</literal>. The group descriptor also contains <replaceable>properties</replaceable> overrides that are added to the command line as options defined as:<informalexample><screen><userinput>-D <replaceable>property
  55. </replaceable>=<replaceable>value</replaceable></userinput></screen>
  56. </informalexample>The permission <literal>com.sun.rmi.rmid.ExecPermission</literal> is used to grant <command>rmid</command> permission to execute a command, specified in the group descriptor's <literal>CommandEnvironment</literal> to launch an activation group. The permission <literal>com.sun.rmi.rmid.ExecOptionPermission</literal> is used to allow <command>rmid</command> to use command-line options,
  57. specified as properties overrides in the group descriptor or as options in the <literal>CommandEnvironment</literal>, when launching the activation group.</para>
  58. <para>When granting <command>rmid</command> permission to execute various commands and options, the permissions <literal>ExecPermission</literal> and <literal>ExecOptionPermission</literal> need to be granted universally (that is, granted to all code sources).  <variablelist termlength="wholeline"><varlistentry><term remap="7"><literal>ExecPermission</literal> </term><listitem><para>The <literal>ExecPermission
  59. </literal> class represents permission for <command>rmid</command> to execute a specific command to launch an activation group.<variablelist termlength="xtranarrow"><varlistentry><term><literal>Syntax</literal></term><listitem><para>The name of an <literal>ExecPermission</literal> is the path name of a command to grant <command>rmid</command> permission to execute. A path name that ends in "/*" indicates
  60. all the files contained in that directory (where "/" is the file-separator character, <literal>File.separatorChar</literal>). A path name that ends with "/-" indicates all files and subdirectories contained in that directory (recursively). A path name consisting of the special token "<<ALL FILES>>" matches <emphasis>any</emphasis> file. </para>
  61. <para><emphasis>Note:</emphasis> A path name consisting of a single "*" indicates all the files in the current directory, while a path name consisting of a single "-" indicates all the files in the current directory and (recursively) all files and subdirectories contained in the current directory.</para>
  62. </listitem></varlistentry>
  63. </variablelist> </para>
  64. </listitem></varlistentry>
  65. <varlistentry><term><literal>ExecOptionPermission</literal> </term><listitem><para>The <literal>ExecOptionPermission</literal> class represents permission for <command>rmid</command> to use a specific command-line option when launching an activation group. The name of an <literal>ExecOptionPermission</literal> is the value of a command line option.<variablelist termlength="xtranarrow"><varlistentry>
  66. <term><literal>Syntax</literal></term><listitem><para>Options support a limited wildcard scheme. An asterisk signifies a wildcard match, and it may appear as the option name itself (that is, it matches any option), or an asterisk may appear at the end of the option name only if the asterisk follows either a "." or "=".</para>
  67. <para>For example: "*" or "–Dfoo.*" or "-Da.b.c=*" is valid; "*foo" or "-Da*b" or "ab*" is not.</para>
  68. </listitem></varlistentry>
  69. </variablelist></para>
  70. </listitem></varlistentry>
  71. </variablelist></para>
  72. <para><literal>Policy file for rmid</literal></para>
  73. <para>When granting <command>rmid</command> permission to execute various commands and options, the permissions <literal>ExecPermission</literal> and <literal>ExecOptionPermission</literal> need to be granted universally (that is, granted to all code sources). It is safe to grant these permissions universally because only <command>rmid</command> checks these permissions.</para>
  74. <para>An example policy file that grants various execute permissions to <literal>rmid</literal> is:  <screen>grant {
  75.     permission com.sun.rmi.rmid.ExecPermission
  76.         "/files/apps/java/jdk1.2.2/solaris/bin/java";
  77.  
  78.     permission com.sun.rmi.rmid.ExecPermission
  79.         "/files/apps/java/jdk1.2.2/solaris/bin/java_g";
  80.  
  81.     permission com.sun.rmi.rmid.ExecPermission
  82.         "/files/apps/rmidcmds/*";
  83.  
  84.     permission com.sun.rmi.rmid.ExecOptionPermission
  85.         "–Djava.security.policy=/files/policies/group.policy";
  86.  
  87.     permission com.sun.rmi.rmid.ExecOptionPermission
  88.         "–Djava.security.debug=*";
  89.  
  90.     permission com.sun.rmi.rmid.ExecOptionPermission
  91.         "–Dsun.rmi.*";
  92. };</screen>The first two permissions granted allow <command>rmid</command> to execute the 1.2.2 version of the <command>java</command> and <command>java_g</command> commands, specified by their explicit path names. Notice that by default, the version of the <command>java</command> command found in <literal>java.home</literal> is used (the same one that <command>rmid</command> uses), and does not need
  93. to be specified in the policy file. The third permission allows <command>rmid</command> to execute any command in the directory <literal>/files/apps/rmidcmds</literal>. The fourth permission granted, an <literal>ExecOptionPermission</literal>, allows <command>rmid</command> to launch an activation group that defines the security policy file to be <literal>/files/policies/group.policy</literal>. The
  94. next permission allows the <literal>java.security.debug</literal> property to be used by an activation group. The last permission allows any property in the <literal>sun.rmi</literal> property name hierarchy to be used by activation groups. To start <command>rmid</command> with a policy file, the <literal>java.security.policy</literal> property needs to be specified on <command>rmid</command>'s command
  95. line. For example:<informalexample><screen><userinput>rmid –J–Djava.security.policy=rmid.policy</userinput></screen>
  96. </informalexample></para>
  97. </listitem>
  98. <listitem><para><replaceable>policyClassName</replaceable></para>
  99. <para>If the default behavior is not flexible enough, an administrator can provide, when starting <command>rmid</command>, the name of a class whose <literal>checkExecCommand</literal> method is executed in order to check commands to be executed by <command>rmid</command>. The <literal>policyClassName</literal> specifies a public class with a public, no-argument constructor and an implementation of
  100. the following <literal>checkExecCommand</literal> method:  <screen>public void checkExecCommand(ActivationGroupDesc desc,
  101.                                          String[] command)
  102.                 throws SecurityException;</screen>Before launching an activation group, <command>rmid</command> calls the policy's <literal>checkExecCommand</literal> method, passing it the activation group descriptor and an array containing the complete command to launch the activation group. If the <literal>checkExecCommand</literal> throws a <literal>SecurityException</literal>, <command>rmid</command>
  103. will not launch the activation group and an <literal>ActivationException</literal> will be thrown to the caller attempting to activate the object. </para>
  104. </listitem>
  105. <listitem><para><literal>none</literal></para>
  106. <para>If the <literal>sun.rmi.activation.execPolicy</literal> property value is <literal>none</literal>, then <command>rmid</command> will not perform any validation of commands to launch activation groups.</para>
  107. </listitem>
  108. </itemizedlist></para>
  109. </listitem></varlistentry>
  110. <varlistentry><term><option>log</option> <replaceable>dir</replaceable></term><listitem><para>Specifies the name of the directory the activation system daemon uses to write its database and associated information. The log directory defaults to creating a directory, <literal>log</literal>, in the directory in which the <command>rmid</command> command was executed.</para>
  111. </listitem></varlistentry>
  112. <varlistentry><term><option>port</option> <replaceable>port</replaceable> </term><listitem><para>Specifies the port <command>rmid</command>'s registry uses. The activation system daemon binds the <literal>ActivationSystem</literal>, with the name <literal>java.rmi.activation.ActivationSystem</literal>, in this registry. Thus, the <literal>ActivationSystem</literal> on the local machine can be obtained
  113. using the following <literal>Naming.lookup</literal> method call:</para>
  114. </listitem></varlistentry>
  115. </variablelist><informalexample><para><screen>import java.rmi.*;
  116. import java.rmi.activation.*;
  117.  
  118. ActivationSystem system;
  119. system = (ActivationSystem)
  120. Naming.lookup("//:port/java.rmi.activation.ActivationSystem");</screen></para>
  121. </informalexample>
  122. <variablelist termlength="xtranarrow"><varlistentry><term><option>stop</option> </term><listitem><para>Stops the current invocation of <command>rmid</command>, for a port specified by the <option>port</option> option. If no <replaceable>port</replaceable> is specified, it will stop the <command>rmid</command> running on port <literal>1098</literal>.</para>
  123. </listitem></varlistentry>
  124. </variablelist></refsect1>
  125. <refsect1><title>&envr-tt;</title>
  126. <variablelist termlength="medium"><varlistentry><term remap="20"><envar>CLASSPATH</envar></term><listitem><para>Used to provide the system a path to user-defined classes. Directories are separated by colons. For example, <informalexample><para><screen>example% <userinput>.:/usr/local/java/classes</userinput></screen></para>
  127. </informalexample></para>
  128. </listitem></varlistentry>
  129. </variablelist></refsect1>
  130. <refsect1><title>&attr-tt;</title>
  131. <para>See <citerefentry><refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry> for a description of the following attributes:</para>
  132. <informaltable frame="all" orient="port">
  133. <tgroup cols="2" colsep="1" rowsep="1"><colspec colnum="1" colname="col1" colwidth="1*" colsep="1" align="left"><colspec colnum="2" colname="col2" colwidth="1*" align="left">
  134. <thead>
  135. <row><entry colname="col1" align="center" valign="top">ATTRIBUTE TYPE</entry><entry colname="col2" align="center" valign="top">ATTRIBUTE VALUE</entry></row>
  136. </thead>
  137. <tbody>
  138. <row><entry>Availability</entry><entry>SUNWj3rt, SUNWj3dev</entry></row>
  139. </tbody>
  140. </tgroup>
  141. </informaltable>
  142. </refsect1>
  143. <refsect1><title>&also-tt;</title>
  144. <para><citerefentry><refentrytitle>rmic</refentrytitle><manvolnum>1</manvolnum></citerefentry>, <citerefentry><refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry> </para>
  145. <para>See (or search <literal>java.sun.com</literal>) for the following:</para>
  146. <variablelist termlength="wholeline"><varlistentry><?Pub Caret1><term remap="10"><citetitle>Setting the Classpath</citetitle> @</term><listitem><para><ulink url="http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/classpath.html">http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/classpath.html</ulink></para>
  147. </listitem></varlistentry>
  148. <varlistentry><term remap="10"><citetitle>RMI Specification</citetitle> @</term><listitem><para><ulink url="http://java.sun.com/j2se/1.4/docs/guide/rmi/spec/rmiTOC.html">http://java.sun.com/j2se/1.4/docs/guide/rmi/spec/rmiTOC.html</ulink></para>
  149. </listitem></varlistentry>
  150. </variablelist></refsect1>
  151. <!--+ 07/27/00 08:35:49
  152.     | tagMorph:  $Id: tagMorph-engine 1.54 1998/01/19 05:44:48 $
  153.     | tagMorph library:  $Id: libtagMorph.a 1.50 1998/01/19 22:02:51 $
  154.     | sunman-to-solbook 1.17
  155.     +-->
  156. </refentry>
  157. <?Pub *0000018647 0>
  158.