Launch the ExtensionHandler that this ExtensionNamespaceSupport object defines.
340149
public ExtensionHandler launch()
    throws TransformerException
  {
    ExtensionHandler handler = null;
    try
    {
      Class cl = ExtensionHandler.getClassForName(m_handlerClass);
      Constructor con = null;
      //System.out.println("class " + cl + " " + m_args + " " + m_args.length + " " + m_sig);
      if (m_sig != null)
        con = cl.getConstructor(m_sig);
      else // Pick the constructor based on number of args.
      {
        Constructor[] cons = cl.getConstructors();
        for (int i = 0; i < cons.length; i ++)
        {
          if (cons[i].getParameterTypes().length == m_args.length)
          {
            con = cons[i];
            break;
          }
        }
      }
      // System.out.println("constructor " + con);
      if (con != null)
        handler = (ExtensionHandler)con.newInstance(m_args);
      else
        throw new TransformerException("ExtensionHandler constructor not found");
    }
    catch (Exception e)
    {
      throw new TransformerException(e);
    }
    return handler;
  }
1188404
public static void registerExtension (String extension, Class<? extends StreamDecoder> clazz)
    {
        _extensions.put(extension, clazz);
    }
421464
def build_extension(self, ext):
        
        if sys.platform == "win32":
            _clr_compiler = "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\csc.exe"
        else:
            _clr_compiler = "mcs"
        cmd = [ 
            _clr_compiler,
            "/target:library",
            "clrmagic.cs"
        ]
        check_call(" ".join(cmd), shell=True)
1070769
private ExtensionLoader locateExtensionLoader() {
        Collection<ExtensionLoader> loaders = Collections.emptyList();
        if (SecurityActions.getThreadContextClassLoader() != null) {
            loaders = serviceLoader.all(SecurityActions.getThreadContextClassLoader(), ExtensionLoader.class);
        }
        if (loaders.size() == 0) {
            loaders = serviceLoader.all(LoadableExtensionLoader.class.getClassLoader(), ExtensionLoader.class);
        }
        if (loaders.size() > 1) {
            throw new RuntimeException("Multiple ExtensionLoader's found on classpath: " + toString(loaders));
        }
        if (loaders.size() == 1) {
            return loaders.iterator().next();
        }
        return serviceLoader;
    }
743871
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);
        extensionHooks.put(ext, extHook);
        try {
            ext.hook(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);
            hookProxies(extHook);
            ext.optionsLoaded();
            ext.postInit();
        } catch (Exception e) {
            logExtensionInitError(ext, e);
        }
        
        ext.start();

        Proxy proxy = Control.getSingleton().getProxy();
        hookProxyListeners(proxy, extHook.getProxyListenerList());
        hookOverrideMessageProxyListeners(proxy, extHook.getOverrideMessageProxyListenerList());
        hookPersistentConnectionListeners(proxy, extHook.getPersistentConnectionListener());
        hookConnectRequestProxyListeners(proxy, extHook.getConnectRequestProxyListeners());

        if (view != null) {
            hookSiteMapListeners(view.getSiteTreePanel(), extHook.getSiteMapListenerList());
        }
    }
1336019
public void startup() throws Throwable
   {
      if (handlerClassName == null || handlerClassName.trim().equals(""))
         throw new IllegalStateException("HandlerClassName isn't defined");

      shutdown();

      ClassLoader cl = classLoader;

      if (cl == null)
         cl = EISServer.class.getClassLoader();

      Class handler = Class.forName(handlerClassName, true, cl);

      if (!Handler.class.isAssignableFrom(handler))
         throw new IllegalArgumentException("The specified handler class doesn't implement the interface");

      HandlerServer handlerServer = new HandlerServer(host, port, handler);
      handlerServer.start();

      handlerServers.put(getKey(), handlerServer);
   }
699680
def execute(self, args):
        """"""
        _run_atstart()
        hook_name = os.path.basename(args[0])
        if hook_name in self._hooks:
            try:
                self._hooks[hook_name]()
            except SystemExit as x:
                if x.code is None or x.code == 0:
                    _run_atexit()
                raise
            _run_atexit()
        else:
            raise UnregisteredHookError(hook_name)
1018042
function(payload, request, response, callback) {
    // Run response() hook on all extensions.
    self.application.invoke('response', payload, request, response, callback);
  }
847019
public static <T> ExtensionLoader<T> getExtensionLoader(Class<T> clazz, ExtensionLoaderListener<T> listener) {
        ExtensionLoader<T> loader = LOADER_MAP.get(clazz);
        if (loader == null) {
            synchronized (ExtensionLoaderFactory.class) {
                loader = LOADER_MAP.get(clazz);
                if (loader == null) {
                    loader = new ExtensionLoader<T>(clazz, listener);
                    LOADER_MAP.put(clazz, loader);
                }
            }
        }
        return loader;
    }
