Register the annotation of server
978114
public function autoloadServerAnnotation()
    {
        $bootScan = $this->getScanNamespaceFromProperties('bootScan');
        $resource = new ServerAnnotationResource($this->properties);
        $resource->addScanNamespace($bootScan);
        $definitions = $resource->getDefinitions();

        $this->definitions = array_merge($definitions, $this->definitions);
    }
291625
protected function registerDatabaseService(): void
    {
        $this->app->alias('db', \Illuminate\Database\ConnectionResolverInterface::class);
        $this->app->register(\Illuminate\Database\DatabaseServiceProvider::class);

        if (File::exists($this->app->databasePath('seeds'))) {
            collect(File::files($this->app->databasePath('seeds')))->each(
                function ($file) {
                    File::requireOnce($file);
                }
            );
        }
    }
150754
public <A extends Annotation> void register(final Class<A> anno, final ConversionProcessorFactory<A> factory) {
        factoryMap.put(anno, factory);
    }
329115
def register(self):
        
        self._queue.put(hello_packet(socket.gethostname(), mac(), __version__))
        self._queue.put(request_packet(MSG_SERVER_SETTINGS))
        self._queue.put(request_packet(MSG_SAMPLE_FORMAT))
        self._queue.put(request_packet(MSG_HEADER))
772064
protected void registerForMBeanNotifications() {
        Set<MBeanServerConnection> servers = getMBeanServers();
        Exception lastExp = null;
        StringBuilder errors = new StringBuilder();
        for (MBeanServerConnection server : servers) {
            try {
                JmxUtil.addMBeanRegistrationListener(server,this,null);
            } catch (IllegalStateException e) {
                lastExp = updateErrorMsg(errors,e);
            }
        }
        if (lastExp != null) {
            throw new IllegalStateException(errors.substring(0,errors.length()-1),lastExp);
        }
    }
410200
public void registerMbeans() {
        ServerAdminMBean serverAdministrationBean = new ServerAdmin();
        try {

            mbeanServer.registerMBean(serverAdministrationBean,
                    JMXUtils.getObjectName(jmxConfig.getContextName(), "ServerAdmin"));
        } catch (InstanceAlreadyExistsException e) {
            throw new InitializationException("Could not initialize the MBean.!", e);
        } catch (MBeanRegistrationException e) {
            throw new InitializationException("Could not initialize the MBean.!", e);
        } catch (NotCompliantMBeanException e) {
            throw new InitializationException("Could not initialize the MBean.!", e);
        }

    }
669171
public function registerServerNamespace()
    {
        foreach ($this->customComponents as $ns => $componentDir) {
            if (is_int($ns)) {
                $ns = $componentDir;
                $componentDir = ComposerHelper::getDirByNamespace($ns);
                $ns = rtrim($ns, "\\");
                $componentDir = rtrim($componentDir, "/");
            }

            $this->componentNamespaces[] = $ns;
            $componentDir = alias($componentDir);

            foreach ($this->serverScan as $dir) {
                $scanDir = $componentDir . DS . $dir;
                if (!is_dir($scanDir)) {
                    continue;
                }

                $scanNs = $ns . "\\" . $dir;
                $this->scanNamespaces[$scanNs] = $scanDir;
            }
        }
    }
880768
ServerSessionManager registerConnection(String client, Connection connection) {
    ServerSessionContext session = clients.get(client);
    if (session != null) {
      session.setConnection(connection);
    }
    connections.put(client, connection);
    return this;
  }
126038
@Override
	public MetricsPlugin register(RestExpress server)
	{
		if (isRegistered) return this;

		server.registerPlugin(this);
		this.isRegistered = true;

		server
			.addMessageObserver(this)
			.addPreprocessor(this)
			.addFinallyProcessor(this);

		return this;
	}
215787
private function registerAnnotation($class)
    {
        /** @var CustomField $annotation */
        if ($annotation = $this->annotationReader->getClassAnnotation(
            new \ReflectionClass($class),
            'Lullabot\Mpx\DataService\Annotation\CustomField'
        )) {
            if (!is_subclass_of($class, CustomFieldInterface::class)) {
                throw new \RuntimeException(sprintf('%s must implement %s.', $class, CustomFieldInterface::class));
            }

            $this->customFields[$annotation->service][$annotation->objectType][$annotation->namespace] = new DiscoveredCustomField(
                $class, $annotation
            );
        }
    }
