jenkins
Class ExtensionFilter
java.lang.Object
jenkins.ExtensionFilter
- All Implemented Interfaces:
- ExtensionPoint
public abstract class ExtensionFilter
- extends Object
- implements ExtensionPoint
Filters out ExtensionComponent
s discovered by ExtensionFinder
s,
as if they were never discovered.
This is useful for those who are deploying restricted/simplified version of Jenkins
by reducing the functionality.
Because of the way ExtensionFinder
works, even when an extension component
is rejected by a filter, its instance still gets created first.
- Since:
- 1.472
- Author:
- Kohsuke Kawaguchi
- See Also:
DescriptorVisibilityFilter
,
ExtensionComponentSet.filtered()
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExtensionFilter
public ExtensionFilter()
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 Descriptor
s 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.
- Returns:
- true to let the component into Jenkins. false to drop it and pretend
as if it didn't exist. When any one of
ExtensionFilter
s veto
a component, it gets dropped.
isAllowed
public static <T> boolean isAllowed(Class<T> type,
ExtensionComponent<T> component)
all
public static ExtensionList<ExtensionFilter> all()
- All registered
ExtensionFilter
instances.
Copyright © 2004-2013. All Rights Reserved.