Search in sources :

Example 1 with DatabaseUnsupportedException

use of org.parosproxy.paros.db.DatabaseUnsupportedException in project zaproxy by zaproxy.

the class ExtensionLoader method startLifeCycle.

/**
     * Initialize a specific Extension
     * @param ext the Extension that need to be initialized
     * @throws DatabaseUnsupportedException 
     * @throws DatabaseException 
     */
public void startLifeCycle(Extension ext) throws DatabaseException, DatabaseUnsupportedException {
    ext.init();
    ext.databaseOpen(model.getDb());
    ext.initModel(model);
    ext.initXML(model.getSession(), model.getOptionsParam());
    ext.initView(view);
    ExtensionHook extHook = new ExtensionHook(model, view);
    try {
        ext.hook(extHook);
        extensionHooks.put(ext, extHook);
        hookContextDataFactories(ext, extHook);
        hookApiImplementors(ext, extHook);
        if (view != null) {
            // no need to hook view if no GUI
            hookView(ext, view, extHook);
            hookMenu(view, extHook);
        }
        hookOptions(extHook);
        ext.optionsLoaded();
        ext.postInit();
    } catch (Exception e) {
        logger.error(e.getMessage(), e);
    }
    ext.start();
    Proxy proxy = Control.getSingleton().getProxy();
    hookProxyListeners(proxy, extHook.getProxyListenerList());
    hookPersistentConnectionListeners(proxy, extHook.getPersistentConnectionListener());
    hookConnectRequestProxyListeners(proxy, extHook.getConnectRequestProxyListeners());
    if (view != null) {
        hookSiteMapListeners(view.getSiteTreePanel(), extHook.getSiteMapListenerList());
    }
}
Also used : Proxy(org.parosproxy.paros.control.Proxy) DatabaseException(org.parosproxy.paros.db.DatabaseException) DatabaseUnsupportedException(org.parosproxy.paros.db.DatabaseUnsupportedException)

Aggregations

Proxy (org.parosproxy.paros.control.Proxy)1 DatabaseException (org.parosproxy.paros.db.DatabaseException)1 DatabaseUnsupportedException (org.parosproxy.paros.db.DatabaseUnsupportedException)1