public class CompositeTypeBasedGuardingDynamicLinker extends Object implements TypeBasedGuardingDynamicLinker, Serializable
TypeBasedGuardingDynamicLinker.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 and Description |
|---|
CompositeTypeBasedGuardingDynamicLinker(Iterable<? extends TypeBasedGuardingDynamicLinker> linkers)
Creates a new composite type-based linker.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canLinkType(Class<?> type)
Returns true if the linker can link an invocation where the first argument (receiver) is of the specified type.
|
GuardedInvocation |
getGuardedInvocation(LinkRequest linkRequest,
LinkerServices linkerServices)
Creates a guarded invocation appropriate for a particular invocation with the specified arguments at a call site.
|
static List<GuardingDynamicLinker> |
optimize(Iterable<? extends GuardingDynamicLinker> linkers)
Optimizes a list of type-based linkers.
|
public CompositeTypeBasedGuardingDynamicLinker(Iterable<? extends TypeBasedGuardingDynamicLinker> linkers)
linkers - the component linkerspublic boolean canLinkType(Class<?> type)
TypeBasedGuardingDynamicLinkercanLinkType in interface TypeBasedGuardingDynamicLinkertype - the type to linkpublic GuardedInvocation getGuardedInvocation(LinkRequest linkRequest, LinkerServices linkerServices) throws Exception
GuardingDynamicLinkergetGuardedInvocation in interface GuardingDynamicLinkerlinkRequest - the object describing the request for linking a particular invocationlinkerServices - linker servicesLinkRequest.withoutRuntimeContext() and link for that.Exception - if the operation fails for whatever reasonpublic static List<GuardingDynamicLinker> optimize(Iterable<? extends GuardingDynamicLinker> linkers)
TypeBasedGuardingDynamicLinker, they will be replaced with a single instance of
CompositeTypeBasedGuardingDynamicLinker that contains them.linkers - the list of linkers to optimizeCopyright © 2013 Attila Szegedi. All Rights Reserved.