Registers a connection adapter to a prefix.

        Adapters are sorted in descending order by prefix length.
198031
def mount(self, prefix, adapter):
        
        self.adapters[prefix] = adapter
        keys_to_move = [k for k in self.adapters if len(k) < len(prefix)]

        for key in keys_to_move:
            self.adapters[key] = self.adapters.pop(key)
1038419
def register_nested(
        self, parent_prefix, prefix, viewset,
        base_name=None, parent_lookup_name=None,
        depth_level=1
    ):
        
        kwargs = {
            'trailing_slash': bool(self.trailing_slash)
        }

        if parent_lookup_name is not None:
            kwargs.update(lookup=parent_lookup_name)

        # Section for the depth of the route and add more routes

        if depth_level > 1:
            routers = filter(
                lambda r: (r._depth_level == (depth_level - 1)) and
                r._nested_prefix == parent_prefix,
                self._nested_object_registry
            )

            try:
                parent_router = next(routers)
            except StopIteration:
                raise RuntimeError('parent registered resource not found')

        else:
            parent_router = self

        nested_router = NestedSimpleRouter(
            parent_router,
            parent_prefix,
            **kwargs
        )

        nested_router._nested_prefix = prefix
        nested_router._depth_level = depth_level
        nested_router.register(prefix, viewset, base_name)
        self._nested_object_registry.append(nested_router)
911258
def insert(self, context):
	
		
		
		status_code, msg = self.__endpoint.post(
			"/resources/connector-connection-pool",
			data={
				"id": self.__name,
				"resourceAdapterName": self.__res_adapter_name,
				"connectiondefinitionname": self.__conn_def_name,
				"property": props_value(self.__props)
			}
		)
		self.__available = True
855838
def register(self, portstr, username, password, pfactory):
        
        # do some basic normalization of portstrs
        if isinstance(portstr, type(0)) or ':' not in portstr:
            portstr = "tcp:%s" % portstr

        reg = Registration(self, portstr, username)

        if portstr not in self.dispatchers:
            disp = self.dispatchers[portstr] = Dispatcher(portstr)
            disp.setServiceParent(self)
        else:
            disp = self.dispatchers[portstr]

        disp.register(username, password, pfactory)

        return reg
1176234
public void addAll(Configuration other, String prefix) {
		final StringBuilder bld = new StringBuilder();
		bld.append(prefix);
		final int pl = bld.length();

		synchronized (this.confData) {
			synchronized (other.confData) {
				for (Map.Entry<String, Object> entry : other.confData.entrySet()) {
					bld.setLength(pl);
					bld.append(entry.getKey());
					this.confData.put(bld.toString(), entry.getValue());
				}
			}
		}
	}
868615
private static boolean registerPort(String name, RequestHandler handler, 
			RequestMapper mapper) {
		Matcher m = null;
		m = PORT_PATTERN.matcher(name);
		if(m.matches()) {
			int port = Integer.parseInt(m.group(1)); 
			mapper.addRequestHandler(port, null, null, handler);
			return true;
		}
		return false;
	}
723754
def register_prefix(self, nspair):
        
        for prefix, uri in nspair.items():
            try:
                ElementTree.register_namespace(prefix, uri)
            except AttributeError:
                # Backwards compatibility with ET < 1.3
                ElementTree._namespace_map[uri] = prefix
            except ValueError:
                pass
599607
def _register_socket(self):
        """"""
        _socket = socket.socket(*Socket.protocols[self.connection.proto])
        _socket.settimeout(self.timeout)

        # Reconfigure original socket options.
        if self.connection.sockopts:
            for sock_opt in self.connection.sockopts:
                level, option, value = sock_opt
                _socket.setsockopt(level, option, value)

        _socket.connect(self.connection.connect_to)
        return _socket
