void ThreadPool::configure( Xml config ) { runEnabled = config.getBooleanProperty( "run" , true ); nThreads = config.getIntProperty( "threadCount" , 10 ); secondsPerMonitoringCycle = config.getIntProperty( "secondsPerMonitoringCycle" , 10 ); maxLoadPercents = config.getIntProperty( "maxLoadPercents" , 10 ); stopSignal = false; }
void SocketServer::configure( Xml config ) { SocketListener::getProtocol().create( config ); auth = config.getBooleanProperty( "auth" ); String direction = config.getProperty( "direction" ); wayIn = direction.equals( "in" ) || direction.equals( "duplex" ); wayOut = direction.equals( "out" ) || direction.equals( "duplex" ); if( wayIn ) topicIn = config.getProperty( "topic-in" ); if( wayOut ) topicOut = config.getProperty( "topic-out" ); contentType = config.getProperty( "msgtype" , "text" ); if( contentType.equals( "text" ) ) SocketListener::setMsgType( Message::MsgType_Text ); else if( contentType.equals( "xmlcall" ) ) SocketListener::setMsgType( Message::MsgType_XmlCall ); else SocketListener::setMsgType( Message::MsgType_Xml ); port = atoi( config.getProperty( "port" ) ); // make instance Object::setInstance( SocketListener::getName() ); attachLogger(); }