35 lines
951 B
C++
35 lines
951 B
C++
//
|
|
// Created by titov on 23.01.2022.
|
|
//
|
|
|
|
#include "AttachMessageServer.hh"
|
|
|
|
bool application::communication::AttachMessageServer::input( application::ISetupStep::Environment & env ) {
|
|
return grab( server, env.rholder.getShared<Server>( links.server ) ) and
|
|
grab( router, env.rholder.getShared<Router>( links.router ) );
|
|
}
|
|
|
|
bool application::communication::AttachMessageServer::prepare() {
|
|
|
|
return router->stop();
|
|
|
|
}
|
|
|
|
void application::communication::AttachMessageServer::build( application::ISetupStep::Environment &env) {
|
|
|
|
|
|
if(links.router) {
|
|
Local<Router> link( router, *env.rholder.getShared<Router>( links.router ) );
|
|
|
|
link->attach( server, config.server_id );
|
|
|
|
link->start();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
application::communication::AttachMessageServer::AttachMessageServer(
|
|
const AttachMessageServer::Links & links,
|
|
const AttachMessageServer::Setting & setting ) : links(links), config(setting) {}
|