Class 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 $
    • 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
      A List of Source 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.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • 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 rmic
      java.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 files
      boolean isNoLocalStubs()
      Do not create stubs optimized for same process.
      boolean isNoValueMethods()
      Do not create methods for valuetypes.
      boolean isNowarn()
      Turn off warnings
      boolean isPoa()  
      private boolean isRemoteRmiClass​(java.lang.Class remoteClass)  
      boolean isVerbose()
      Output messages about compilation
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
        A List of Source 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.
    • 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 interface org.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 interface RmicConfig
        Returns:
        Whether iiop stubs should be generated
      • isPoa

        public boolean isPoa()
        Specified by:
        isPoa in interface RmicConfig
        Returns:
        Whether skeletons should be poa-compatible should be generated
      • isIdl

        public boolean isIdl()
        Specified by:
        isIdl in interface RmicConfig
        Returns:
        Create IDL
      • isKeep

        public boolean isKeep()
        Description copied from interface: RmicConfig
        Keep intermediate files
        Specified by:
        isKeep in interface RmicConfig
        Returns:
        true or false
      • getVersion

        public java.lang.String getVersion()
        Specified by:
        getVersion in interface RmicConfig
        Returns:
        The version of the compiler to use
      • isNowarn

        public boolean isNowarn()
        Description copied from interface: RmicConfig
        Turn off warnings
        Specified by:
        isNowarn in interface RmicConfig
        Returns:
        true or false
      • isVerbose

        public boolean isVerbose()
        Description copied from interface: RmicConfig
        Output messages about compilation
        Specified by:
        isVerbose in interface RmicConfig
        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 interface RmicConfig
        Returns:
        true or false
      • isNoValueMethods

        public boolean isNoValueMethods()
        Description copied from interface: RmicConfig
        Do not create methods for valuetypes.
        Specified by:
        isNoValueMethods in interface RmicConfig
        Returns:
        true or false