Class DefaultRmicAdapter
java.lang.Object
org.apache.tools.ant.taskdefs.rmic.DefaultRmicAdapter
- All Implemented Interfaces:
RmicAdapter
- Direct Known Subclasses:
ForkingSunRmic
,KaffeRmic
,SunRmic
,WLRmic
public abstract class DefaultRmicAdapter extends java.lang.Object implements RmicAdapter
This is the default implementation for the RmicAdapter interface.
Currently, this is a cut-and-paste of the original rmic task and
DefaultCompilerAdapter.
- Since:
- Ant 1.4
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
RMI_SKEL_SUFFIX
suffix denoting a skel file: "_Skel"static java.lang.String
RMI_STUB_SUFFIX
suffix denoting a stub file: "_Stub"static java.lang.String
RMI_TIE_SUFFIX
suffix denoting a tie file: "_Tie"static java.lang.String
STUB_1_1
arg for 1.1: "-v1.1"static java.lang.String
STUB_1_2
arg for 1.2: "-v1.2"static java.lang.String
STUB_COMPAT
arg for compat: "-vcompat"static java.lang.String
STUB_OPTION_1_1
option for stub 1.1 in the rmic task: "1.1"static java.lang.String
STUB_OPTION_1_2
option for stub 1.2 in the rmic task: "1.2"static java.lang.String
STUB_OPTION_COMPAT
option for stub compat in the rmic task: "compat" -
Constructor Summary
Constructors Constructor Description DefaultRmicAdapter()
-
Method Summary
Modifier and Type Method Description protected java.lang.String
addStubVersionOptions()
This is an override point; get the stub version off the rmic command and translate that into a compiler-specific argumentprotected boolean
areIiopAndIdlSupported()
Whether the iiop and idl switches are supported.protected java.lang.String[]
filterJvmCompilerArgs(java.lang.String[] compilerArgs)
Strip out all -J args from the command list.Path
getClasspath()
Gets the CLASSPATH this rmic process will use.protected Path
getCompileClasspath()
Builds the compilation classpath.FileNameMapper
getMapper()
This implementation returns a mapper that may return up to two file names.Rmic
getRmic()
Get the Rmic attributesprotected java.lang.String
getSkelClassSuffix()
Gets the skeleton class suffixprotected java.lang.String
getStubClassSuffix()
Gets the stub class suffixprotected java.lang.String
getTieClassSuffix()
Gets the tie class suffixprotected void
logAndAddFilesToCompile(Commandline cmd)
Logs the compilation parameters, adds the files to compile and logs the "niceSourceList"protected java.lang.String[]
preprocessCompilerArgs(java.lang.String[] compilerArgs)
Preprocess the compiler arguments in any way you see fit.void
setRmic(Rmic attributes)
Sets Rmic attributesprotected Commandline
setupRmicCommand()
Setup rmic argument for rmic.protected Commandline
setupRmicCommand(java.lang.String[] options)
Setup rmic argument for rmic.
-
Field Details
-
RMI_STUB_SUFFIX
public static final java.lang.String RMI_STUB_SUFFIXsuffix denoting a stub file: "_Stub"- See Also:
- Constant Field Values
-
RMI_SKEL_SUFFIX
public static final java.lang.String RMI_SKEL_SUFFIXsuffix denoting a skel file: "_Skel"- See Also:
- Constant Field Values
-
RMI_TIE_SUFFIX
public static final java.lang.String RMI_TIE_SUFFIXsuffix denoting a tie file: "_Tie"- See Also:
- Constant Field Values
-
STUB_COMPAT
public static final java.lang.String STUB_COMPATarg for compat: "-vcompat"- See Also:
- Constant Field Values
-
STUB_1_1
public static final java.lang.String STUB_1_1arg for 1.1: "-v1.1"- See Also:
- Constant Field Values
-
STUB_1_2
public static final java.lang.String STUB_1_2arg for 1.2: "-v1.2"- See Also:
- Constant Field Values
-
STUB_OPTION_1_1
public static final java.lang.String STUB_OPTION_1_1option for stub 1.1 in the rmic task: "1.1"- See Also:
- Constant Field Values
-
STUB_OPTION_1_2
public static final java.lang.String STUB_OPTION_1_2option for stub 1.2 in the rmic task: "1.2"- See Also:
- Constant Field Values
-
STUB_OPTION_COMPAT
public static final java.lang.String STUB_OPTION_COMPAToption for stub compat in the rmic task: "compat"- See Also:
- Constant Field Values
-
-
Constructor Details
-
DefaultRmicAdapter
public DefaultRmicAdapter()
-
-
Method Details
-
setRmic
Sets Rmic attributes- Specified by:
setRmic
in interfaceRmicAdapter
- Parameters:
attributes
- the rmic attributes
-
getRmic
Get the Rmic attributes- Returns:
- the attributes as a Rmic taskdef
-
getStubClassSuffix
protected java.lang.String getStubClassSuffix()Gets the stub class suffix- Returns:
- the stub suffix "_Stub"
-
getSkelClassSuffix
protected java.lang.String getSkelClassSuffix()Gets the skeleton class suffix- Returns:
- the skeleton suffix "_Skel"
-
getTieClassSuffix
protected java.lang.String getTieClassSuffix()Gets the tie class suffix- Returns:
- the tie suffix "_Tie"
-
getMapper
This implementation returns a mapper that may return up to two file names.- for JRMP it will return *_getStubClassSuffix (and *_getSkelClassSuffix if JDK 1.1 is used)
- for IDL it will return a random name, causing <rmic> to always recompile.
- for IIOP it will return _*_getStubClassSuffix for interfaces and _*_getStubClassSuffix for non-interfaces (and determine the interface and create _*_Stub from that).
- Specified by:
getMapper
in interfaceRmicAdapter
- Returns:
- a
FileNameMapper
-
getClasspath
Gets the CLASSPATH this rmic process will use.- Specified by:
getClasspath
in interfaceRmicAdapter
- Returns:
- the classpath
-
getCompileClasspath
Builds the compilation classpath.- Returns:
- the classpath
-
areIiopAndIdlSupported
protected boolean areIiopAndIdlSupported()Whether the iiop and idl switches are supported.This implementation returns false if running on Java 11 onwards and true otherwise.
- Returns:
- true if the iiop and idl switches are supported
- Since:
- Ant 1.10.3
-
setupRmicCommand
Setup rmic argument for rmic.- Returns:
- the command line
-
setupRmicCommand
Setup rmic argument for rmic.- Parameters:
options
- additional parameters needed by a specific implementation.- Returns:
- the command line
-
addStubVersionOptions
protected java.lang.String addStubVersionOptions()This is an override point; get the stub version off the rmic command and translate that into a compiler-specific argument- Returns:
- a string to use for the stub version; can be null
- Since:
- Ant1.7.1
-
preprocessCompilerArgs
protected java.lang.String[] preprocessCompilerArgs(java.lang.String[] compilerArgs)Preprocess the compiler arguments in any way you see fit. This is to allow compiler adapters to validate or filter the arguments. The base implementation returns the original compiler arguments unchanged.- Parameters:
compilerArgs
- the original compiler arguments- Returns:
- the filtered set.
-
filterJvmCompilerArgs
protected java.lang.String[] filterJvmCompilerArgs(java.lang.String[] compilerArgs)Strip out all -J args from the command list. Invoke this frompreprocessCompilerArgs(String[])
if you have a non-forking compiler.- Parameters:
compilerArgs
- the original compiler arguments- Returns:
- the filtered set.
-
logAndAddFilesToCompile
Logs the compilation parameters, adds the files to compile and logs the "niceSourceList"- Parameters:
cmd
- the commandline args
-