Index: /components/ChannelDemo/trunk/ChannelDemo/main.cpp
===================================================================
--- /components/ChannelDemo/trunk/ChannelDemo/main.cpp	(revision 4249)
+++ /components/ChannelDemo/trunk/ChannelDemo/main.cpp	(revision 6161)
@@ -1,5 +1,5 @@
 /****************************************************************************
 
-Copyright 2006 Virginia Polytechnic Institute and State University
+Copyright 2006, 2008 Virginia Polytechnic Institute and State University
 
 This file is part of the OSSIE ChannelDemo.
@@ -22,36 +22,21 @@
 
 #include <iostream>
+
 #include "ossie/ossieSupport.h"
+#include "ossie/ossieResource.h"
+#include "ossie/debug.h"
 
 #include "ChannelDemo.h"
-
 
 int main(int argc, char* argv[])
 
 {
-    ossieSupport::ORB *orb = new ossieSupport::ORB;
-    omni_mutex component_running_mutex;
-    omni_condition *component_running = new omni_condition(&component_running_mutex);
 
-    ossieSupport::ossieComponent channelDemo(orb, argc, argv);
+    ossieDebugLevel = 9;
 
-    ChannelDemo_i* channeldemo_servant;
-    CF::Resource_var channeldemo_var;
+    DEBUG(5, ChannelDemo, "Starting component.");
 
-    // Create the channeldemo component servant and object reference
+    ossieResource<ChannelDemo_i> ChannelDemo(argc, argv);
 
-    channeldemo_servant = new ChannelDemo_i(channelDemo.getUuid(), component_running);
-    channeldemo_var = channeldemo_servant->_this();
-
-    channelDemo.bind(channeldemo_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();
-    channelDemo.unbind();
-    orb->orb->shutdown(0);
-
+    ChannelDemo.run();
 }
