RmidTask
Wednesday, November 13, 2002
Description
Runs the remote method invocation deamon (the rmi activation system) as a background process.
This task is a simple extension of the BackgroundExecTask and inherits all its behavior and parameters. Please read the manual page for BackgroundExecTask for a complete description of attributes.
Parameters
Attribute |
Description |
Required |
executable |
Inherited from BackgroundExecTask. |
No, defaults to <java.home>/bin/rmid |
id |
Unique identifier for this process, required if you wish to further manage the spawned process using the ProcessTask |
No |
newenvironment |
Inherited from BackgroundExecTask. |
No, defaults to true |
startuptime |
Inherited from BackgroundExecTask. |
No, defaults to 1 second |
security |
The security policy to use. While not required, rmid will not do much without a security policy. Same as specifying -J-Djava.security.policy=<some policy> on the command line. |
No |
log |
The log directory, equivalent to specifying -log on the command line. If the dir attribute is not specified, the log directory is used. |
No, defaults to working directory |
execpolicy |
Sets the execPolicy for spawning child VMS, equivalent to specifying -J-Dsun.rmi.activation.execPolicy on the command line. NOTE: This property is for use only with Sun's implementation of the RMI activation system. Use of this property otherwise may result in undefined behavior. |
No |
stop |
Cleanly stops the rmid process listening on given port (or default port). Same as issuing rmid -stop -port 1098 at the command prompt. |
No, defaults to false |
logcalls |
Log calls to child VMS. Same as specifying -C-Djava.rmi.server.logCalls=true on the command line. |
No, defaults to false |
port |
The port number for rmid to listen on. |
No, defaults to 1098 |
Example
<taskdef name="rmid" classname="com.eatrmi.tools.ant.taskdefs.rmi.RmidTask"/>
<taskdef name="proc" classname="com.eatrmi.tools.ant.taskdefs.process.ProcessTask"/>
<rmid id="rmid" port="16000" security="mysecurity.policy"/>
<proc refid="rmid" resultproperty="rmid.result"/>
<fail if="rmid.result" message="Activation system died prematurely"/>
<rmid stop="true" port="16000"/>
Starts the activation system on port 16000. Then, later, checks to see if rmid is still alive using the ProcessTask and fails if it's not. Finally, stops the activation system listening on port 16000.