73109
def adapter_add_nio_binding(self, adapter_number, port_number, nio):
        

        try:
            adapter = self._adapters[adapter_number]
        except IndexError:
            raise IOUError('Adapter {adapter_number} does not exist for IOU "{name}"'.format(name=self._name,
                                                                                             adapter_number=adapter_number))

        if not adapter.port_exists(port_number):
            raise IOUError("Port {port_number} does not exist in adapter {adapter}".format(adapter=adapter,
                                                                                           port_number=port_number))

        adapter.add_nio(port_number, nio)
        log.info('IOU "{name}" [{id}]: {nio} added to {adapter_number}/{port_number}'.format(name=self._name,
                                                                                             id=self._id,
                                                                                             nio=nio,
                                                                                             adapter_number=adapter_number,
                                                                                             port_number=port_number))

        if self.ubridge:
            bridge_name = "IOL-BRIDGE-{}".format(self.application_id + 512)
            yield from self._ubridge_send("iol_bridge add_nio_udp {name} {iol_id} {bay} {unit} {lport} {rhost} {rport}".format(name=bridge_name,
                                                                                                                               iol_id=self.application_id,
                                                                                                                               bay=adapter_number,
                                                                                                                               unit=port_number,
                                                                                                                               lport=nio.lport,
                                                                                                                               rhost=nio.rhost,
                                                                                                                               rport=nio.rport))
            yield from self._ubridge_apply_filters(adapter_number, port_number, nio.filters)
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);
	}
1247158
def register(adapter):
    ''''''
    # register the class in the catalog
    if adapter.model and adapter.model not in adapter_catalog:
        adapter_catalog[adapter.model] = adapter
        # Automatically (re|un)index objects on save/delete
        post_save.connect(reindex_model_on_save, sender=adapter.model)
        post_delete.connect(unindex_model_on_delete, sender=adapter.model)
    return adapter
1195271
def connection_class(self, adapter):
        """"""
        if self.adapters.get(adapter):
            return self.adapters[adapter]
        try:
            class_prefix = getattr(
                __import__('db.' + adapter, globals(), locals(),
                           ['__class_prefix__']), '__class_prefix__')
            driver = self._import_class('db.' + adapter + '.connection.' +
                                        class_prefix + 'Connection')
        except ImportError:
            raise DBError("Must install adapter `%s` or doesn't support" %
                          (adapter))

        self.adapters[adapter] = driver
        return driver
442596
private void doSocketConnect(InetSocketAddress addr) throws IOException{
        SocketChannel sock = createSock();
        registerAndConnect(sock, addr);
    }
784351
public void registerNamespace(String prefix, String uri)
   {
      try
      {
         namespaceRegistry.getPrefix(uri);
      }
      catch (NamespaceException e)
      {
         try
         {
            namespaceRegistry.registerNamespace(prefix, uri);
         }
         catch (NamespaceException e1)
         {
            throw new RuntimeException(e1);
         }
         catch (RepositoryException e1)
         {
            throw new RuntimeException(e1);
         }
      }
      catch (RepositoryException e)
      {
         throw new RuntimeException(e);
      }

   }
447137
public void addCallbackToConnectionIndex(
    ConnectionImpl connection,
    String topicExpression,
    boolean isWildcarded,
    ConsumerSetChangeCallback callback)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(
          tc,
          "addCallbackToConnectionIndex",
          new Object[] {connection, topicExpression, new Boolean(isWildcarded), callback });

    // Map of callbacks-to-expressions for a connection
    Map connMap = null;
    if(_callbackIndex.containsKey(connection))
    {
      // Already have registered callbacks for this connection
      connMap = (HashMap)_callbackIndex.get(connection);
    }
    else
    {
      // No registered callbacks for this connection
      connMap = new HashMap();
      _callbackIndex.put(connection,connMap);
    }

    // Add the new callback to the index, so we can find it when we deregister
    TopicRecord tRecord = new TopicRecord(topicExpression, isWildcarded);
    connMap.put(callback, tRecord);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "addCallbackToConnectionIndex");

  }
1373546
def add_prefix(self, prefix, flags, prf):
        
        self._req('prefix add %s %s %s' % (prefix, flags, prf))
        time.sleep(1)
        self._req('netdataregister')
321842
private void registerModelAdapter() {
        Dictionary<String, Object> properties = createResourceToModelAdapterProperties();
        String serviceClassName = AdapterFactory.class.getName();
        this.resourceToModelAdapterRegistration = this.context.registerService(serviceClassName, this.adapter, properties);
    }