157 */ |
157 */ |
158 public static TypeBasedGuardingDynamicLinker getLinkerForClass(Class<?> clazz) { |
158 public static TypeBasedGuardingDynamicLinker getLinkerForClass(Class<?> clazz) { |
159 return linkers.get(clazz); |
159 return linkers.get(clazz); |
160 } |
160 } |
161 |
161 |
|
162 /* |
|
163 * Returns true if the object is a Dynalink Java dynamic method. |
|
164 * |
|
165 * @param obj the object we want to test for being a dynamic method |
|
166 * @return true if it is a dynamic method, false otherwise. |
|
167 */ |
|
168 public static boolean isDynamicMethod(final Object obj) { |
|
169 return obj instanceof DynamicMethod; |
|
170 } |
|
171 |
162 @Override |
172 @Override |
163 public GuardedInvocation getGuardedInvocation(LinkRequest request, final LinkerServices linkerServices) |
173 public GuardedInvocation getGuardedInvocation(LinkRequest request, final LinkerServices linkerServices) |
164 throws Exception { |
174 throws Exception { |
165 final CallSiteDescriptor callSiteDescriptor = request.getCallSiteDescriptor(); |
175 final CallSiteDescriptor callSiteDescriptor = request.getCallSiteDescriptor(); |
166 final int l = callSiteDescriptor.getNameTokenCount(); |
176 final int l = callSiteDescriptor.getNameTokenCount(); |