Module jdk.dynalink
Package jdk.dynalink.linker.support
Class CompositeTypeBasedGuardingDynamicLinker
- java.lang.Object
- 
- jdk.dynalink.linker.support.CompositeTypeBasedGuardingDynamicLinker
 
- 
- All Implemented Interfaces:
- GuardingDynamicLinker,- TypeBasedGuardingDynamicLinker
 
 public class CompositeTypeBasedGuardingDynamicLinker extends Object implements TypeBasedGuardingDynamicLinker A composite type-based guarding dynamic linker. When a receiver of a not yet seen class is encountered, all linkers are queried sequentially on theirTypeBasedGuardingDynamicLinker.canLinkType(Class)method. The linkers returning true are then bound to the class, and next time a receiver of same type is encountered, the linking is delegated to those linkers only, speeding up dispatch.
- 
- 
Constructor SummaryConstructors Constructor Description CompositeTypeBasedGuardingDynamicLinker(Iterable<? extends TypeBasedGuardingDynamicLinker> linkers)Creates a new composite type-based linker.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanLinkType(Class<?> type)Returns true if at least one of the composite linkers returns true fromTypeBasedGuardingDynamicLinker.canLinkType(Class)for the type.static List<GuardingDynamicLinker>optimize(Iterable<? extends GuardingDynamicLinker> linkers)Optimizes a list of type-based linkers.- 
Methods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods declared in interface jdk.dynalink.linker.GuardingDynamicLinkergetGuardedInvocation
 
- 
 
- 
- 
- 
Constructor Detail- 
CompositeTypeBasedGuardingDynamicLinkerpublic CompositeTypeBasedGuardingDynamicLinker(Iterable<? extends TypeBasedGuardingDynamicLinker> linkers) Creates a new composite type-based linker.- Parameters:
- linkers- the component linkers
- Throws:
- NullPointerException- if- linkersor any of its elements are null.
 
 
- 
 - 
Method Detail- 
canLinkTypepublic boolean canLinkType(Class<?> type) Returns true if at least one of the composite linkers returns true fromTypeBasedGuardingDynamicLinker.canLinkType(Class)for the type.- Specified by:
- canLinkTypein interface- TypeBasedGuardingDynamicLinker
- Parameters:
- type- the type to link
- Returns:
- true true if at least one of the composite linkers returns true
 from TypeBasedGuardingDynamicLinker.canLinkType(Class), false otherwise.
 
 - 
optimizepublic static List<GuardingDynamicLinker> optimize(Iterable<? extends GuardingDynamicLinker> linkers) Optimizes a list of type-based linkers. If a group of adjacent linkers in the list all implementTypeBasedGuardingDynamicLinker, they will be replaced with a single instance ofCompositeTypeBasedGuardingDynamicLinkerthat contains them.- Parameters:
- linkers- the list of linkers to optimize
- Returns:
- the optimized list
- Throws:
- NullPointerException- if- linkersor any of its elements are null.
 
 
- 
 
-