org.apache.tools.ant.taskdefs
Class Rmic

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.MatchingTask
                    |
                    +--org.apache.tools.ant.taskdefs.Rmic

public class Rmic
extends MatchingTask

Task to compile RMI stubs and skeletons. This task can take the following arguments:

Of these arguments, base is required.

If classname is specified then only that classname will be compiled. If it is absent, then base is traversed for classes according to patterns.

Author:
duncan@x180.com, ludovic.claude@websitewatchers.co.uk, David Maclean david@cm.co.za, Stefan Bodewig, Takashi Okamoto tokamoto@rd.nttdata.co.jp

Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset, useDefaultExcludes
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
Rmic()
           
 
Method Summary
 Path createClasspath()
          Creates a nested classpath element.
 Path createExtdirs()
          Maybe creates a nested extdirs element.
 void execute()
          Called by the project to let the task do it's work.
 java.io.File getBase()
          Gets the base directory to output generated class.
 java.lang.String getClassname()
          Gets the class name to compile.
 Path getClasspath()
          Gets the classpath.
 java.util.Vector getCompileList()
           
 boolean getDebug()
          Gets the debug flag.
 Path getExtdirs()
          Gets the extension directories that will be used during the compilation.
 java.util.Vector getFileList()
          Gets file list to compile.
 boolean getFiltering()
           
 boolean getIdl()
           
 java.lang.String getIdlopts()
          Gets additional arguments for idl compile.
 boolean getIiop()
          Gets iiop flags.
 java.lang.String getIiopopts()
          Gets additional arguments for iiop.
 boolean getIncludeantruntime()
          Gets whether or not the ant classpath is to be included in the task's classpath.
 boolean getIncludejavaruntime()
          Gets whether or not the java runtime should be included in this task's classpath.
 java.lang.ClassLoader getLoader()
          Classloader for the user-specified classpath.
 java.lang.Class getRemoteInterface(java.lang.Class testClass)
          Returns the topmost interface that extends Remote for a given class - if one exists.
 java.io.File getSourceBase()
          Gets the source dirs to find the source java files.
 java.lang.String getStubVersion()
           
 boolean getVerify()
          Get verify flag.
 boolean isValidRmiRemote(java.lang.String classname)
          Load named class and test whether it can be rmic'ed
protected  void scanDir(java.io.File baseDir, java.lang.String[] files, FileNameMapper mapper)
          Scans the directory looking for class files to be compiled.
 void setBase(java.io.File base)
          Sets the base directory to output generated class.
 void setClassname(java.lang.String classname)
          Sets the class name to compile.
 void setClasspath(Path classpath)
          Set the classpath to be used for this compilation.
 void setClasspathRef(Reference r)
          Adds a reference to a CLASSPATH defined elsewhere.
 void setDebug(boolean debug)
          Sets the debug flag.
 void setExtdirs(Path extdirs)
          Sets the extension directories that will be used during the compilation.
 void setFiltering(boolean filter)
           
 void setIdl(boolean idl)
          Indicates that IDL output should be generated.
 void setIdlopts(java.lang.String idlopts)
          pass additional arguments for idl compile
 void setIiop(boolean iiop)
          Indicates that IIOP compatible stubs should be generated.
 void setIiopopts(java.lang.String iiopopts)
          pass additional arguments for iiop
 void setIncludeantruntime(boolean include)
          Include ant's own classpath in this task's classpath?
 void setIncludejavaruntime(boolean include)
          Sets whether or not to include the java runtime libraries to this task's classpath.
 void setSourceBase(java.io.File sourceBase)
          Sets the source dirs to find the source java files.
 void setStubVersion(java.lang.String stubVersion)
          Sets the stub version.
 void setVerify(boolean verify)
          Indicates that the classes found by the directory match should be checked to see if they implement java.rmi.Remote.
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, setDefaultexcludes, setExcludes, setExcludesfile, setIncludes, setIncludesfile, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rmic

public Rmic()
Method Detail

setBase

