Initiates the module

@param \AppserverIo\Server\Interfaces\ServerContextInterface $serverContext The server's context instance

@return bool
@throws \AppserverIo\Server\Exceptions\ModuleException
17730
public function init(ServerContextInterface $serverContext)
    {

        // initialize the server context
        $this->serverContext = $serverContext;

        // initialize the profile logger
        if ($serverContext->hasLogger(LoggerUtils::PROFILE)) {
            $this->profileLogger = $serverContext->getLogger(LoggerUtils::PROFILE);
        }
    }
428558
public function create(ServerRequestInterface $request, Route $route)
    {
        $this->uriGenerator->setRequest($request);
        return new Context($request, $route, $this->uriGenerator);
    }
993480
protected function setContext($context = null)
    {
        if ($context) {
            $this->context = new LogContext($this->parser, $context);
        }
    }
341722
protected function initializeSorting(ContextInterface $context)
    {
        if (null !== $activeSort = $context->getActiveSort()) {
            $columnName = $activeSort->getColumnName();
            if ($this->table->hasColumn($columnName)) {
                $this->table->getColumn($columnName)->applySort($this, $activeSort);
            }
        }
    }
1062992
private function initializeSessionContext()
    {
        $sessionServer = SessionServer::create($this)->getValue();
        $this->sessionContext = SessionContext::create($sessionServer);
    }
691511
public function assemble(ContextInterface $context)
    {
        try {
            $interfaceAssembler = new InterfaceAssembler(JsonSerializable::class);
            if ($interfaceAssembler->canAssemble($context)) {
                $interfaceAssembler->assemble($context);
            }

            $this->implementJsonSerialize($context->getType(), $context->getClass());
        } catch (\Exception $e) {
            throw AssemblerException::fromException($e);
        }
    }
213680
public function updateUserContext(UserContext $context): void
    {
        if ($this->session->isStarted()) {
            $context->addParameter('sessionId', $this->session->getId());
        }
    }
22703
public function execute(MappingContext $context)
	{
		$typeMap = $this->config->findTypeMap($context->getSourceType(), $context->getDestinationType());

		try {
			$typeMap->validate();
			$mapFunc = $typeMap->getMapFunc();

			$destination = is_array($context->getSource())
				? $this->mapCollection($context, $mapFunc)
				: $this->mapObject($context, $mapFunc);
			return $destination;
		} catch (\Exception $e) {
			$message = sprintf("Error while mapping %s -> %s", $typeMap->getSourceType(), $typeMap->getDestinationType());
			throw new MappingException($message, 0, $e);
		}
	}
249039
protected function _beforeInsert(DatabaseContext $context)
    {
        $method = 'get'.ucfirst($this->_column);
        if($context->data->$method() instanceof ObjectConfigInterface) {
            $context->data->setProperty($this->_column, $context->data->$method()->toString());
        }
    }
600433
public function init(ServletConfigInterface $servletConfig)
    {
        parent::init($servletConfig);
        $this->applicationContext = $this->getServletContext()->getApplication();
        $this->initialContext = new InitialContext();
        $this->initialContext->injectApplication($this->applicationContext);
        $this->logger = $this->applicationContext->getInitialContext()->getSystemLogger();
        $this->logger->debug('Initializing Servlet '.str_replace("\n", " - ", $this->servletInfo));
        if (file_exists(__DIR__."/DispatcherServlet.properties") && is_readable(__DIR__."/DispatcherServlet.properties")) {
            $this->defaultStrategies = new Properties();
            try {
                $this->defaultStrategies->load(__DIR__."/DispatcherServlet.properties");
            } catch (PropertyFileParseException $exc) {
                $this->logger->error("Could not read default strategies");
            }
        }
        $this->initStrategies();
    }
1090307
public function addModuleToReset(ModuleContainerInterface $module)
    {
        $path = $module->getPath(['database', 'migrations']);
        $this->migrator->requireFiles($path, $this->migrator->getMigrationFiles($path));

        return $this;
    }
1144317
public function assemble(ContextInterface $context)
    {
        try {
            $interfaceAssembler = new InterfaceAssembler(ResultInterface::class);
            if ($interfaceAssembler->canAssemble($context)) {
                $interfaceAssembler->assemble($context);
            }
        } catch (\Exception $e) {
            throw AssemblerException::fromException($e);
        }
    }
791866
public function setContext(RequestContext $context)
    {
        if (null !== $this->generator) {
            $this->getGenerator()->setContext($context);
        }
        $this->context = $context;
    }
532726
public function initialize(Server $server)
    {
        $this->server = $server;
        $server->on('method:GET', [$this, 'httpGet']);
        $server->on('method:OPTIONS', [$this, 'httpOptions']);
        $server->on('method:HEAD', [$this, 'httpHead']);
        $server->on('method:DELETE', [$this, 'httpDelete']);
        $server->on('method:PROPFIND', [$this, 'httpPropFind']);
        $server->on('method:PROPPATCH', [$this, 'httpPropPatch']);
        $server->on('method:PUT', [$this, 'httpPut']);
        $server->on('method:MKCOL', [$this, 'httpMkcol']);
        $server->on('method:MOVE', [$this, 'httpMove']);
        $server->on('method:COPY', [$this, 'httpCopy']);
        $server->on('method:REPORT', [$this, 'httpReport']);

        $server->on('propPatch', [$this, 'propPatchProtectedPropertyCheck'], 90);
        $server->on('propPatch', [$this, 'propPatchNodeUpdate'], 200);
        $server->on('propFind', [$this, 'propFind']);
        $server->on('propFind', [$this, 'propFindNode'], 120);
        $server->on('propFind', [$this, 'propFindLate'], 200);

        $server->on('exception', [$this, 'exception']);
    }
1277445
final public function run(ServerRequestInterface $server)
    {
        $this->kernel->initialize($server);

        FatalError::register(); // TODO: fix for FatalErrors

        try {
            return $this->doRun();
        } catch (\Exception $e) {
            if ($this->kernel->isDebug()) {
                (new DispatcherInjector)->build()->signal('kernel.exception', ['exception' => $e]);

                throw $e;
            }

            return $this->doException($e);
        }
    }
501078
public function initContext()
    {
        $this->context = array();

        $this->addContext('time', microtime(true));

        $this->addContext('bouncer', array('pid' => getmypid()));
    }
67396
public void init(ClientContext clientContext) {
        this.clientContext = clientContext;
        this.clientConnectionStrategyConfig = clientContext.getClientConfig().getConnectionStrategyConfig();
        this.logger = clientContext.getLoggingService().getLogger(ClientConnectionStrategy.class);
    }