|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<T>
hudson.ExtensionList<T>
T - Type of the extension point. This class holds instances of the subtypes of 'T'.public class ExtensionList<T>
Retains the known extension instances for the given type 'T'.
Extensions are loaded lazily on demand and automatically by using ExtensionFinder, but this
class also provides a mechanism to provide compatibility with the older DescriptorList-based
manual registration,
All ExtensionList instances should be owned by Jenkins, even though
extension points can be defined by anyone on any type. Use Jenkins.getExtensionList(Class)
and Jenkins.getDescriptorList(Class) to obtain the instances.
Jenkins.getExtensionList(Class),
Jenkins.getDescriptorList(Class)| Field Summary | |
|---|---|
Class<T> |
extensionType
|
Hudson |
hudson
Deprecated. as of 1.417 Use jenkins |
Jenkins |
jenkins
|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
protected |
ExtensionList(Hudson hudson,
Class<T> extensionType)
Deprecated. as of 1.416 Use ExtensionList(Jenkins, Class) |
protected |
ExtensionList(Hudson hudson,
Class<T> extensionType,
CopyOnWriteArrayList<ExtensionComponent<T>> legacyStore)
Deprecated. as of 1.416 Use ExtensionList(Jenkins, Class, CopyOnWriteArrayList) |
protected |
ExtensionList(Jenkins jenkins,
Class<T> extensionType)
|
protected |
ExtensionList(Jenkins jenkins,
Class<T> extensionType,
CopyOnWriteArrayList<ExtensionComponent<T>> legacyStore)
|
| Method Summary | ||
|---|---|---|
void |
add(int index,
T element)
|
|
boolean |
add(T t)
Deprecated. since 2009-02-23. Prefer automatic registration. |
|
static void |
clearLegacyInstances()
Exposed for the test harness to clear all legacy extension instances. |
|
static
|
create(Hudson hudson,
Class<T> type)
Deprecated. as of 1.416 Use create(Jenkins, Class) |
|
static
|
create(Jenkins jenkins,
Class<T> type)
|
|
|
get(Class<U> type)
Looks for the extension instance of the given type (subclasses excluded), or return null. |
|
T |
get(int index)
|
|
List<ExtensionComponent<T>> |
getComponents()
Gets the same thing as the 'this' list represents, except as ExtensionComponents. |
|
T |
getDynamic(String className)
Used to bind extension to URLs by their class names. |
|
protected Object |
getLoadLock()
Chooses the object that locks the loading of the extension instances. |
|
Iterator<T> |
iterator()
|
|
protected List<ExtensionComponent<T>> |
load()
Loads all the extensions. |
|
protected Collection<ExtensionComponent<T>> |
load(ExtensionComponentSet delta)
Picks up extensions that we care from the given list. |
|
void |
refresh(ExtensionComponentSet delta)
Used during Jenkins.refreshExtensions() to add new components into existing ExtensionLists. |
|
T |
remove(int index)
|
|
boolean |
remove(Object o)
|
|
List<T> |
reverseView()
Gets the read-only view of this ExtensionList where components are reversed. |
|
int |
size()
|
|
protected List<ExtensionComponent<T>> |
sort(List<ExtensionComponent<T>> r)
If the ExtensionList implementation requires sorting extensions,
override this method to do so. |
|
| Methods inherited from class java.util.AbstractList |
|---|
addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, removeRange, set, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
addAll, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray |
| Field Detail |
|---|
public final Hudson hudson
jenkinspublic final Jenkins jenkins
public final Class<T> extensionType
| Constructor Detail |
|---|
protected ExtensionList(Hudson hudson,
Class<T> extensionType)
ExtensionList(Jenkins, Class)
protected ExtensionList(Jenkins jenkins,
Class<T> extensionType)
protected ExtensionList(Hudson hudson,
Class<T> extensionType,
CopyOnWriteArrayList<ExtensionComponent<T>> legacyStore)
ExtensionList(Jenkins, Class, CopyOnWriteArrayList)
protected ExtensionList(Jenkins jenkins,
Class<T> extensionType,
CopyOnWriteArrayList<ExtensionComponent<T>> legacyStore)
legacyStore - Place to store manually registered instances. The version of the constructor that
omits this uses a new Vector, making the storage lifespan tied to the life of ExtensionList.
If the manually registered instances are scoped to VM level, the caller should pass in a static list.| Method Detail |
|---|
public <U extends T> U get(Class<U> type)
public Iterator<T> iterator()
iterator in interface Iterable<T>iterator in interface Collection<T>iterator in interface List<T>iterator in class AbstractList<T>public List<ExtensionComponent<T>> getComponents()
ExtensionComponents.
public T get(int index)
get in interface List<T>get in class AbstractList<T>public int size()
size in interface Collection<T>size in interface List<T>size in class AbstractCollection<T>public List<T> reverseView()
ExtensionList where components are reversed.
public boolean remove(Object o)
remove in interface Collection<T>remove in interface List<T>remove in class AbstractCollection<T>public final T remove(int index)
remove in interface List<T>remove in class AbstractList<T>public boolean add(T t)
add in interface Collection<T>add in interface List<T>add in class AbstractList<T>
public void add(int index,
T element)
add in interface List<T>add in class AbstractList<T>public T getDynamic(String className)
protected Object getLoadLock()
public void refresh(ExtensionComponentSet delta)
Jenkins.refreshExtensions() to add new components into existing ExtensionLists.
Do not call from anywhere else.
protected List<ExtensionComponent<T>> load()
protected Collection<ExtensionComponent<T>> load(ExtensionComponentSet delta)
protected List<ExtensionComponent<T>> sort(List<ExtensionComponent<T>> r)
ExtensionList implementation requires sorting extensions,
override this method to do so.
The implementation should copy a list, do a sort, and return the new instance.
public static <T> ExtensionList<T> create(Hudson hudson,
Class<T> type)
create(Jenkins, Class)
public static <T> ExtensionList<T> create(Jenkins jenkins,
Class<T> type)
public static void clearLegacyInstances()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||