Index: vtcross/branches/bhilburn/src/policy_engines/PolicyEngine.cpp
===================================================================
--- vtcross/branches/bhilburn/src/policy_engines/PolicyEngine.cpp	(revision 143)
+++ vtcross/branches/bhilburn/src/policy_engines/PolicyEngine.cpp	(revision 155)
@@ -9,4 +9,8 @@
 
 
+#include <cstdlib>
+#include <cstring>
+#include <stdint.h>
+
 #include "vtcross/common.h"
 #include "vtcross/components.h"
@@ -17,55 +21,113 @@
 
 
-void PolicyEngine::GetRemoteComponentType()
+PolicyEngine::PolicyEngine()
+{
+    LOG("Creating Policy Engine.\n");
+    LoadPolicies();
+}
+
+
+PolicyEngine::~PolicyEngine()
 {
 }
 
 
-void PolicyEngine::WaitForSignal()
+void 
+PolicyEngine::GetRemoteComponentType(int32_t socketFD)
 {
 }
 
 
-void PolicyEngine::Shutdown()
+void 
+PolicyEngine::WaitForSignal(int32_t socketFD)
+{
+    LOG("Policy Engine:: Waiting for Policy Check Request.\n");
+
+    int32_t decision_array[10];
+    struct Parameter pList[10];
+    struct CE_Info ce_info;
+    int32_t ret = GetRequest(socketFD, pList, &ce_info);
+   
+    if(ret == 1) {
+        LOG("Policy Engine:: Validating Transmission Parameters.\n");
+        ValidateParameters(pList, &ce_info, decision_array);    
+
+        LOG("Policy Engine:: Sending Policy decision to Server.\n");
+        SendPEDecision(socketFD, pList, &ce_info, decision_array);
+    }
+}
+
+
+void 
+PolicyEngine::Shutdown()
 {
 }
 
 
-void PolicyEngine::Reset()
+void
+PolicyEngine::Reset()
 {
 }
 
 
-void PolicyEngine::RegisterComponent(socketFD, compType)
+void
+PolicyEngine::RegisterComponent(int32_t socketFD)
+{
+    SendMessage(socketFD, "p_register");
+    LOG("Policy Engine:: Registration message sent.\n");
+}
+
+
+void 
+PolicyEngine::DeregisterComponent(int32_t socketFD)
 {
 }
 
 
-void PolicyEngine::DeregisterComponent()
+void 
+PolicyEngine::RegisterServices(int32_t socketFD)
 {
 }
 
 
-void PolicyEngine::RegisterServices()
+void 
+PolicyEngine::DeregisterServices(int32_t socketFD)
 {
 }
 
 
-void PolicyEngine::DeregisterServices()
+void 
+PolicyEngine::LoadPolicies()
+{
+    LOG("PolicyEngine:: Loading policies.\n");
+}
+
+
+void 
+PolicyEngine::ReloadPolicies()
 {
 }
 
 
-void PolicyEngine::ReloadPolicies()
+void 
+PolicyEngine::SendPEDecision(int32_t socketFD, struct Parameter pList[], \
+        struct CE_Info *ce_info, int32_t decision_array[])
 {
-}
-
-void PolicyEngine::LoadPolicies()
-{
+    char var[50];
+ 
+    for (size_t i = 0; i < ce_info->numParameters; i++) {
+        sprintf(var, "%i", decision_array[i]);
+        SendMessage(socketFD, var);
+    }
 }
 
 
-void PolicyEngine::ValidateParameters()
+void 
+PolicyEngine::ValidateParameters(struct Parameter pList[], \
+        struct CE_Info *ce_info, int decision_array[])
 {
+    LOG("Policy Engine:: Policies Validated.\n");
+    for (size_t i = 0; i < ce_info->numParameters; i++)
+        decision_array[i] = 1;
 }
 
Index: vtcross/branches/bhilburn/src/policy_engines/Makefile.am
===================================================================
--- vtcross/branches/bhilburn/src/policy_engines/Makefile.am	(revision 133)
+++ vtcross/branches/bhilburn/src/policy_engines/Makefile.am	(revision 155)
@@ -5,4 +5,4 @@
 bin_PROGRAMS = policy_demo
 
-policy_demo_SOURCES = default_policy_engine.cpp
+policy_demo_SOURCES = PolicyEngine.cpp default_policy_engine.cpp
 
Index: vtcross/branches/bhilburn/src/policy_engines/default_policy_engine.cpp
===================================================================
--- vtcross/branches/bhilburn/src/policy_engines/default_policy_engine.cpp	(revision 151)
+++ vtcross/branches/bhilburn/src/policy_engines/default_policy_engine.cpp	(revision 155)
@@ -18,4 +18,5 @@
 
 #include "vtcross/common.h"
+#include "vtcross/components.h"
 #include "vtcross/containers.h"
 #include "vtcross/socket_comm.h"
@@ -26,79 +27,19 @@
 
 int32_t 
-ValidateTransmissionParameters(struct Parameter pList[], \
-        struct CE_Info *ce_info, int decision_array[])
-{
-    LOG("Policy Engine:: Policies Validated.\n");
-    for (size_t i = 0; i < ce_info->numParameters; i++)
-        decision_array[i] = 1;
-
-    return 1;
-}
-
-
-int32_t 
-RegisterPE(int32_t socketFD)
-{
-    SendMessage(socketFD, "p_register");
-    LOG("Policy Engine:: Registration message sent.\n");
-    return 1;
-}
-
-
-int32_t 
-SendCEDecision(int32_t socketFD, struct Parameter pList[], \
-        struct CE_Info *ce_info, int32_t decision_array[])
-{
-    char var[50];
- 
-    for (size_t i = 0; i < ce_info->numParameters; i++) {
-        sprintf(var, "%i", decision_array[i]);
-        SendMessage(socketFD, var);
-    }
-    
-    return 1;
-}
-
-
-int32_t 
-ParsePolicies() 
-{
-
-    LOG("Policy Engine:: Policies parsed.\n");
-    return 1;
-}
-
-
-int32_t 
 main(int32_t argc, char *argv[])
 {
     if(argc < 3)
        ERROR(1, "Usage: %s hostname port\n", argv[0]);
-
-    int32_t decision_array[10];
-    struct Parameter pList[10];
-    struct CE_Info ce_info;
-    int32_t ret = 0;
     
     int32_t socketFD = ClientSocket(argv[1], argv[2]);
 
-    LOG("Policy Engine:: Parsing local policies.\n");
-    ParsePolicies();
-
-    RegisterPE(socketFD);
+    PolicyEngine policyEngine;
+    policyEngine.RegisterComponent(socketFD);
 
     while(1) {
-        LOG("Policy Engine:: Waiting for Policy Check Request.\n");
-        ret = GetRequest(socketFD, pList, &ce_info);
-       
-        if(ret == 1) {
-            LOG("Policy Engine:: Validating Transmission Parameters.\n");
-            ValidateTransmissionParameters(pList, &ce_info, decision_array);    
-   
-            LOG("Policy Engine:: Sending Policy decision to Server.\n");
-            SendCEDecision(socketFD, pList, &ce_info, decision_array);
-        }
+        policyEngine.WaitForSignal(socketFD);
     }
-    
+
     return 0;
 }
+
