Package jenkins

Class ExtensionFilter

    • Constructor Detail

      • ExtensionFilter

        public ExtensionFilter()
    • Method Detail

      • allows

        public abstract <T> boolean allows​(Class<T> type,
                                           ExtensionComponent<T> component)
        Checks if a newly discovered extension is allowed to participate into Jenkins.

        To filter Descriptors based on the Describable subtypes, do as follows:

         return !component.isDescriptorOf(Builder.class);
         
        Parameters:
        type - The type of the extension that we are discovering. This is not the actual instance type, but the contract type, such as Descriptor, AdministrativeMonitor, etc.
        component - the actual discovered Extension object.
        Returns:
        true to let the component into Jenkins. false to drop it and pretend as if it didn't exist. When any one of ExtensionFilters veto a component, it gets dropped.