public void call(final Object hook, ServiceRegistration<?> hookRegistration) throws Exception { if (error != null) return; // do not call any other hooks once an error has occurred. if (hook instanceof WeavingHook) { if (skipRegistration(hookRegistration)) { // Note we double check blacklist here just // in case another thread blacklisted since the first check return; } if ((hookFlags & FLAG_HOOKCALLED) == 0) { hookFlags |= FLAG_HOOKCALLED; // only do this check on the first weaving hook call if (!validBytes(validBytes)) { validBytes = StorageUtil.getBytes(entry.getInputStream(), (int) entry.getSize(), 8 * 1024); } } try { ((WeavingHook) hook).weave(this); } catch (WeavingException e) { error = e; errorHook = hookRegistration; // do not blacklist on weaving exceptions } catch (Throwable t) { error = t; // save the error to fail later errorHook = hookRegistration; // put the registration on the black list blackList.put(hookRegistration, Boolean.TRUE); } } }
public void call(final Object hook, ServiceRegistration<?> hookRegistration) throws Exception { if (error != null) return; // do not call any other hooks once an error has occurred. if (hook instanceof WeavingHook) { if (skipRegistration(hookRegistration)) { // Note we double check blacklist here just // in case another thread blacklisted since the first check return; } if ((hookFlags & FLAG_HOOKCALLED) == 0) { hookFlags |= FLAG_HOOKCALLED; // only do this check on the first weaving hook call if (!validBytes(validBytes)) { validBytes = StorageUtil.getBytes(entry.getInputStream(), (int) entry.getSize(), 8 * 1024); } } try { ((WeavingHook) hook).weave(this); } catch (WeavingException e) { error = e; errorHook = hookRegistration; // do not blacklist on weaving exceptions } catch (Throwable t) { error = t; // save the error to fail later errorHook = hookRegistration; // put the registration on the black list blackList.put(hookRegistration, Boolean.TRUE); } } }