Java Code Examples for org.codehaus.plexus.context.Context#get()

The following examples show how to use org.codehaus.plexus.context.Context#get() . 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: 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 2
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 3
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 4
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 5
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 6
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 7
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 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: 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 10
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 11
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 12
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 13
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 14
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 15
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);
}