jetbrains.buildServer
Interface ExtensionsProvider

All Known Subinterfaces:
ExtensionHolder, SBuildServer, ServerExtensionHolder

public interface ExtensionsProvider

Main class that could be used to get extensions of given type. It's highly recommended to use it instead of ExtensionHolder

Since:
8.0
Author:
Eugene Petrenko (eugene.petrenko@jetbrains.com)

Nested Class Summary
static interface ExtensionsProvider.ExtensionAction<T extends TeamCityExtension>
           
 
Method Summary
<T extends TeamCityExtension>
void
foreachExtension(java.lang.Class<T> agentExtensionClass, ExtensionsProvider.ExtensionAction<T> action)
          Iterates over extensions of some class and executes some action on them.
<T extends TeamCityExtension>
T
getExtension(java.lang.Class<T> extensionClass, java.lang.String sourceId)
          Retrieves extension registered with specified type and id
<T extends TeamCityExtension>
java.util.Collection<T>
getExtensions(java.lang.Class<T> extensionClass)
          Get list of extensions for some extension point.
<T extends TeamCityExtension>
java.util.Collection<java.lang.String>
getExtensionSources(java.lang.Class<T> extensionClass)
          Returns identifiers of the extensions of specified type
 

Method Detail

getExtensions

@NotNull
<T extends TeamCityExtension> java.util.Collection<T> getExtensions(@NotNull
                                                                            java.lang.Class<T> extensionClass)
Get list of extensions for some extension point. TeamCity checks all registered Spring beans for extensions

Parameters:
extensionClass - class of the extension, which defines the extension point type
Returns:
list of extensions for specified extension point

foreachExtension

<T extends TeamCityExtension> void foreachExtension(@NotNull
                                                    java.lang.Class<T> agentExtensionClass,
                                                    @NotNull
                                                    ExtensionsProvider.ExtensionAction<T> action)
Iterates over extensions of some class and executes some action on them. Exceptions from ExtensionsProvider.ExtensionAction.action(T) are catched and logged

Parameters:
agentExtensionClass - extension class
action - action to execute

getExtensionSources

@NotNull
<T extends TeamCityExtension> java.util.Collection<java.lang.String> getExtensionSources(@NotNull
                                                                                                 java.lang.Class<T> extensionClass)
Returns identifiers of the extensions of specified type

Parameters:
extensionClass - type of the extension
Returns:
identifiers

getExtension

@Nullable
<T extends TeamCityExtension> T getExtension(@NotNull
                                                      java.lang.Class<T> extensionClass,
                                                      @NotNull
                                                      java.lang.String sourceId)
Retrieves extension registered with specified type and id

Parameters:
extensionClass - extension type
sourceId - id
Returns:
extension or null