use of org.zaproxy.zap.network.HttpSenderListener in project zaproxy by zaproxy.
the class ExtensionLoader method unhook.
private void unhook(Extension extension) {
ExtensionHook hook = extensionHooks.remove(extension);
if (hook == null) {
logger.error("ExtensionHook not found for: " + extension.getClass().getCanonicalName());
return;
}
unloadOptions(hook);
unhookProxies(hook);
removeSiteMapListener(hook);
for (ContextDataFactory contextDataFactory : hook.getContextDataFactories()) {
try {
model.removeContextDataFactory(contextDataFactory);
} catch (Exception e) {
logger.error("Error while removing a ContextDataFactory from " + extension.getClass().getCanonicalName(), e);
}
}
for (ApiImplementor apiImplementor : hook.getApiImplementors()) {
try {
API.getInstance().removeApiImplementor(apiImplementor);
} catch (Exception e) {
logger.error("Error while removing an ApiImplementor from " + extension.getClass().getCanonicalName(), e);
}
}
for (HttpSenderListener httpSenderListener : hook.getHttpSenderListeners()) {
try {
HttpSender.removeListener(httpSenderListener);
} catch (Exception e) {
logger.error("Error while removing an HttpSenderListener from " + extension.getClass().getCanonicalName(), e);
}
}
for (Class<? extends Variant> variant : hook.getVariants()) {
try {
model.getVariantFactory().removeVariant(variant);
} catch (Exception e) {
logger.error("Error while removing a Variant from " + extension.getClass().getCanonicalName(), e);
}
}
removeViewInEDT(extension, hook);
}
Aggregations