Class StandardExecutionEnvironment

  • All Implemented Interfaces:
    java.lang.Comparable<StandardExecutionEnvironment>, ExecutionEnvironment

    public class StandardExecutionEnvironment
    extends java.lang.Object
    implements java.lang.Comparable<StandardExecutionEnvironment>, ExecutionEnvironment
    Represents a standard OSGi execution environment profile. See the list of known OSGi profiles in bundle org.eclipse.osgi, file profile.list. Standard execution environment capabilities can be referenced in MANIFEST.MF using the header "Bundle-RequiredExecutionEnvironment". In order to pick the minimal, required profile from the alternatives listed in a BREE header, instances of this class have a total ordering. TODO This class both represents an EE profile (i.e. the concrete EE implementation used by the compiler) and an EE capability (i.e. the capability required via the BREE). This should be separate classes. (An EE profile typically provides multiple EE capabilities.)
    • Field Detail

      • TARGET_ALIASES

        private static final java.util.Map<java.lang.String,​java.lang.String> TARGET_ALIASES
      • profileName

        private final java.lang.String profileName
      • compilerSourceLevel

        private final java.lang.String compilerSourceLevel
      • compilerTargetLevel

        private final java.lang.String compilerTargetLevel
      • eeVersion

        private final EEVersion eeVersion
      • profileProperties

        private final java.util.Properties profileProperties
      • toolchain

        private final org.apache.maven.toolchain.Toolchain toolchain
      • logger

        private org.codehaus.plexus.logging.Logger logger
    • Constructor Detail

      • StandardExecutionEnvironment

        @Deprecated
        StandardExecutionEnvironment​(@Nonnull
                                     java.util.Properties profileProperties)
        Deprecated.
        Do no instantiate. Use factory method instead ExecutionEnvironmentUtils#getExecutionEnvironment(String).
      • StandardExecutionEnvironment

        StandardExecutionEnvironment​(@Nonnull
                                     java.util.Properties profileProperties,
                                     @Nullable
                                     org.apache.maven.toolchain.Toolchain toolchain,
                                     @Nullable
                                     org.codehaus.plexus.logging.Logger logger)
    • Method Detail

      • readFromToolchains

        private java.util.Set<java.lang.String> readFromToolchains​(org.apache.maven.toolchain.Toolchain toolchain)
      • getSystemPackagesCompanionJar

        static java.io.File getSystemPackagesCompanionJar()
                                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • parseEEVersion

        private static EEVersion parseEEVersion​(java.lang.String systemCaps)
      • getCompilerSourceLevelDefault

        public java.lang.String getCompilerSourceLevelDefault()
        Description copied from interface: ExecutionEnvironment
        Returns a reasonable compiler source level default for this execution environment.
        Specified by:
        getCompilerSourceLevelDefault in interface ExecutionEnvironment
        Returns:
        a compiler source level matching the execution environment, or null if unknown.
      • getCompilerTargetLevelDefault

        public java.lang.String getCompilerTargetLevelDefault()
        Description copied from interface: ExecutionEnvironment
        Returns a reasonable compiler target level default for this execution environment.
        Specified by:
        getCompilerTargetLevelDefault in interface ExecutionEnvironment
        Returns:
        a compiler target level matching the execution environment, or null if unknown.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • isCompatibleCompilerTargetLevel

        public boolean isCompatibleCompilerTargetLevel​(java.lang.String target)
        Description copied from interface: ExecutionEnvironment
        Returns false if classes compiled with the given compiler target level can certainly not be executed on this execution environment. Used to detect inconsistent configuration.
        Specified by:
        isCompatibleCompilerTargetLevel in interface ExecutionEnvironment
      • toTargetVersion

        private static org.osgi.framework.Version toTargetVersion​(java.lang.String target)