/**************************************************************************** Copyright 2006 Virginia Polytechnic Institute and State University This file is part of the OSSIE Modulator. OSSIE Modulator is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. OSSIE Modulator is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OSSIE Modulator; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ****************************************************************************/ #include #include "ossie/ossieSupport.h" #include "ossie/debug.h" #include "Modulator.h" int main(int argc, char* argv[]) { ossieDebugLevel = 3; ossieSupport::ORB *orb = new ossieSupport::ORB; omni_mutex component_running_mutex; omni_condition *component_running = new omni_condition(&component_running_mutex); ossieSupport::ossieComponent modulator(orb, argc, argv); Modulator_i* modulator_servant; CF::Resource_var modulator_var; // Create the modulator component servant and object reference modulator_servant = new Modulator_i(modulator.getUuid(), component_running); modulator_var = modulator_servant->_this(); PortableServer::ObjectId_var servantId = orb->poa->reference_to_id(modulator_var); modulator.bind(modulator_var); // This bit is ORB specific // omniorb is threaded and the servants are running at this point // so we block on the condition // The releaseObject method clear the condition and the component exits component_running->wait(); modulator.unbind(); DEBUG(4, Modulator, "Deactivate object."); orb->poa->deactivate_object(servantId); DEBUG(4, Modulator, "Destroy POA."); orb->poa->destroy(false, false); DEBUG(4, Modulator, "Shutdown orb."); orb->orb->shutdown(0); }