register a property handler
485364
def register_prop(name, handler_get, handler_set):
    
    global props_get, props_set
    if handler_get:
        props_get[name] = handler_get
    if handler_set:
        props_set[name] = handler_set
1005717
def register_actionhandler(self, action_handler: type) -> None:
        
        for k in action_handler.__dict__:
            if k.startswith('_'):
                continue
            app = action_handler_adapter(action_handler, k)
            self.register_app(k, app)
1057830
def RegisterMessageHandler(self, handler, lease_time, limit=1000):
    """"""
    self.UnregisterMessageHandler()

    self.handler_stop = False
    self.handler_thread = threading.Thread(
        name="message_handler",
        target=self._MessageHandlerLoop,
        args=(handler, lease_time, limit))
    self.handler_thread.daemon = True
    self.handler_thread.start()
342419
public void setHandling( PomProperty<?> property, ElementHandling handling )
    {

        this.name2handlingMap.put( property.getName(), handling );
    }
412847
function (property) {
            var bindings = this._cfg.bind, bind = bindings[property];

            if (bindings && bind && bindings.hasOwnProperty(property) && property === "items") {
                var callback = {
                    fn : this._notifyDataChange,
                    scope : this,
                    args : property
                };
                try {
                    ariaUtilsJson.addListener(bind.inside, bind.to, callback, true, true);
                    this._bindingListeners[property] = {
                        inside : bind.inside,
                        to : bind.to,
                        transform : bind.transform,
                        cb : callback
                    };

                    var newValue = this._transform(bind.transform, bind.inside[bind.to], "toWidget");
                    this._cfg[property] = newValue;
                } catch (ex) {
                    this.$logError(this.INVALID_BEAN, [property, "bind"]);
                }
            } else {
                this.$TemplateBasedWidget._registerSingleProperty.apply(this, arguments);
            }
        }
570161
protected function registerHandlers() {
		set_exception_handler(function($exception) {
			$this->pushException($exception);
			
			echo $this->renderDebugBar();
		});
		
		register_shutdown_function(function() {
			if ($this->onShutdownCallback !== null) {
				$this->onShutdownCallback->__invoke($this);
			}
			
			// Debug bar rendering for the deferred mode
			if ($this->deferredMode) {
				// Garbage collection
				if ($this->profilesGcEnabled) {
					$this->gcCycle();
				}
				
				// Content creating
				$filePath = $this->deferredDir . DIRECTORY_SEPARATOR . 'profile_' . $this->token . '.html';
				if (file_put_contents($filePath, $this->renderDebugBar()) === false) {
					throw new InvalidPath('Unable to write the debug data into: "' . $filePath . '"');
				}
			}
		});
	}
651238
public final <T> void registerType(Class<T> runtimeClass, TypeHandler<T> handler) {
        if (started) {
            // Can't add any more metrics anyway; harmless
            return;
        }
        typeHandlers.put(runtimeClass, handler);
    }
16060
def register_stats_handler(app, server_name, prefix='/status/'):
    """"""
    if not prefix.endswith('/'):
        prefix += '/'
    handler = functools.partial(bottlestats, server_name)

    app.get(prefix, callback=handler)
    app.get(prefix + '<path:path>', callback=handler)
1261471
def bind(cls, app, *paths, methods=None, name=None, view=None):
        """"""
        # Register self in admin
        if view is None:
            app.ps.admin.register(cls)
            if not paths:
                paths = ('%s/%s' % (app.ps.admin.cfg.prefix, name or cls.name),)
            cls.url = paths[0]
        return super(AdminHandler, cls).bind(app, *paths, methods=methods, name=name, view=view)
947829
public void registerHandler(HttpServiceBindingDescriptor serviceBindingDescriptor) {
        for (ProtocolBinding protocolBinding : protocolBindingRegistry.getProtocolBindings()) {
            if (protocolBinding.getProtocol() == serviceBindingDescriptor.getServiceProtocol()) {
                String contextPath = protocolBinding.getContextRoot() + serviceBindingDescriptor.getServiceContextPath();

                JettyHandlerSpecification handlerSpec = handlerSpecificationMap.get(contextPath);
                if (handlerSpec == null) {
                    handlerSpec = new JettyHandlerSpecification(protocolBinding.getContextRoot(),
                            protocolBinding.getProtocol(), serviceBindingDescriptor.getServiceContextPath());
                    handlerSpecificationMap.put(contextPath, handlerSpec);
                }
                if (protocolBinding.getIdentityTokenResolver() != null) {
                    handlerSpec.addServiceVersionToTokenResolverEntry(serviceBindingDescriptor.getServiceVersion(), protocolBinding.getIdentityTokenResolver());
                }
            }
        }
        commandProcessorFactory.getCommandProcessor(serviceBindingDescriptor.getServiceProtocol()).bind(serviceBindingDescriptor);
    }
973519
def register(cls):
        
        if not cls.IS_LOADED:
            cls.IS_LOADED = True

            yaml.add_constructor('!param', Parameter.parameter_constructor, Loader=yaml.SafeLoader)
            yaml.add_constructor('!env', EnvironmentVariable.parameter_constructor, Loader=yaml.SafeLoader)
1219543
public static void register(IMalisisMod mod, Object messageHandler)
	{
		register(mod, messageHandler.getClass(), messageHandler);
	}
981695
function registerEventHandlers(windowBridge, app)
{
  "use strict";
  handleOutgoingEvent(windowBridge, app, WebAPIEvents.EVENT_WEBAPI_REQUEST_DESKPRO, WebAPIEvents.props.EVENT_WEBAPI_REQUEST_DESKPRO);
  handleOutgoingEvent(windowBridge, app, WebAPIEvents.EVENT_WEBAPI_REQUEST_FETCH, WebAPIEvents.props.EVENT_WEBAPI_REQUEST_FETCH);
}
405138
public void register(String pattern, HttpRequestHandler handler) {
        registry.register(pattern, handler);
        registry.register(pattern + "/", handler);
    }
400063
function register(server, options, next) {
	Schema.validate(options, function (error, config) {
		if (error) {
			next(error);
		} else {
			// register a new type handler: asyncHandler
			server.handler(config.handlerName, function (route, asyncHandler) {
				return function (request, reply) {
					// call the handler, the handler should be async function return Promise object
					asyncHandler(request, reply).catch(err => {
						// use the defaultErrorhandler is defined
						if (_.isFunction(config.defaultErrorHandler)) {
							config.defaultErrorHandler(err, request, reply);
						} else {
							reply(err);
						}
					});
				};
			});

			const dirs = config.routes;
			_.each(dirs, dir => {
				const relativePath = path.relative(__dirname, process.cwd() + '/' + dir);
				importDirectory(module, relativePath, {
					visit: function visit(obj) {
						if (!_.isUndefined(obj)) {
							let routes = _.isArray(obj) ? obj : [obj];
							_.each(routes, route => {
								server.route(route);
							});
						}
					}
				});
			});
			next();
		}
	});
}
1123576
public void registerHandler(String method, String url, OphApiHandler handler) {
		if (mtdHandler == null)
			mtdHandler = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);

		TreeMap<String, OphApiHandler> reg;
		if (method == null)
			method = "ALL";
		reg = mtdHandler.get(method);
		if (reg == null) {
			reg = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
			mtdHandler.put(method, reg);
		}
		reg.put(url, handler);
	}
424232
function defineProperty (key, handler, value) {
    Object.defineProperty(ctrl, key, {
      get: function () { return value; },
      set: function (newValue) {
        var oldValue = value;
        value        = newValue;
        handler && handler(newValue, oldValue);
      }
    });
  }