Annotation Type ComponentName

public @interface ComponentName

Used with the Inject annotation to specify the name of a component to inject. Note that you still need to annotate your method with Inject for this annotation to be of any use. You can also combine injections of named and singleton components, see example below.

Usage example:

       public class MyClass
          private Map blahMap;
          private Map anotherMap;
          private List someList;
          private TransactionManager tm;

& Inject public void setMyMap(&ComponentName("BlahMap") Map blahMap) { this.blahMap = blahMap; } & Inject public void injectMoreStuff(&ComponentName("AnotherMap") Map anotherMap, &ComponentName("SomeList") List someList, TransactionManager singletonTM) { this.anotherMap = anotherMap; this.someList = someList; = singletonTM; } }

Manik Surtani (
See Also:

Required Element Summary
 String value

Element Detail


public abstract String value

Copyright © 2008 JBoss, a division of Red Hat. All Rights Reserved.