Ejemplo n.º 1
0
bool Node::_cmdConfigExit( co::Command& command )
{
    LB_TS_THREAD( _nodeThread );
    LBLOG( LOG_INIT ) << "Node exit " 
                      << command.get<NodeConfigExitPacket>() << std::endl;

    const Pipes& pipes = getPipes();
    for( Pipes::const_iterator i = pipes.begin(); i != pipes.end(); ++i )
    {
        Pipe* pipe = *i;
        pipe->waitExited();
    }
    
    _state = configExit() ? STATE_STOPPED : STATE_FAILED;
    transmitter.getQueue().wakeup();
    transmitter.join();
    _flushObjects();

    ConfigDestroyNodePacket destroyPacket( getID( ));
    getConfig()->send( getLocalNode(), destroyPacket );
    return true;
}
Ejemplo n.º 2
0
bool Node::_cmdConfigExit( co::ICommand& cmd )
{
    co::ObjectICommand command( cmd );

    LB_TS_THREAD( _nodeThread );
    LBLOG( LOG_INIT ) << "Node exit " << command << std::endl;

    const Pipes& pipes = getPipes();
    for( PipesCIter i = pipes.begin(); i != pipes.end(); ++i )
    {
        Pipe* pipe = *i;
        pipe->waitExited();
    }

    _impl->state = configExit() ? STATE_STOPPED : STATE_FAILED;
    getTransmitterQueue()->push( co::ICommand( )); // wake up to exit
    _impl->transmitter.join();
    _flushObjects();

    getConfig()->send( getLocalNode(),
                       fabric::CMD_CONFIG_DESTROY_NODE ) << getID();
    return true;
}