public void setBase(java.io.File base)
Sets the base directory to output generated class.

getBase

public java.io.File getBase()
Gets the base directory to output generated class.

setClassname

public void setClassname(java.lang.String classname)
Sets the class name to compile.

getClassname

public java.lang.String getClassname()
Gets the class name to compile.

setSourceBase

public void setSourceBase(java.io.File sourceBase)
Sets the source dirs to find the source java files.

getSourceBase

public java.io.File getSourceBase()
Gets the source dirs to find the source java files.

setStubVersion

public void setStubVersion(java.lang.String stubVersion)
Sets the stub version.

getStubVersion

public java.lang.String getStubVersion()

setFiltering

public void setFiltering(boolean filter)

getFiltering

public boolean getFiltering()

setDebug

public void setDebug(boolean debug)
Sets the debug flag.

getDebug

public boolean getDebug()
Gets the debug flag.

setClasspath

public void setClasspath(Path classpath)
Set the classpath to be used for this compilation.

createClasspath

public Path createClasspath()
Creates a nested classpath element.

setClasspathRef

public void setClasspathRef(Reference r)
Adds a reference to a CLASSPATH defined elsewhere.

getClasspath

public Path getClasspath()
Gets the classpath.

setVerify

public void setVerify(boolean verify)
Indicates that the classes found by the directory match should be checked to see if they implement java.rmi.Remote. This defaults to false if not set.

getVerify

public boolean getVerify()
Get verify flag.

setIiop

public void setIiop(boolean iiop)
Indicates that IIOP compatible stubs should be generated. This defaults to false if not set.

getIiop

public boolean getIiop()
Gets iiop flags.

setIiopopts

public void setIiopopts(java.lang.String iiopopts)
pass additional arguments for iiop

getIiopopts

public java.lang.String getIiopopts()
Gets additional arguments for iiop.

setIdl

public void setIdl(boolean idl)
Indicates that IDL output should be generated. This defaults to false if not set.

getIdl

public boolean getIdl()

setIdlopts

public void setIdlopts(java.lang.String idlopts)
pass additional arguments for idl compile

getIdlopts

public java.lang.String getIdlopts()
Gets additional arguments for idl compile.

getFileList

public java.util.Vector getFileList()
Gets file list to compile.

setIncludeantruntime

public void setIncludeantruntime(boolean include)
Include ant's own classpath in this task's classpath?

getIncludeantruntime

public boolean getIncludeantruntime()
Gets whether or not the ant classpath is to be included in the task's classpath.

setIncludejavaruntime

public void setIncludejavaruntime(boolean include)
Sets whether or not to include the java runtime libraries to this task's classpath.

getIncludejavaruntime

public boolean getIncludejavaruntime()
Gets whether or not the java runtime should be included in this task's classpath.

setExtdirs

public void setExtdirs(Path extdirs)
Sets the extension directories that will be used during the compilation.

createExtdirs

public Path createExtdirs()
Maybe creates a nested extdirs element.

getExtdirs

public Path getExtdirs()
Gets the extension directories that will be used during the compilation.

getCompileList

public java.util.Vector getCompileList()

execute

public void execute()
             throws BuildException
Description copied from class: Task
Called by the project to let the task do it's work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running "ant target1 target2" will run all tasks in target3 twice.
Overrides:
execute in class Task
Following copied from class: org.apache.tools.ant.Task
Throws:
BuildException - if someting goes wrong with the build

scanDir

protected void scanDir(java.io.File baseDir,
                       java.lang.String[] files,
                       FileNameMapper mapper)
Scans the directory looking for class files to be compiled. The result is returned in the class variable compileList.

isValidRmiRemote

public boolean isValidRmiRemote(java.lang.String classname)
Load named class and test whether it can be rmic'ed

getRemoteInterface

public java.lang.Class getRemoteInterface(java.lang.Class testClass)
Returns the topmost interface that extends Remote for a given class - if one exists.

getLoader

public java.lang.ClassLoader getLoader()
Classloader for the user-specified classpath.


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.