The rmid Command

Name

rmid - start the activation system daemon that enables objects to be registered and activated in a Java Virtual Machine (JVM)

Synopsis

rmid [options]

options
This represent the command-line options for the rmid command. See Options for rmid.

Description

The rmid command starts the activation system daemon. The activation system daemon must be started before objects that can be activated are either registered with the activation system or activated in a JVM.

Start the daemon by executing the rmid command and specifying a security policy file, as follows:

rmid -J-Djava.security.policy=rmid.policy

When you run Oracle's implementation of the rmid command, by default you must specify a security policy file so that the rmid command can verify whether or not the information in each ActivationGroupDesc is allowed to be used to start a JVM for an activation group. Specifically, the command and options specified by the CommandEnvironment and any properties passed to an ActivationGroupDesc constructor must now be explicitly allowed in the security policy file for the rmid command. The value of the sun.rmi.activation.execPolicy property dictates the policy that the rmid command uses to determine whether or not the information in an ActivationGroupDesc can be used to start a JVM for an activation group. For more information see the description of the -J-Dsun.rmi.activation.execPolicy=policy option.

Executing the rmid command starts the Activator and an internal registry on the default port 1098 and binds an ActivationSystem to the name java.rmi.activation.ActivationSystem in this internal registry.

To specify an alternate port for the registry, you must specify the -port option when you execute the rmid command. For example, the following command starts the activation system daemon and a registry on the registry's default port, 1099.

rmid -J-Djava.security.policy=rmid.policy -port 1099

Start RMID on Demand (Oracle Solaris and Linux Only)

An alternative to starting rmid from the command line is to configure inetd (Oracle Solaris) or xinetd (Linux) to start rmid on demand.

When RMID starts, it attempts to obtain an inherited channel (inherited from inetd/xinetd) by calling the System.inheritedChannel method. If the inherited channel is null or not an instance of java.nio.channels.ServerSocketChannel, then RMID assumes that it wasn't started by inetd/xinetd, and it starts as previously described.

If the inherited channel is a ServerSocketChannel instance, then RMID uses the java.net.ServerSocket obtained from the ServerSocketChannel as the server socket that accepts requests for the remote objects it exports: The registry in which the java.rmi.activation.ActivationSystem is bound and the java.rmi.activation.Activator remote object. In this mode, RMID behaves the same as when it is started from the command line, except in the following cases:

Options for rmid

-Coption

Specifies an option that's passed as a command-line argument to each child process (activation group) of the rmid command when that process is created. For example, you could pass a property to each virtual machine spawned by the activation system daemon:

rmid -C-Dsome.property=value

This ability to pass command-line arguments to child processes can be useful for debugging. For example, the following command enables server-call logging in all child JVMs.

rmid -C-Djava.rmi.server.logCalls=true

-Joption

Specifies an option that's passed to the Java interpreter running RMID command. For example, to specify that the rmid command use a policy file named rmid.policy, the -J option can be used to define the java.security.policy property on the rmid command line, for example:

rmid -J-Djava.security.policy-rmid.policy

-J-Dsun.rmi.activation.execPolicy=policy

Specifies the policy that the RMID command employs to check commands and command-line options used to start the JVM in which an activation group runs. This option exists only in Oracle's implementation of the Java RMI activation daemon. If this property isn't specified on the command line, then the result is the same as though -J-Dsun.rmi.activation.execPolicy=default were specified.

The possible values of policy can be default, policyClassName, or none.

-log dir
Specifies the name of the directory that the activation system daemon uses to write its database and associated information. The log directory defaults to creating a log, in the directory in which the rmid command was executed.
-port port

Specifies the port that the registry uses. The activation system daemon binds ActivationSystem, with the name java.rmi.activation.ActivationSystem, in this registry. The ActivationSystem on the local machine can be obtained using the following Naming.lookup method call:

import java.rmi.*;
import java.rmi.activation.*;

ActivationSystem system; system = (ActivationSystem)
Naming.lookup("//:port/java.rmi.activation.ActivationSystem");
-stop
Stops the current invocation of the rmid command for a port specified by the -port option. If no port is specified, then this option stops the rmid invocation running on port 1098.