Class ContextClassLoaderEnvironmentFacet

java.lang.Object
org.codehaus.mojo.jaxb2.shared.environment.AbstractLogAwareFacet
org.codehaus.mojo.jaxb2.shared.environment.classloading.ContextClassLoaderEnvironmentFacet
All Implemented Interfaces:
EnvironmentFacet

public class ContextClassLoaderEnvironmentFacet extends AbstractLogAwareFacet
Adapter converting a ThreadContextClassLoaderHolder to the standard lifecycle defined within the EnvironmentFacet.
Author:
Lennart Jörelid, jGuru Europe AB
  • Field Summary

    Fields inherited from class org.codehaus.mojo.jaxb2.shared.environment.AbstractLogAwareFacet

    log
  • Constructor Summary

    Constructors
    Constructor
    Description
    ContextClassLoaderEnvironmentFacet(org.apache.maven.plugin.logging.Log log, ThreadContextClassLoaderBuilder builder)
    Compound constructor creating a ContextClassLoaderEnvironmentFacet wrapping the supplied data.
  • Method Summary

    Modifier and Type
    Method
    Description
    Delegate method retrieving the classpath as argument from the underlying ThreadContextClassLoaderHolder.
    void
    Restores the original Environment, implying that the change performed in setup() method are restored to the state before the setup method was called.
    void
    Sets up this Environment, inferring temporary changes to environment variables or conditions.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ContextClassLoaderEnvironmentFacet

      public ContextClassLoaderEnvironmentFacet(org.apache.maven.plugin.logging.Log log, ThreadContextClassLoaderBuilder builder)
      Compound constructor creating a ContextClassLoaderEnvironmentFacet wrapping the supplied data.
      Parameters:
      log - The active Maven Log.
      builder - A fully set up ThreadContextClassLoaderBuilder, where the buildAndSet() method should not be invoked yet.
      See Also:
  • Method Details

    • getClassPathAsArgument

      public String getClassPathAsArgument()
      Delegate method retrieving the classpath as argument from the underlying ThreadContextClassLoaderHolder. Note that the setup method must be invoked before this one is.
      Returns:
      the ClassPath as an argument to external processes such as XJC.
    • setup

      public void setup()
      Sets up this Environment, inferring temporary changes to environment variables or conditions. The changes must be reversible, and should be restored to their original values in the restore() method.
    • restore

      public void restore()
      Restores the original Environment, implying that the change performed in setup() method are restored to the state before the setup method was called.