org.codehaus.plexus.context.Context Java Examples

The following examples show how to use org.codehaus.plexus.context.Context. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Watchers.java    From wisdom with Apache License 2.0 5 votes vote down vote up
/**
 * Gets the list of watchers from the given Plexus context.
 *
 * @param context the Plexus context
 * @return the list of watcher, empty if none. Modifying the resulting list, updates the stored list.
 */
static synchronized List<Watcher> get(Context context) {
    List<Watcher> watchers;
    if (context.contains(WATCHERS_KEY)) {
        try {
            watchers = (List<Watcher>) context.get(WATCHERS_KEY);
        } catch (ContextException e) {
            throw new IllegalStateException("Cannot extract the watcher from the context", e);
        }
    } else {
        watchers = new ArrayList<>();
        context.put(WATCHERS_KEY, watchers);
    }
    return watchers;
}
 
Example #2
Source File: GatewayAbstractMojo.java    From apigee-deploy-maven-plugin with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void contextualize(Context context) throws ContextException {
	container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
	if (container.hasComponent(SettingsDecrypter.class)) {
		try {
			settingsDecrypter = container.lookup(SettingsDecrypter.class);
		} catch (ComponentLookupException e) {
			getLog().warn("Failed to lookup build in maven component session decrypter.", e);
		}
	}
}
 
Example #3
Source File: AbstractDeployMojo.java    From opoopress with Apache License 2.0 4 votes vote down vote up
@Override
public void contextualize(Context context) throws ContextException {
    container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
}
 
Example #4
Source File: MdPageGeneratorMojo.java    From markdown-page-generator-plugin with MIT License 4 votes vote down vote up
public void contextualize(Context context) throws ContextException {
    plexusContainer = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
}
 
Example #5
Source File: InternalRunMojo.java    From wisdom with Apache License 2.0 4 votes vote down vote up
@Override
public void contextualize(Context context) throws ContextException {
    container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
}
 
Example #6
Source File: BuildMojo.java    From opoopress with Apache License 2.0 4 votes vote down vote up
@Override
public void contextualize(Context context) throws ContextException {
    container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}
 
Example #7
Source File: AbstractDockerMojo.java    From jkube with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void contextualize(Context context) throws ContextException {
    plexusContainer = ((PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY));
}
 
Example #8
Source File: AbstractDockerMojo.java    From docker-maven-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public void contextualize(Context context) throws ContextException {
    authConfigFactory = new AuthConfigFactory((PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY));
}
 
Example #9
Source File: DefaultJnlpDependencyRequestBuilder.java    From webstart with MIT License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void contextualize( final Context context )
        throws ContextException
{
    container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}
 
Example #10
Source File: AbstractAppAssemblerMojo.java    From appassembler with MIT License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void contextualize( Context context )
    throws ContextException
{
    container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}
 
Example #11
Source File: RemoteExistsMojo.java    From exists-maven-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public void contextualize(Context context) throws ContextException {
  container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
}
 
Example #12
Source File: TarsBuildMojo.java    From TarsJava with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void contextualize(Context context) throws ContextException {
    container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
}
 
Example #13
Source File: Pipelines.java    From wisdom with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a 'watching' pipeline.
 * @param context the Plexus context
 * @param baseDir the project's base directory
 * @param mojo the 'run' mojo
 * @param pomFileMonitoring flag enabling or disabling the pom file monitoring
 * @return the created pipeline
 */
public static Pipeline watchers(Context context, File baseDir, Mojo mojo, boolean pomFileMonitoring) {
    return new Pipeline(mojo, baseDir, Watchers.all(context), pomFileMonitoring);
}
 
Example #14
Source File: Watchers.java    From wisdom with Apache License 2.0 2 votes vote down vote up
/**
 * Registers a watcher.
 *
 * @param context the Plexus context
 * @param watcher the watcher to add
 */
public static synchronized void add(Context context, Watcher watcher) {
    get(context).add(watcher);
}
 
Example #15
Source File: AbstractVertxMojo.java    From vertx-maven-plugin with Apache License 2.0 2 votes vote down vote up
/**
 * Retrieves the Plexus container.
 *
 * @param context the context
 * @throws ContextException if the container cannot be retrieved.
 */
@Override
public void contextualize(Context context) throws ContextException {
    container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
}
 
Example #16
Source File: Watchers.java    From wisdom with Apache License 2.0 2 votes vote down vote up
/**
 * Gets a copy of the list of watchers from the given Plexus context.
 *
 * @param context the Plexus context
 * @return a copy of the watcher list, empty if none.
 */
public static synchronized List<Watcher> all(Context context) {
    return new ArrayList<>(get(context));
}
 
Example #17
Source File: AbstractVertxMojo.java    From vertx-maven-plugin with Apache License 2.0 2 votes vote down vote up
/**
 * Retrieves the Plexus container.
 *
 * @param context the context
 * @throws ContextException if the container cannot be retrieved.
 */
@Override
public void contextualize(Context context) throws ContextException {
    container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
}
 
Example #18
Source File: RunMojo.java    From wisdom with Apache License 2.0 2 votes vote down vote up
/**
 * Retrieves the Plexus container.
 * @param context the context
 * @throws ContextException if the container cannot be retrieved.
 */
@Override
public void contextualize(Context context) throws ContextException {
    container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
}