521335
public void registerUserService() throws Exception {
		Debug.logVerbose("[JdonFramework] note: registe user pojoservice ", module);
		try {
			TargetMetaDefXmlLoader targetMetaDefXmlLoader = (TargetMetaDefXmlLoader) containerWrapper.lookup(ComponentKeys.SERVICE_METALOADER_NAME);
			targetMetaDefXmlLoader.loadXML();
			TargetMetaDefHolder targetMetaDefHolder = (TargetMetaDefHolder) containerWrapper.lookup(ComponentKeys.SERVICE_METAHOLDER_NAME);
			if (targetMetaDefHolder == null)
				return;
			Map metaDefs = targetMetaDefHolder.loadMetaDefs();
			Iterator iter = metaDefs.keySet().iterator();
			while (iter.hasNext()) {
				String name = (String) iter.next();
				TargetMetaDef tgm = (TargetMetaDef) metaDefs.get(name);
				if (!tgm.isEJB()) {
					xmlcontainerRegistry.registerPOJOTargetMetaDef((POJOTargetMetaDef) tgm);
				}
			}
		} catch (Exception ex) {
			Debug.logError("[JdonFramework] registerUserService error:" + ex, module);
			throw new Exception(ex);
		}
	}
539330
public function register(KernelInterface $kernel): void
    {
        /*
        $kernel[ServerRequestCreatorInterface::class] = function ($c) {
            $requestCreator = new ServerRequestCreator(
                $c[ServerRequestFactoryInterface::class],
                $c[UriFactoryInterface::class],
                $c[UploadedFileFactoryInterface::class],
                $c[StreamFactoryInterface::class]);

            return $requestCreator->fromGlobals();
        };*/


        $kernel->closure(ServerRequestCreatorInterface::class, function (ServerRequestFactoryInterface $serverRequestFactory, UriFactoryInterface $uriFactory, UploadedFileFactoryInterface $uploadedFileFactory, StreamFactoryInterface $streamFactory) {
            $requestCreator = new ServerRequestCreator(
                $serverRequestFactory,
                $uriFactory,
                $uploadedFileFactory,
                $streamFactory);

            return $requestCreator->fromGlobals();
        });



        // *** register alias ***
        $kernel->alias(ServerRequestCreator::class, ServerRequestCreatorInterface::class);
        $kernel->alias('request', ServerRequestCreatorInterface::class);
        /*
        $kernel[ServerRequestCreator::class] = function ($c) {
            return $c->get(ServerRequestCreatorInterface::class);
        };

        $kernel['request'] = function ($c) {
            return $c->get(ServerRequestCreatorInterface::class);
        };*/
    }
1232745
public static void registerAllToHttpServer(HttpServer server) {
    server.createContext(tracezZPageHandler.getUrlPath(), new ZPageHttpHandler(tracezZPageHandler));
    server.createContext(
        traceConfigzZPageHandler.getUrlPath(), new ZPageHttpHandler(traceConfigzZPageHandler));
    server.createContext(rpczZpageHandler.getUrlPath(), new ZPageHttpHandler(rpczZpageHandler));
    server.createContext(statszZPageHandler.getUrlPath(), new ZPageHttpHandler(statszZPageHandler));
  }