524046
private static void initPrefixHandlers()
    {
        PrefixHandlerConfig[] prefixHandlers = ConfigUtil.getConfig().getPrefixHandlers();
        if ( prefixHandlers == null )
        {
            return;
        }
        for ( int i = 0; i < prefixHandlers.length; i++ )
        {
            try
            {
                Class prefixClass = Class.forName( prefixHandlers[i].getHandlerClass() );
                String name = prefixHandlers[i].getName();
                if ( name == null || name.equals( "" ) )
                {
                    _log.warn( "The name for the prefix handler '" + prefixHandlers[i].getHandlerClass()
                            + "' must not be null" );
                    continue;
                }
                Object o = prefixClass.newInstance();
                if ( !( o instanceof RequestParameterHandler ) )
                {
                    _log.warn( "The class '" + prefixHandlers[i].getHandlerClass()
                            + "' must be an instance of RequestParameterHandler" );
                    continue;
                }
                ProcessPopulate.registerPrefixHandler( name, ( RequestParameterHandler ) o );
            }
            catch ( ClassNotFoundException e )
            {
                _log.warn( "Class '" + prefixHandlers[i].getHandlerClass() + "' not found", e );
            }
            catch ( IllegalAccessException e )
            {
                _log.warn( "Illegal access on Class '" + prefixHandlers[i].getHandlerClass() + "'", e );

            }
            catch ( InstantiationException e )
            {
                _log.warn( "InstantiationException on Class '" + prefixHandlers[i].getHandlerClass() + "'",
                        e.getCause() );
            }
        }
    }
529073
@Override
    public void start() {
        logger.info("[extensions] Loading the extensions");
        extensions = applicationContext.getBeansOfType(Extension.class).values();
        Collection<? extends ExtensionFeature> extensionFeatures = applicationContext.getBeansOfType(ExtensionFeature.class).values();
        logger.info("[extensions] Number of loaded extension features: {}", extensionFeatures.size());
        logger.info("[extensions] Number of loaded extensions: {}", extensions.size());
        logger.info("[extensions] Extension features:");
        for (ExtensionFeature feature : extensionFeatures) {
            logger.info("[extensions] * {} [{}]", feature.getName(), feature.getId());
        }
        // Detects cycles
        getExtensionList();
    }
703559
def _AddHasExtensionMethod(cls):
  """"""
  def HasExtension(self, extension_handle):
    _VerifyExtensionHandle(self, extension_handle)
    if extension_handle.label == _FieldDescriptor.LABEL_REPEATED:
      raise KeyError('"%s" is repeated.' % extension_handle.full_name)

    if extension_handle.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      value = self._fields.get(extension_handle)
      return value is not None and value._is_present_in_parent
    else:
      return extension_handle in self._fields
  cls.HasExtension = HasExtension
14690
function listenHandler( event ) {
				var handler = rawHandler.apply( this, arguments );
				if ( handler === false) {
					event.stopPropagation();
					event.preventDefault();
				}
				return( handler );
		}
495474
def register_handler(self, handler):
        
        self._handlers[handler.namespace] = handler

        handler.registered(self)
624397
@SuppressWarnings("unused")
    public Callable<?> handle(Object methodDescStr, Method origin, Object[] arguments) throws
            Throwable {
        MethodDesc methodDesc = new MethodDesc((String) methodDescStr);
        Class clazz = getClassMethodWasCalledOn(methodDesc);

        Object marker = classToMarker.get(clazz);
        InvocationHandlerAdapter interceptor = markersToHandler.get(marker);
        if (interceptor == null) {
            return null;
        }

        // extended.StaticCapableStubber#whenInt
        BiConsumer<Class<?>, Method> onStub = onMethodCallDuringStubbing.get();
        if (onStub != null) {
            onStub.accept(clazz, origin);
        }

        // extended.ExtendedMockito#verifyInt
        BiConsumer<Class<?>, Method> onVerify = onMethodCallDuringVerification.get();
        if (onVerify != null) {
            onVerify.accept(clazz, origin);
        }

        return new ReturnValueWrapper(interceptor.interceptEntryHook(marker, origin, arguments,
                new SuperMethodCall(selfCallInfo, origin, marker, arguments)));
    }
101004
public function run(OperationHandlerContract $handler, ExtensionContract $extension, array $flags = []) {
        try {
            $name = $extension->getPackage()->getName();

            if($this->componentsRepository->isRequired($name)) {
                throw new ExtensionException('The package [' . $name . '] cannot be uninstalled due is required for whole system.');
            }

            $handler->operationInfo(new Operation('Uninstalling the [' . $name . '] extension.'));

            //$this->dispatcher->fire(new Uninstalling($extension));
            $this->dispatcher->fire(new ComponentUninstalling($extension));
            $this->migrateManager->uninstall($name);
            $this->assetManager->delete(str_replace('/', '_', $name));

            $this->extensionsRepository->save($extension, [
                'status'    => ExtensionContract::STATUS_AVAILABLE,
                'options'   => [],
            ]);

            if(in_array('purge', $flags, true)) {
                $command = 'composer remove ' . $name;

                $process = $this->composerHandler->run($command, function(Process $process, $type, $buffer) use($handler) {
                    if(Str::contains($buffer, 'Error Output')) {
                        throw new ExtensionException($process->getErrorOutput());
                    }

                    $handler->operationInfo(new Operation($buffer));
                });

                if( ! $process->isSuccessful() ) {
                    throw new ExtensionException($process->getErrorOutput());
                }
            }

            //$this->dispatcher->fire(new Uninstalled($extension));
            $this->dispatcher->fire(new ComponentUninstalled($extension));

            $operation = new Operation('The package [' . $name . '] has been successfully uninstalled.');

            return $handler->operationSuccess($operation);
        }
        catch(\Exception $e) {
            Log::error($e);
            $this->dispatcher->fire(new ComponentInstallationFailed($extension, $e));

            return $handler->operationFailed(new Operation($e->getMessage()));
        }
    }
35325
public String setExtensionHandlerClass(String handlerClassName) {
        String oldvalue = m_extensionHandlerClass;
        m_extensionHandlerClass = handlerClassName;
        return oldvalue;
    }