/** * @deprecated as of 1.416 * Use {@link #create(Jenkins, Class)} */ @Deprecated public static <T> ExtensionList<T> create(Hudson hudson, Class<T> type) { return create((Jenkins)hudson,type); }
/** * Returns {@link ExtensionList} that retains the discovered instances for the given extension type. * * @param extensionType * The base type that represents the extension point. Normally {@link ExtensionPoint} subtype * but that's not a hard requirement. * @return * Can be an empty list but never null. * @see ExtensionList#lookup */ @SuppressWarnings({"unchecked"}) public <T> ExtensionList<T> getExtensionList(Class<T> extensionType) { ExtensionList<T> extensionList = extensionLists.get(extensionType); return extensionList != null ? extensionList : extensionLists.computeIfAbsent(extensionType, key -> ExtensionList.create(this, key)); }
/** * Gets the extension list for a given type. * Normally calls {@link Jenkins#getExtensionList(Class)} but falls back to an empty list * in case {@link Jenkins#getInstanceOrNull()} is null. * Thus it is useful to call from {@code all()} methods which need to behave gracefully during startup or shutdown. * @param type the extension point type * @return some list * @since 1.572 */ public static @Nonnull <T> ExtensionList<T> lookup(Class<T> type) { Jenkins j = Jenkins.getInstanceOrNull(); return j == null ? create((Jenkins) null, type) : j.getExtensionList(type); }
public ExtensionList compute(Class key) { return ExtensionList.create(Hudson.this, key); } };
public ExtensionList compute(Class key) { return ExtensionList.create(Hudson.this, key); } };
public ExtensionList compute(Class key) { return ExtensionList.create(Hudson.this, key); } };
public ExtensionList compute(Class key) { return ExtensionList.create(Hudson.this, key); } };
public ExtensionList compute(Class key) { return ExtensionList.create(Jenkins.this,key); } };
/** * @deprecated as of 1.416 * Use {@link #create(Jenkins, Class)} */ @Deprecated public static <T> ExtensionList<T> create(Hudson hudson, Class<T> type) { return create((Jenkins)hudson,type); }
/** * Gets the extension list for a given type. * Normally calls {@link Jenkins#getExtensionList(Class)} but falls back to an empty list * in case {@link Jenkins#getInstanceOrNull()} is null. * Thus it is useful to call from {@code all()} methods which need to behave gracefully during startup or shutdown. * @param type the extension point type * @return some list * @since 1.572 */ public static @Nonnull <T> ExtensionList<T> lookup(Class<T> type) { Jenkins j = Jenkins.getInstanceOrNull(); return j == null ? create((Jenkins) null, type) : j.getExtensionList(type); }