Package org.codehaus.mojo.rmic
Class AbstractRmiMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.rmic.AbstractRmiMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
,RmicConfig
- Direct Known Subclasses:
RmicMojo
,TestRmicMojo
public abstract class AbstractRmiMojo extends org.apache.maven.plugin.AbstractMojo implements RmicConfig
Generic super class of rmi compiler mojos.- Version:
- $Id: AbstractRmiMojo.java 17137 2012-07-16 15:08:49Z russgold $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interface
AbstractRmiMojo.DependenciesFacade
An interface for dependencies on the file system and related mojo base classes.(package private) static class
AbstractRmiMojo.DependenciesFacadeImpl
Standard file system and mojo dependencies.
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
compilerId
The id of the rmi compiler to use.private AbstractRmiMojo.DependenciesFacade
dependencies
The interface between ths class and the rest of the world - unit tests replace the default implementation.private static AbstractRmiMojo.DependenciesFacade
DEPENDENCIES_FACADE
The default implementation of the dependencies.protected java.util.Set
excludes
A list of exclusions when searching for classes to compile.private boolean
idl
Create IDL.private boolean
iiop
Create stubs for IIOP.protected java.util.Set
includes
A list of inclusions when searching for classes to compile.private boolean
keep
Do not delete intermediate generated source files.private boolean
noLocalStubs
Do not create stubs optimized for same process.private boolean
noValueMethods
Do not generate methods for valuetypes.private boolean
nowarn
Turn off rmic warnings.private boolean
poa
Enable poa generation.protected org.apache.maven.project.MavenProject
project
The maven project.private java.util.List
sources
AList
ofSource
configurations to compile.private int
staleMillis
Time in milliseconds between automatic recompilations.private static java.lang.String
STUB_CLASS_PATTERN
private boolean
verbose
Enable verbose output.private java.lang.String
version
The version of the rmi protocol to which the stubs should be compiled.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractRmiMojo()
Creates the abstract class using a production implementation of the dependencies.(package private)
AbstractRmiMojo(AbstractRmiMojo.DependenciesFacade dependencies)
Creates the abstract class using the specified implementation of the dependencies.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner
createScanner(java.util.Set includes, java.util.Set excludes)
private void
doExecute(Source source)
void
execute()
Main mojo execution.private static java.lang.String
fileToClassName(java.lang.String classFileName)
protected java.util.List
generateUrlCompileClasspath()
Returns a list of URL objects that represent the classpath elements.abstract java.io.File
getClassesDirectory()
Get the directory where Remote impl classes are located.private java.lang.String
getClassName(java.io.File remoteClassFile)
java.lang.String
getCompilerId()
private java.util.Set
getExcludes(Source source)
abstract java.io.File
getOutputDirectory()
Get the directory where rmic generated class files are written.abstract java.util.List
getProjectClasspathElements()
Get the list of elements to add to the classpath of rmicjava.util.List
getRemoteClasses(Source source)
Search the input directory for classes to compile.java.util.List
getRmicClasspathElements()
Get the list of elements to add to the classpath of rmic(package private) java.util.List
getSources()
Get the list of sub-configurations.java.lang.String
getVersion()
boolean
isIdl()
boolean
isIiop()
boolean
isKeep()
Keep intermediate filesboolean
isNoLocalStubs()
Do not create stubs optimized for same process.boolean
isNoValueMethods()
Do not create methods for valuetypes.boolean
isNowarn()
Turn off warningsboolean
isPoa()
private boolean
isRemoteRmiClass(java.lang.Class remoteClass)
boolean
isVerbose()
Output messages about compilation
-
-
-
Field Detail
-
STUB_CLASS_PATTERN
private static final java.lang.String STUB_CLASS_PATTERN
- See Also:
- Constant Field Values
-
sources
private java.util.List sources
AList
ofSource
configurations to compile.
-
includes
protected java.util.Set includes
A list of inclusions when searching for classes to compile.
-
excludes
protected java.util.Set excludes
A list of exclusions when searching for classes to compile.
-
compilerId
protected java.lang.String compilerId
The id of the rmi compiler to use.
-
version
private java.lang.String version
The version of the rmi protocol to which the stubs should be compiled. Valid values include 1.1, 1.2, compat. See the rmic documentation for more information. If nothing is specified the underlying rmi compiler will choose the default value. For example, in sun jdk 1.5 the default is 1.2.
-
iiop
private boolean iiop
Create stubs for IIOP.
-
noLocalStubs
private boolean noLocalStubs
Do not create stubs optimized for same process.
-
idl
private boolean idl
Create IDL.
-
noValueMethods
private boolean noValueMethods
Do not generate methods for valuetypes.
-
keep
private boolean keep
Do not delete intermediate generated source files.
-
nowarn
private boolean nowarn
Turn off rmic warnings.
-
poa
private boolean poa
Enable poa generation.
-
verbose
private boolean verbose
Enable verbose output.
-
staleMillis
private int staleMillis
Time in milliseconds between automatic recompilations. A value of 0 means that up to date rmic output classes will not be recompiled until the source classes change.
-
project
protected org.apache.maven.project.MavenProject project
The maven project.
-
dependencies
private AbstractRmiMojo.DependenciesFacade dependencies
The interface between ths class and the rest of the world - unit tests replace the default implementation.
-
DEPENDENCIES_FACADE
private static final AbstractRmiMojo.DependenciesFacade DEPENDENCIES_FACADE
The default implementation of the dependencies.
-
-
Constructor Detail
-
AbstractRmiMojo
protected AbstractRmiMojo()
Creates the abstract class using a production implementation of the dependencies.
-
AbstractRmiMojo
AbstractRmiMojo(AbstractRmiMojo.DependenciesFacade dependencies)
Creates the abstract class using the specified implementation of the dependencies.- Parameters:
dependencies
- the implementation of the dependencies to use.
-
-
Method Detail
-
getSources
java.util.List getSources()
Get the list of sub-configurations.
-
getProjectClasspathElements
public abstract java.util.List getProjectClasspathElements()
Get the list of elements to add to the classpath of rmic- Returns:
- list of classpath elements
-
getOutputDirectory
public abstract java.io.File getOutputDirectory()
Get the directory where rmic generated class files are written.- Returns:
- the directory
-
getClassesDirectory
public abstract java.io.File getClassesDirectory()
Get the directory where Remote impl classes are located.- Returns:
- path to compiled classes
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException
Main mojo execution.- Specified by:
execute
in interfaceorg.apache.maven.plugin.Mojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
- if there is a problem executing the mojo.
-
doExecute
private void doExecute(Source source) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getRmicClasspathElements
public java.util.List getRmicClasspathElements()
Get the list of elements to add to the classpath of rmic- Returns:
- list of classpath elements
-
getRemoteClasses
public java.util.List getRemoteClasses(Source source)
Search the input directory for classes to compile.- Parameters:
source
-- Returns:
- a list of class names to rmic
-
createScanner
private org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner createScanner(java.util.Set includes, java.util.Set excludes)
-
getClassName
private java.lang.String getClassName(java.io.File remoteClassFile)
-
getExcludes
private java.util.Set getExcludes(Source source)
-
fileToClassName
private static java.lang.String fileToClassName(java.lang.String classFileName)
-
isRemoteRmiClass
private boolean isRemoteRmiClass(java.lang.Class remoteClass)
-
generateUrlCompileClasspath
protected java.util.List generateUrlCompileClasspath() throws org.apache.maven.plugin.MojoExecutionException
Returns a list of URL objects that represent the classpath elements. This is useful for using a URLClassLoader- Returns:
- list of url classpath elements
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getCompilerId
public java.lang.String getCompilerId()
-
isIiop
public boolean isIiop()
- Specified by:
isIiop
in interfaceRmicConfig
- Returns:
- Whether iiop stubs should be generated
-
isPoa
public boolean isPoa()
- Specified by:
isPoa
in interfaceRmicConfig
- Returns:
- Whether skeletons should be poa-compatible should be generated
-
isIdl
public boolean isIdl()
- Specified by:
isIdl
in interfaceRmicConfig
- Returns:
- Create IDL
-
isKeep
public boolean isKeep()
Description copied from interface:RmicConfig
Keep intermediate files- Specified by:
isKeep
in interfaceRmicConfig
- Returns:
- true or false
-
getVersion
public java.lang.String getVersion()
- Specified by:
getVersion
in interfaceRmicConfig
- Returns:
- The version of the compiler to use
-
isNowarn
public boolean isNowarn()
Description copied from interface:RmicConfig
Turn off warnings- Specified by:
isNowarn
in interfaceRmicConfig
- Returns:
- true or false
-
isVerbose
public boolean isVerbose()
Description copied from interface:RmicConfig
Output messages about compilation- Specified by:
isVerbose
in interfaceRmicConfig
- Returns:
- true or false
-
isNoLocalStubs
public boolean isNoLocalStubs()
Description copied from interface:RmicConfig
Do not create stubs optimized for same process.- Specified by:
isNoLocalStubs
in interfaceRmicConfig
- Returns:
- true or false
-
isNoValueMethods
public boolean isNoValueMethods()
Description copied from interface:RmicConfig
Do not create methods for valuetypes.- Specified by:
isNoValueMethods
in interfaceRmicConfig
- Returns:
- true or false
-
-