54414
private void registerHandlers(RaftServerProtocol protocol) {
    protocol.registerOpenSessionHandler(request -> runOnContextIfReady(() -> role.onOpenSession(request), OpenSessionResponse::builder));
    protocol.registerCloseSessionHandler(request -> runOnContextIfReady(() -> role.onCloseSession(request), CloseSessionResponse::builder));
    protocol.registerKeepAliveHandler(request -> runOnContextIfReady(() -> role.onKeepAlive(request), KeepAliveResponse::builder));
    protocol.registerMetadataHandler(request -> runOnContextIfReady(() -> role.onMetadata(request), MetadataResponse::builder));
    protocol.registerConfigureHandler(request -> runOnContext(() -> role.onConfigure(request)));
    protocol.registerInstallHandler(request -> runOnContext(() -> role.onInstall(request)));
    protocol.registerJoinHandler(request -> runOnContext(() -> role.onJoin(request)));
    protocol.registerReconfigureHandler(request -> runOnContext(() -> role.onReconfigure(request)));
    protocol.registerLeaveHandler(request -> runOnContext(() -> role.onLeave(request)));
    protocol.registerTransferHandler(request -> runOnContext(() -> role.onTransfer(request)));
    protocol.registerAppendHandler(request -> runOnContext(() -> role.onAppend(request)));
    protocol.registerPollHandler(request -> runOnContext(() -> role.onPoll(request)));
    protocol.registerVoteHandler(request -> runOnContext(() -> role.onVote(request)));
    protocol.registerCommandHandler(request -> runOnContextIfReady(() -> role.onCommand(request), CommandResponse::builder));
    protocol.registerQueryHandler(request -> runOnContextIfReady(() -> role.onQuery(request), QueryResponse::builder));
  }
1051122
private void registerJMXStuff() {
    LOG.info("registering InApplicationMonitorDynamicMBean on JMX server");

    try {
      jmxBeanRegistrationHelper.registerMBeanOnJMX(this, "InApplicationMonitor", null);
    } catch (Exception e) {
      LOG.error("could not register MBean server : ", e);
    }
  }
1027808
private function registerOAuthServer()
  {
    $this->app->bind('League\OAuth2\Server\Storage\ClientInterface', 'Sule\Api\OAuth2\Repositories\FluentClient');
    $this->app->bind('League\OAuth2\Server\Storage\ScopeInterface', 'Sule\Api\OAuth2\Repositories\FluentScope');
    $this->app->bind('League\OAuth2\Server\Storage\SessionInterface', 'Sule\Api\OAuth2\Repositories\FluentSession');
    $this->app->bind('Sule\Api\OAuth2\Repositories\SessionManagementInterface', 'Sule\Api\OAuth2\Repositories\FluentSession');

    $this->app['api.authorization'] = $this->app->share(function ($app) {

      $server = $app->make('League\OAuth2\Server\Authorization');

      $config = $app['config']->get('sule/api::oauth2');

      // add the supported grant types to the authorization server
      foreach ($config['grant_types'] as $grantKey => $grantValue) {

        $server->addGrantType(new $grantValue['class']($server));
        $server->getGrantType($grantKey)->setAccessTokenTTL($grantValue['access_token_ttl']);

        if (array_key_exists('callback', $grantValue)) {
          $server->getGrantType($grantKey)->setVerifyCredentialsCallback($grantValue['callback']);
        }

        if (array_key_exists('auth_token_ttl', $grantValue)) {
          $server->getGrantType($grantKey)->setAuthTokenTTL($grantValue['auth_token_ttl']);
        }

        if (array_key_exists('refresh_token_ttl', $grantValue)) {
          $server->getGrantType($grantKey)->setRefreshTokenTTL($grantValue['refresh_token_ttl']);
        }

        if (array_key_exists('rotate_refresh_tokens', $grantValue)) {
          $server->getGrantType($grantKey)->rotateRefreshTokens($grantValue['rotate_refresh_tokens']);
        }
      }

      $server->requireStateParam($config['state_param']);

      $server->requireScopeParam($config['scope_param']);

      $server->setScopeDelimeter($config['scope_delimiter']);

      $server->setDefaultScope($config['default_scope']);

      $server->setAccessTokenTTL($config['access_token_ttl']);

      return new OAuthServer($server);

    });

    $this->app['api.resource'] = $this->app->share(function ($app) {

      return $app->make('Sule\Api\OAuth2\Resource');

    });
  }
101253
protected function registerReader()
    {
        // Give a Cached Reader when our
        // reader class needs
        // a ReaderContract.
        $this->app->when(AnnotationsReader::class)
                  ->needs(Reader::class)
                  ->give(function () {
                      return $this->createAndReturnCachedReader();
                  });
    }