BUG-542 - adding overall statictics
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / SwitchConnectionHandlerImpl.java
index e205b29d391c1f94c28621f6c9d27c62070569d1..50d3bee271044d4f7c4f0e4e2db329b093460020 100644 (file)
@@ -17,8 +17,7 @@ import org.opendaylight.openflowjava.protocol.api.connection.SwitchConnectionHan
 import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
 import org.opendaylight.openflowplugin.openflow.md.queue.MessageSpy;
 import org.opendaylight.openflowplugin.openflow.md.queue.QueueKeeperLightImpl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
-import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
  * basic interconnecting piece between plugin and library 
@@ -29,7 +28,7 @@ public class SwitchConnectionHandlerImpl implements SwitchConnectionHandler {
 
     private QueueKeeperLightImpl queueKeeper;
     private ErrorHandler errorHandler;
-    private MessageSpy<OfHeader, DataObject> messageSpy;
+    private MessageSpy<DataContainer> messageSpy;
     private int spyRate = 10;
 
     /**
@@ -38,10 +37,6 @@ public class SwitchConnectionHandlerImpl implements SwitchConnectionHandler {
     public SwitchConnectionHandlerImpl() {
         queueKeeper = new QueueKeeperLightImpl();
         
-        errorHandler = new ErrorHandlerQueueImpl();
-        //TODO: implement shutdown invocation upon service stop event
-        new Thread(errorHandler).start();
-        
         //TODO: implement shutdown invocation upon service stop event
         spyPool = new ScheduledThreadPoolExecutor(1);
     }
@@ -75,8 +70,15 @@ public class SwitchConnectionHandlerImpl implements SwitchConnectionHandler {
     /**
      * @param messageSpy the messageSpy to set
      */
-    public void setMessageSpy(MessageSpy<OfHeader, DataObject> messageSpy) {
+    public void setMessageSpy(MessageSpy<DataContainer> messageSpy) {
         this.messageSpy = messageSpy;
     }
+    
+    /**
+     * @param errorHandler the errorHandler to set
+     */
+    public void setErrorHandler(ErrorHandler errorHandler) {
+        this.errorHandler = errorHandler;
+    }
 
 }