org.codehaus.plexus.context.Context.put()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中org.codehaus.plexus.context.Context.put()方法的一些代码示例,展示了Context.put()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.put()方法的具体详情如下:
包路径:org.codehaus.plexus.context.Context
类名称:Context
方法名:put

Context.put介绍

[英]Adds the item to the containerContext.
[中]将项目添加到containerContext。

代码示例

代码示例来源:origin: org.apache.maven/maven-project

container.getContext().put("SystemProperties", null);
if ( activators != null )

代码示例来源:origin: org.codehaus.plexus/plexus-container-default

public void addContextValue( Object key, Object value )
{
  containerContext.put( key, value );
}

代码示例来源:origin: org.codehaus.plexus/plexus-spring

/**
 * {@inheritDoc}
 * @see org.codehaus.plexus.PlexusContainer#addContextValue(java.lang.Object, java.lang.Object)
 */
public void addContextValue( Object key, Object value )
{
  context.put( key, value );
}

代码示例来源:origin: org.codehaus.redback/plexus-spring

/**
 * {@inheritDoc}
 * @see org.codehaus.plexus.PlexusContainer#addContextValue(java.lang.Object, java.lang.Object)
 */
public void addContextValue( Object key, Object value )
{
  context.put( key, value );
}

代码示例来源:origin: org.codehaus.plexus/plexus-container-default

public void initializeCoreComponent( ContainerInitializationContext context )
    throws ContainerInitializationException
  {
    ComponentFactoryManager componentFactoryManager = context.getContainerConfiguration().getComponentFactoryManager();

    if ( componentFactoryManager instanceof Contextualizable )
    {
      //TODO: this is wrong here jvz.
      context.getContainer().getContext().put( PlexusConstants.PLEXUS_KEY, context.getContainer() );

      try
      {
        ( (Contextualizable) componentFactoryManager).contextualize( context.getContainer().getContext() );
      }
      catch ( ContextException e )
      {
        throw new ContainerInitializationException( "Error contextualization component factory manager.", e );
      }
    }

    context.getContainer().setComponentFactoryManager( componentFactoryManager );
  }
}

代码示例来源:origin: org.codehaus.plexus/plexus-container-default

containerContext.put( PlexusConstants.PLEXUS_KEY, this );

代码示例来源:origin: org.codehaus.mojo/build-context

public static Map getContextContainerMap( String containerKey, Context context, boolean create )
{
  Map containerMap = null;
  if ( context.contains( containerKey ) )
  {
    try
    {
      containerMap = (Map) context.get( containerKey );
    }
    catch ( ContextException e )
    {
      throw new IllegalStateException( "Failed to retrieve BuildAdvisor "
              + "serialization map from context, though the context claims it exists. Error: "
              + e.getMessage() );
    }
  }
  else if ( create )
  {
    containerMap = new HashMap();
    context.put( containerKey, containerMap );
  }
  return containerMap;
}

代码示例来源:origin: org.wisdom-framework/wisdom-maven-plugin

/**
 * 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;
}

代码示例来源:origin: org.eclipse.sisu/org.eclipse.sisu.plexus

private static Context getContextComponent( final ContainerConfiguration configuration )
{
  final Map<?, ?> contextData = configuration.getContext();
  final Context contextComponent = configuration.getContextComponent();
  if ( null == contextComponent )
  {
    return new DefaultContext( contextData );
  }
  if ( null != contextData )
  {
    for ( final Entry<?, ?> entry : contextData.entrySet() )
    {
      contextComponent.put( entry.getKey(), entry.getValue() );
    }
  }
  return contextComponent;
}

代码示例来源:origin: org.eclipse.sisu/org.eclipse.sisu.plexus

private final Map<Object, Object> context()
{
  final Context context = new DefaultContext();
  context.put( "basedir", getBasedir() );
  // Per-test context customization
  customizeContext( context );
  // Provide 'plexus.home' fall-back
  if ( !context.contains( PLEXUS_HOME ) )
  {
    context.put( PLEXUS_HOME, plexusHome() );
  }
  return context.getContextData();
}

代码示例来源:origin: org.codehaus.plexus/com.springsource.org.codehaus.plexus.container

public void execute( ContainerInitializationContext context )
    throws ContainerInitializationException
  {
    context.getContainer().getContext().put( PlexusConstants.PLEXUS_KEY, context.getContainer() );

    context.getContainer().getContext().put( PlexusConstants.PLEXUS_CORE_REALM, context.getContainer().getContainerRealm() );
  }
}

代码示例来源:origin: org.codehaus.plexus/plexus-contextualizer

this.plexusContainer.getContext().put( key, value );
this.plexusContainer.getContext().put( key, value );
this.plexusContainer.getContext().put( key, value );

代码示例来源:origin: org.codehaus.plexus/com.springsource.org.codehaus.plexus.container

public void initializeCoreComponent( ContainerInitializationContext context )
    throws ContainerInitializationException
  {
    ComponentFactoryManager componentFactoryManager = context.getContainerConfiguration().getComponentFactoryManager();

    if ( componentFactoryManager instanceof Contextualizable )
    {
      //TODO: this is wrong here jvz.
      context.getContainer().getContext().put( PlexusConstants.PLEXUS_KEY, context.getContainer() );

      try
      {
        ( (Contextualizable) componentFactoryManager).contextualize( context.getContainer().getContext() );
      }
      catch ( ContextException e )
      {
        throw new ContainerInitializationException( "Error contextualization component factory manager.", e );
      }
    }

    context.getContainer().setComponentFactoryManager( componentFactoryManager );
  }
}

代码示例来源:origin: org.eclipse.sisu/org.eclipse.sisu.plexus

context.put( PlexusConstants.PLEXUS_KEY, this );
variables = new ContextMapAdapter( context );

相关文章

微信公众号

最新文章

更多