X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frest%2Fimpl%2FRestconfProvider.java;h=2abd4b6a3ab5b9a08c56e782257a262db80fbfe2;hp=09cf01091ed0deaa3c3ea5f86d35134d5ae89a84;hb=510561642a3d699673140da8879d4eb5bc88534e;hpb=730db233aa71642f0aa8a70f30fcd5bbbbbabac9 diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfProvider.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfProvider.java index 09cf01091e..2abd4b6a3a 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfProvider.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfProvider.java @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ package org.opendaylight.controller.sal.rest.impl; import java.util.Collection; @@ -11,6 +18,7 @@ import org.opendaylight.controller.sal.core.api.model.SchemaService; import org.opendaylight.controller.sal.core.api.mount.MountService; import org.opendaylight.controller.sal.restconf.impl.BrokerFacade; import org.opendaylight.controller.sal.restconf.impl.ControllerContext; +import org.opendaylight.controller.sal.streams.websockets.WebSocketServer; import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.yang.model.api.SchemaServiceListener; import org.osgi.framework.BundleActivator; @@ -26,7 +34,7 @@ public class RestconfProvider implements BundleActivator, Provider, ServiceTrack private ListenerRegistration listenerRegistration; private ServiceTracker brokerServiceTrancker; private BundleContext bundleContext; - private ProviderSession session; + private Thread webSocketServerThread; @Override public void onSessionInitiated(ProviderSession session) { @@ -46,6 +54,9 @@ public class RestconfProvider implements BundleActivator, Provider, ServiceTrack bundleContext = context; brokerServiceTrancker = new ServiceTracker<>(context, Broker.class, this); brokerServiceTrancker.open(); + webSocketServerThread = new Thread(new WebSocketServer()); + webSocketServerThread.setName("Web socket server"); + webSocketServerThread.start(); } @Override @@ -57,7 +68,7 @@ public class RestconfProvider implements BundleActivator, Provider, ServiceTrack e.printStackTrace(); } } - session.close(); + webSocketServerThread.interrupt(); brokerServiceTrancker.close(); }