Hyunsun Moon | e7e4bb3 | 2016-05-16 04:32:45 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-present Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
alshabib | b4d3171 | 2016-06-01 18:51:03 -0700 | [diff] [blame] | 16 | package org.opencord.cordvtn.impl.service; |
Hyunsun Moon | e7e4bb3 | 2016-05-16 04:32:45 -0700 | [diff] [blame] | 17 | |
| 18 | import org.apache.felix.scr.annotations.Activate; |
| 19 | import org.apache.felix.scr.annotations.Component; |
| 20 | |
| 21 | import org.apache.felix.scr.annotations.Deactivate; |
alshabib | b4d3171 | 2016-06-01 18:51:03 -0700 | [diff] [blame] | 22 | import org.opencord.cordvtn.api.Instance; |
| 23 | import org.opencord.cordvtn.api.InstanceHandler; |
| 24 | import org.opencord.cordvtn.impl.CordVtnInstanceHandler; |
Hyunsun Moon | e7e4bb3 | 2016-05-16 04:32:45 -0700 | [diff] [blame] | 25 | import org.onosproject.xosclient.api.VtnService; |
| 26 | |
| 27 | import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor; |
| 28 | import static org.onlab.util.Tools.groupedThreads; |
| 29 | |
| 30 | /** |
| 31 | * Provides network connectivity for dummy service instances. |
| 32 | */ |
| 33 | @Component(immediate = true) |
| 34 | public class DummyInstanceHandler extends CordVtnInstanceHandler implements InstanceHandler { |
| 35 | |
| 36 | @Activate |
| 37 | protected void activate() { |
| 38 | serviceType = VtnService.ServiceType.DUMMY; |
| 39 | eventExecutor = newSingleThreadScheduledExecutor(groupedThreads("onos/cordvtn-dummy", "event-handler")); |
| 40 | super.activate(); |
| 41 | } |
| 42 | |
| 43 | @Deactivate |
| 44 | protected void deactivate() { |
| 45 | super.deactivate(); |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public void instanceDetected(Instance instance) { |
| 50 | super.instanceDetected(instance); |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public void instanceRemoved(Instance instance) { |
| 55 | super.instanceRemoved(instance); |
| 56 | } |
| 57 | } |